You are reading a single comment by @Moray and its replies. Click here to read the full conversation.
  • Websockets is often a good choice for heavily firewalled environments where native sockets may be blocked. Also if you do not have complete control of your server environment, e.g. if you are using a cloud-hosting service with a web stack only.

    I think they are considerably easy for less experienced developers too, just because HTTP is more familiar than socket programming.

    A good deal of other stuff you typically need to implement in a command-and-control sceanrio such as authentication etc. can also be taken care of for you by your web-stack of choice which makes development faster.

    The downside though is overhead of the HTTP stack, both in transmission sizes and processing speed if e.g. you are on a GPRS or low-fi radio network.

    On a micro-controller if speed and performance were most important I would probably use net sockets. Example, I have in mind to build a voice-control system with a Pi running Google voice recognition as the central server and Picos as controllers. For that purpose, speed is probably pretty important - if I say "turn the lights on" I just want them to come on as quickly as possible.

    On the other hand if I were already using HTTP comms to this central server in the project and it didn't need to be as close to realtime as possible, then web sockets would be a good choice.

    The public server is a nice idea, but I'm not sure there's enough headroom in the client for an extra control layer to be attractive, nor enough shared purpose about what people may want to do with it. There're quite a lot of such command and control cloud-based services around which you can opt into if you want that. Perhaps an Espruino client for one or more of those would be a better approach.

    Might be fun to run up a simple stats engine though which people could opt into and use it to drive a map and some numbers. I sort of doubt it would get much take-up though - although you could make it the default example on the http page which might help!

About

Avatar for Moray @Moray started