Purpose
The purpose of the Ring-Of-Things is to use the openwsn firmware stack and the CoAP library to implement a simple demo where a 'ringmaster' (in this case a local python client), instructs motes via CoAP packet communication to do simple actions like blink or buzz.
Powerpoint of initial design: https://docs.google.com/presentation/d/1atlBdYjgV6HwVyvTbz42K-ek7jkmLHYt7oatlnUHvk0
Design
A CoAP app must be added to the firmware, called 'rrt', to allow for the ringmaster to send and receive CoAP packets to the resource. A tutorial for adding a CoAP app is described here: Adding a CoAP app
This app needs to have several functionalities:
- notify the ringmaster of a mote's availability (when it goes 'online')
- ability for a mote to wait for an incoming packet from the ringmaster
- checking for a message type upon reception, and knowing whether to 'blink', 'buzz', perform another simple action, or forward an action to another mote (identified via ipv6)
- ability to send a CoAP packet from itself to another mote (with some data)
The ringmaster needs to:
- send packets to motes via the coap library
- wait on incoming packets
- keep track of all motes that are in its ring (in this case with a simple queue) and send instructions in a rotation
- handle error handling - motes dropping off unexpectedly, packet loss, receiving unexpected packets
Code
The firmware code is the main addition, which runs on the motes.
Here is the firmware pull request: https://github.com/openwsn-berkeley/openwsn-fw/pull/128/
GitHub repo: https://github.com/openwsn-berkeley/ringmaster