Robert Olsson robert@Radio-Sensors.COM Jens Laas jens.laas@uadm.uu.se
We've outlined, designed and implemented and very simple concept for WSN data reports, including collection, storage and retrieval using standard text tools. In sensor data can be sent over Internet to active listeners. The concept also includes a mapping to URI (Unified Resource Identifier) to form a WSN caching server similar to CoAP using http-proxy.
All programs are written C, Java-script and bash. And designed for for small footprint and minimal dependencies. sensd runs on Raspberry Pi and openwrt.
Open-Sourrce via GPL
This is collection of software to implement data monitoring and data collection from WSN Wireless Sensor Networks. The basic idea is to do a very simple, straight-forward and robust framework.
The scenario, One or several mots is connected to USB or serial port to gather received information from connected WSN motes. Data can can visualized in several ways.
-
Sensor data report can be transmitted and propagted thoughout the Internet. sensd acts as server and sends incoming report to active listeners.
-
Data is kept in ASCII with tagging and ID information. Data is conviently handled, copied and viewed with standard text utilties of your OS.
-
Last mote report is cached into the file system suitable for URI use. The Format is SID/TAG. Typical tags are EUI64 and unique serial numbers. The different TAGS are left for mote user to define. Although the TAGS used in our example setup is included is this draft This for example purposes.
Both formats can easily the be stored or linked directly in web tree to form a URI to format WSN loggin/datafile or caching service..
A daemon that reads WSN mote reports from USB/serial and stores data in a ASCII data file. Default /var/log/sensors.dat
A set of Java-scripts can plot, print and visualize sensor data from sensd direct in your web-browser.
A simple program that can extract data (sensors.dat) via tags and format output for plotting and further analysis. Normally you extract the desired ID and the wanted tag identifiers.
Documentation and sample files
Expose WSN data aternatives:
Space or control chars is not allowed in any types.
Float (F) Integer Dec (Id) Integer HEX (Ih) Boolean 0 or 1 (B) String (S)
Below is and example of an anatomy of sensors.dat we currently using in our WSN data collection networks.
2012-05-22 14:07:46 UT=1337688466 ID=283c0cdd030000d7 PS=0 T=30.56 T_MCU=34.6 V_MCU=3.08 UP=2C15C V_IN=4.66
2012-05-22 14:11:41 UT=1337688701 ID=28a9d5dc030000af PS=0 T=36.00 V_MCU=2.92 UP=12C8A0 RH=42.0 V_IN=4.13 V_A1=3.43 [ADDR=0.175 SEQ=33 RSSI=21 LQI=255 DRP=1.00]
Each line is a mote report. Starting with date and time followd by a set of tags. The tags is different for different motes. In other words thay can send different data. Essential is the ID which should be unigue for each mote..
The information with brackets is information generated by the receiving mote and is not a part the motes data. Typically RSSI (Receiver Signal Strength Indicator) and LQI (Link Quality Indicator)
Example of tags used:
- UT= Unix time (Id) Provided by sensd
- TZ= Time Zone (String) Provided by sensd
- GWGPS_LON= (float) Provided by sensd
- GWGPS_LAT= (float) Provided by sensd
- ID= Unique 64 bit ID (S)
- E64= EUI-64 Unique 64 bit ID (S)
- T= temp in Celcius (F)
- PS= Power Save Indicator (B)
- P= Pressure (F)
- V_MCU= Microcontorller Voltage (F)
- UP= Uptime (Ih)
- RH= Relative Humidity in % (F)
- V_IN= Voltage Input (F)
- V_A1= Voltage Analog 1 (A1) (F)
- RSSI= Reeiver Signal Strengh Indicator (Id)
- LQI= Link Quality Indicator (Id)
- SEQ= Sequental Number (packet) (Id)
- DRP= Drop Probability (Contiki) (F)
- ADDR= (S)
Meta-data and additional information, descriptions and comments can be stored in data file to keep everything in on context. Of course pre-cautions must taken so this auxiliary data can conflict the data. In example to to restrict or escaped the '=' sign. It suggested that data is retrieved with seltag or a similar technique.
&: is used in the report message. The idea is to distinguish between data report and responses to commands. This not yet implemented.
[] The information between brackets [] is supplied by the receiving or sink node and not by the sending. For example Receiver Signal Strength Indicator (RSSI) and Link Quality Indicator (LQI) origins from the receiving node.
Start sensd with the -report option. This enables reports to be transmitted over IP to remote listeners. Default TCP port 1234.
Server side example: sensd -report -p1234 /dev/ttyUSB0
Client side. netcat example: nc server-ip 1234
URI (Unified Resource Indenifier) displays the node ID and the tags in a file tree. It is easy to export this into a web tree to form a URI similar to a CoAP gateway.
Example: In our case we have a unique sensor ID followed by the different data fields repesented by "tags".
/tmp/WSN1-GW1/281a98d20200004a: DRP ID LQI PS RH RSSI SEQ T V_IN V_MCU ADDR
/tmp/WSN1-GW1/28be51ce02000031: DRP ID LQI PS RH RSSI SEQ T UP V_IN V_MCU ADDR
Read Temp from a sensor: cat /tmp/WSN1-GW1/281a98d20200004a/T 19.44
And very easy to link this tree into a web-server.
Positioning support has been added via gps device connected to serial or USB port. Tags added when enabled GWGPS_LON & GWGPS_LAT. GPS code from. https://github.com/herjulf/gps_simple
Code is stored in github. Typically procedure below is the very straight- forward unix way:
git clone http://github.com/herjulf/sensd cd sensd make
Put your binaries after your preference:
For x86: Sensd and friends are available in Bifrost/Linux packages. Those packages are statically linked and can be used on most x86 Linuxes. 32-bit compiled.
http://ftp.sunet.se/pub/Linux/distributions/bifrost/download/opt/opt-sensd-2.3-1.tar.gz
The WSN data logging and caching concept is in actual use with Contiki, RIME broadcast application.