A general application for wireless sensor networks is gathering sensor data from the deployed motes and making some predication/operation based on those sensed data. In this page, you will learn how to do this based on OpenWSN project. |
uinject
application running on the mote generates dummy data (a counter value increasing at each packet) every 30 seconds and sends it to the manager.uinject
at defaultAppsInit structure: https://github.com/openwsn-berkeley/openwsn-fw/blob/develop/openapps/SConscript#L34uinject_dagroot.py
(folder openwsn-fw/openapps/uinject
)uinject_dagroot.py
to make it work on your computeradd following code at : https://github.com/openwsn-berkeley/openwsn-fw/blob/develop/openapps/uinject/uinject_dagroot.py#L161 ,(For the last test, this is no required for OpenMote. Try this if the mote stay at reset status.)
self.serial.setDTR(0) self.serial.setRTS(0) |
The uinject_dagroot.py
application prints on screen what you are receiving from the other mote, which is the counter value increasing from 0.Once the printing works you can:
uinject
fancier to include real sensor data. I would recommend to then rename the applicationuinject_dagroot.py
fancier and log/send/tweet the received dataBesides, the latency of each packet starting from being generated until received by dagroot is printed on screen right after the counter. It's shown in seconds and the accuracy is one slot long which is 15ms.