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.

No comments:

Post a Comment