IoT-System-on-OpenSource
IoT-System-on-OpenSource copied to clipboard
SmartArduino is specializing in the open source hardware, like Arduino compatible boards, Raspberry pi, Beaglebone, Robotics, and Aircraft.
#How to Use IoT System--Based on the OpenSource Hardware
IoT (Internet of Things) system is one of Wireless Sensor Sytems (WSN). Based on the open source hardware, like Arduino, Raspberry pi, Beaglebone, and so on, anyone can conveniently buit up his own IoT system by using such WSN platform, and aslo would like to present some demos based on this platform. The corresponding materials can be found at http://www.smartarduino.com/.
##User Guidance
Step One: [Get API Key] (http://www.iot.fm/ext/examples/desktop/desktop.php), which will be used in the control protocol;
Step Two: Add sensor nodes, such as smoke, temperature,gas.
Step Three: Design nodes control protocol. By this protocol, we can control the sensed information (e.g., temperature, or gas), please see the [protocol degsin](##Protocol Design).
Step Four: Data Dsiplay. In this step, you can use simple clicks to see the results exhibition, which are shown intuitively by pie figure.
##Protocol Design
In such WSN system, the control protocol is very important. In our protocol degsin, we have designed two types of control protocols presented by the followings.
- Upload Protocol to Sever
- Using HTTP protocol including the following steps
-
- Using GET method;
-
- Request URL: http://api.iot.fm/upload.php, Parameters: uid=user name (the default name is demo); &key=secret key generated by the step one in [User Guidance] (##User Guidance) &sensor_name=sensor1&data=37&sensor_name=sensor2&data=120....
-
- Reply: If successful, then return "res=1&desc=ok", if fail, then return "res=0&desc=failure reasons". Example: http://api.iot.fm/upload.php?uid=demo&key=c514c91e4ed341f263e458d44b3bb0a7&sensor_name=temperature&data=37&sensor_name=pluse&data=120. After run the above Example, then return "res=1&desc=ok". Note that, in the default setting, uid=demo, key=c514c91e4ed341f263e458d44b3bb0a7, which is generated by the Get API Key in the system.
-
- Using TCP protocol including the following steps
-
- Using Socket connection
-
- IP address: 50.116.16.236, port number: 9501
-
- Send content: cmd=upload&uid=user ID&key=secret key&sensor_name=sensor1&data=37&sensor_name=sensor2&data=120...\r\n. Similarly, the user name and key are the same as the above.
-
- Using HTTP protocol including the following steps
- Receive Protocol from Sensor nodes
- Using HTTP protocol including the follwoing steps
-
- Using GET method;
-
- Request URL: http://api.iot.fm/get.php; Parameters are the same as the above mentioned.
-
- Reply: sensor nodes would reply the command from client (i.e., IoT system); Example: the client sends the command "begin" to a temperature sensor node. http://api.iot.fm/get.php?uid=demo&key=c514c91e4ed341f263e458d44b3bb0a7&sensor_name=temperature. Then, the reply is "begin".
-
- Using TCP protocol including the follwoing steps
-
- Using Socket to connect;
-
- IP address: 50.116.16.236, port number: 9501
-
- Send content: cmd=upload&uid=user ID&key=secret key&sensor_name=sensor1&data=37&sensor_name=sensor2&data=120...\r\n.
-
- Using HTTP protocol including the follwoing steps
- Client sends control command to sensor nodes
- Transmission protocol is HTTP, and use GET method;
- Request URL: http://api.iot.fm/control.php;
- Parameters: are the same as the aboved mentioned;
- Reply: 1
- Example: client send "http://api.iot.fm/control.php?uid=demo&key=c514c91e4ed341f263e458d44b3bb0a7&sensor_name=temperature&cmd=begin". If successful, then return "1".