Close

Proof of concept

A project log for IOT Gateway

A configurable bridge for wireless sensors and controllers

ChrisChris 08/19/2014 at 14:060 Comments

With the sensor ready I I set myself up with an account with Xively and began to hack away at the Xively demo from the Ethernet library. I initially used only one sensor from the DHT11 and sent the data onto the web and started viewing the data. Then adding the second sensor was a simple duplication job. 

The next step was to setup the raspberry pi as an Apache web server. Using another Xively demo as a base a simple webpage was created to display this data. 

One of the directions was working, the next step was to control one of the sockets from the browser. A couple of Javascript buttons were added to the webpage to run cgi scripts on the server. These Python scripts send a UDP message to the Arduino to initiate the transmission of the codes to the socket.

Add a picture and the concept was proven:

There is a number of choices made along the way that need to be looked at again. 

The message structure used by the sensor only uses two bytes of data. This was done just to avoid the collision with the remote controlled sockets. I need to analyse this to decide on a protocol that is going to avoid this problem and have the ability to be flexible. 

The usage of CGi scripts and UDP messages might not be the best way to do it, but this is my first venture into web based programming, so I don't know any better and have just gone with the one I can get to work.

Ideally I think that having the sensor data on the Pi rather than Xively would mean that the server could be in constant communication over the LAN and give me more control of the data

Discussions