Websockets to be used for sensors data and move commands!

So I’ve been playing quite a while with different sensors data, like Sonar, Infra Red, Accelerometer and GPS. As you might saw from previous post I’ve chosen to use I2C protocol to speak to the sensors, because it’s super easy and reliable and also I don’t need any DAC/ADC convertors. But now another task to be solved – all these sensors supply quite a lot of changing data like distance to obstruction, coordinates and angle information.

Pulling this data every second is not a nice solution, simply because it will generate extra load by establishing connection, especially if I’m going to use 3G dongle instead of WiFi. Also 1 second poll is too slow for distance – because it is a few more inches of moving.

So I’ve started to dig and found WebSockets – this technology is supported by mostly all common browsers and very simple – client (http) establish connection and  after server can send updates (push messages) and  accept more messages from a client, so probably I’m going to change even move controls to this protocol!

Stay tuned!

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s