Over the past few weeks I have been working on a new Server/Client implementation and finally, there is a result from the work.
Pictured above are two screenshots from the app, in addition to the web monitoring page (monitor.php)
Below is a diagram detailing how the different parts of the server system interact with eachother.
How it all works
Uniform Node
The Uniform Node (Electric Imp) contacts Processdata.php over HTTP, transmitting data in POST headers. The fields transmitted by the Node are Device, Timestamp, Impact1, Impact2, ECG. More fields will be added including Temp.
Processdata.php carries out the storage of the data into a MySQL database. It checks to see if a node with the same device ID has been registered - if it has, it will update the existing record. Otherwise, it'll create a new record.
App
The app displays the content of endpoint.php once launched. The endpoint page queries the main database and list all connected nodes in a list form. Each list item contains a link to viewinfo.php, with the database row ID sent as a GET variable. viewinfo.php then queries the database and gets the node information pertaining to the row ID. This is then displayed in a list to the user.
Web Monitoring
monitor.php queries the database and displays the information in a table in a similar process as that of endpoint.php, however showing the sensor data. It is designed for use on a display other than a mobile, for example, monitoring from a PC/Mac.
Updates to the node software
To accomodate the new system, obviously the electric Imp's code had to be updated.
The Device is responsible for harvesting the data and sending it to the electric Imp agent.
The Agent is responsible for sending the data from the device to processdata.php.
Summary
All in all, quite a lot of progress on the software side of things have been made - which was greatly needed, because there is no point in harvesting data if you cannot use it somehow.
It's been a fun week, thanks for reading!




Top Comments