Monday, July 29, 2013

Once I got netduino pushing to starfish I installed MySQL and wrote a PHP script to strip the two temperature readings from the CSV and load into a MySQL database.

For now the netduino plus 2 controller is pushing data every ten minutes which is then loaded into the database automatically eventually providing a mechanism for remote access of the data via SOAP server and WSDL.

 The MySql database is named "netduino" with a table named "Temperature".





I have added three parameters to the table, "stamp", "type", and "value". The stamp variable is type TIMESTAMP meaning it will automatically be generated by mysql when the record is inserted. The type variable is a string to contain the name of the measurement i.e. "Temperature01" and the value variable is a float which holds the actual measurement value.



 I have had this running continuously since yesterday so I have accumulated a few readings in the database.





Next step is to install a PHP SOAP protocol server that will serve up the two measurements via XML object that can be parsed and displayed on the project page of www.charlesbvance.com

As soon as the circuit boards I have ordered arrive I will assemble the Thermocouple amplifiers and hopefully begin logging actual temperatures instead of meaningless voltage values.

Wednesday, July 24, 2013

I stayed up way to late last night becoming engaged in working through some of the strategies for protocols available to communicate the micro controller generated measurements into the cloud. I made inroads with the communications aspects although I have not settled on anything final at this stage of development and testing. I did choose what I consider to be an awesome platform for cloud computing, the Digital Ocean. In less than a minute a VPS server, called a "droplet" is instantiated and ready to go with full root access and your choice of linux based operating systems for only 5 bucks a month.

In keeping with the motif of the "digital ocean" I named my first "droplet" in the ocean Starfish.

I quickly installed Apache 2.2 web server, PHP 5 and MySQL  with the idea that the data points transmitted will be stored in the database for later retrieval. For now I am pushing a small two data point CSV file to Starfish via Apache web services. I didn't realize that simple HTTP 1.0 PUT methods are not allowed by Apache which caused a fairly substantial detour while I sorted that issue out. I wanted to stay with the simple PUT method because of the lack of overhead required on board the micro controller.

Apache however was a bit uncooperative dutifully rejecting any requests to place the CSV file on Starfish via the non secure PUT transaction. After a few Google searches I found the work around, basically adding a script line in the Apache configuration file to route the illegal request to a PHP script for processing. Using the PHP script ensures that the request is processed successfully and the CSV file is permitetd to be written to the desired location. Security via API keys or other encryption methods can be incorporated into the PHP method handler.

Unfortunately this configuration is only going to be good for a small number of data points and additional error handling code will be needed to address data drops and pauses, I am going to be taking a look at SOAP protocol in order to accept larger more reliable XML data transfers.

Monday, July 22, 2013

Netduino in the cloud

The Netduino is writing two data points to the Xively cloud. Next I need to build a thermocouple op amp to input a couple of actual temperatures to the Netduino so the Xively feed will be an actual measurement instead of just static voltage readings.
Next step is to read the measurements from the cloud and show them on a webpage.