Thursday, February 5, 2015

setting up IoT server with ThingSpeak on Ubuntu 12.04

installing IoT server with thingspeak on ubuntu 12.04.

some time back yours truly has did some IoT inspired device, by streaming temperature sensor data using ESP8266 to the Internet; the receiving side of the sensor data is the FREE ThingSpeak server, courtesy of iobridge. details of the IoT streaming data setup here http://shin-ajaran.blogspot.sg/2015/01/iot-streaming-temperature-data-acquired.html


The ability to display IoT sensor data in a chart on the Internet is extremely useful. The following screenshot depicts the "public view" of my thingspeak sensor data chart that can be shared on web presence eg a blog or website; data collected can be used for processing/detecting/predicting. Note the LHS of the chart as compared to the "pattern" on the RHS. analyzing outliers, yummsss.



















The free thingspeak server allows for sensor update once very 15sec per channel ref here: http://community.thingspeak.com/documentation/api/ ; in other words, if a sensor (or many sensors) is required to send data at shorter interval eg every second, the free thingspeak server is not able to accommodate. thanks to open source software by iobridge, humans now can install thingspeak on their own computing resources, and customize according to their requirements.













picture above depict thingspeak server running off a VM on my "server" behind a simple network in my office. It is not publicly accessible.













picture above depict thingspeak server running off a VM on the R&D cloud in T931 behind a myriad of ACLs. It is not publicly accessible.

The step by step guide from the source repo is available here https://github.com/iobridge/thingspeak

The major software components needed on ubuntu 12.04 to use with thingspeak are mysql, ruby, rails, and major pkg updates. Assuming the server is behind a simple network with only a router-to-internet, setting up thingspeak is a breeze. There are open source bash scripts, eg https://gist.github.com/abythell/8225124 to help to manage the installation, originated from this blog post http://angryelectron.com/how-to-install-a-thingspeak-server/ Don't you just love open source software??

The complexity comes when 
1. installing on a VM that sits in the cloud that is behind a myriad of ACLs
2. scaling up the thingspeak server in the cloud as a PAAS, and clustering the resources.

your truly had his fair share of frustrating after office hours trying to fix some of the installation issues due to the complexity of the network and also the unfamiliarity with ruby, gems, and rails (first time installing it). nonetheless, the main gripe is documented in the gist below which address BADSIG from apt-get update, git to use https, gpgkeys: HTTP fetch error 7: couldn't connect: Network is unreachable, packages cannot be authenticated!, etc.

the screenshot of thingspeak server is running













the expanded installation bash from the user mentioned above is available here


now, let's start to do some IoT inspired stuff by streaming some data to thingspeak

2 comments:

gustavomonarin said...

Have u found any difference from the thingspeak.com???


I am currently working on a project where the intenert connection is limmited and a hosted thingspeak would be a great solution however i am with problems to access the apps / react ...

Regards

Hasan Tariq said...

Data is not being Streamed using this process...