Hacker News new | ask | show | jobs
by rdtsc 4174 days ago
Look at the link to the talk about this project I posted above. Frank used Cowboy (Erlang web server). It was in used in 3 ways -- serving static files, websockets (you can use that for signaling) and streaming binary data (video) using Motion JPEG.

Other projects might use MQTT -- a messaging system built for smaller devices (instead of say AMQP). RabbitMQ has a driver for it:

http://www.rabbitmq.com/blog/2012/09/12/mqtt-adapter/

But if you can get any server that supports websockets and have websocket clients in your client code (if you don't use a browser). Then you can roll your own messages using JSON or even binary.

1 comments

Wow, that looks exactly like what I wanted! Bookmarked the talk immediately, thanks.

Also one big unknown to me is updating the devices. I skimmed the nerves website and the slides from the talk and it looks like the only way is to write directly to the device SD card, there's no over-the-air updates?

From the same Nerves project I had founnd this:

https://github.com/fhunleth/fwup

It is a firmware updater. It seems one mode is the basic create whole disk image and replace. The other is can handle update "tasks".

Now in general Erlang was built to handle hot-code updates. Basically replace the code while the code is running (have use immutable data structures and have specials facilities built it).

But that can be tricker to set up and if you have C code or hardware control, it might not work as well. So upload firmware then reboot might work (I am just guessing here since I don't know any details or goals).

That looks promising, thanks! This thread just gave me a great excuse to get into Erlang (and Elixir), seems too good to be true.
Thanks for the reminder, I read nice things about that book on several occasions.