Libelium World:

Publish in: Meshlium, Waspmote

New Sensor Parser for Meshlium gathers data from 3G, GPRS and WiFi interfaces

New Sensor Parser for Meshlium gathers data from 3G, GPRS and WiFi interfaces

June 23rd, 2014 - Libelium

Up to day Meshlium was ready to get sensor frames from the 802.15.4 / ZigBee interfaces. However, as each day more and more clients demand in Waspmote and Plug & Sense! radio technologies such as 3G, GPRS and WiFi that can handle longer distances; so we have added to Meshlium (starting in the 3.1.5 version) the capability of getting data from any radio which performs an HTTP or HTTPS request.

Meshlium Cloud Diagram

An example of a complete HTTP request using the new GET method would be:

http://10.10.10.1/getpost_frame_parser.php?id_wasp=WASPMOTE1&id_secret=3764392763&frame_type=155
&frame_number=12&BAT=71&HUMA=34
&TCA=22&ACC=45,67,89

Where the values received are:

  • Battery (BAT) = 71
  • Humidity (HUMA) = 34
  • Temperature (TCA) = 22
  • Accelerometer (ACC) =  x : 45, y: 67, z: 89

Data frames received via HTTP are stored in the same Data Base that 802.15.4 / ZigBee frames, and have the same format, so all the data can be processed the same way. In the image below we can see examples of sensor frames coming from different interfaces (ZigBee, 3G, WiFi); all of then are parsed and inserted in the same Data Base after adding a timestamp.

Meshlium Capturer

The Waspmote API has been modified to add this new capabilities to the radios that handle HTTP connections: 3G, GPRS, WiFi. So now we can have this new feature running in our programs in just three simple steps:

  1. A new frame must be created calling the proper function.
  2. Then we have to add different sensor values using the appropriate sensor tags provided for each sensor.
  3. Depending on the communication module to be used, different functions should be called in order to perform the HTTP query. In these functions, we must specify the Meshlium’s IP address or URL and finally the pointer and length of the frame’s buffer.

Example of the 3G module:

{
// create frame
frame.createFrame(ASCII,"Node_001");

// add sensor info to the frame
frame.addSensor(SENSOR_HUMA, hum_value);
frame.addSensor(SENSOR_TCA, temp_value);

// send HTTP query
_3G.sendHTTPframe("192.168.1.32", 80, frame.buffer, frame.length, GET);
}

Example of the WiFi module:

{
// create frame
frame.createFrame(ASCII,"Node_001");

// add sensor info to the frame
frame.addSensor(SENSOR_HUMA, hum_value);
frame.addSensor(SENSOR_TCA, temp_value);

// send HTTP query
WIFI.getURL(IP,"10.10.10.1", "GET$/getpost_frame_parser.php?frame=", frame.buffer, frame.length);
}

If you already have Meshlium you only need to update it to the 3.1.5 version. Just go to Update Manager -> Install Updates

Meshlium Update

For detailed information go to the next Guides:

All the information about Meshlium here.

For more information about this new version of the software included in Meshlium (v3.1.4) contact the Libelium Commercial Department.

Quick Publish: