HOWTO.bulk-packets Document Revision ----------------- 0.3 2015-12-26 Intro ------ In our scenario a receiving node or sink node is connected to a WSN gateway having an uplink using, 3g/wifi/IEEE 802.15.2/low power Bluetooth or Ethernet, Gateway and uplink consumes continuously relative high power and for most installations the packets rates are low. Problem -------- The power use of WSN gateways is a challenges in areas with lacking or un- reliable grid and renewable energy resources and batteries has a limited capacity at a relatively high cost. Related work ------------ Bulk function has effects and similarities to Radio Duty Cycling (RDC). Implementation -------------- The bulk framework makes it possible to collect packets in the WSN mote's RAM before reporting to the uplink. This makes it possible to duty cycle or sleep the gateway which can give a substantial amount of energy saving. Packets that are received over the radio is put into bulk storage this is also the packets originated from the host mote. How packet bulking works ------------------------ A configured threshold of stored packets triggers an action, sets a GPIO pin and starts a timerm, when the timer expires, the bulk is flushed/printed. While the timer is running new packets can still be added to the storage. When a packet is stored it's also time-stamped. When flushing/printing a delay time is calculated. A new attribute in the packet report DELAY= is introduced for this purpose. The timer resolution is in seconds. The timer is typically a the start-up time for the gateway and the GPIO pin change the event to trigger the start-up of the gateway. Storage capacity ----------------- The bulk storage is kept in the MCU's SRAM for speed and robustness. The size is dependent on the size of MCU. For boards based on AtMega128RFA1 typical 20 pkts. For board based on AtMega256RFR2 about 100 pkts. Storage overrun ---------------- When the storage capacity is exceeded the the packet are dropped. The counter err.bulk is updated. Errors are seems via the err command. Effects of bulking ------------------ The packets are delayed. Bulking is not an option for applications that cannot tolerate delayed packets, realtime monitoring etc. Also some applications can be tolerant to some delay, it's up to the system owner to understand those issues and do the proper design. Also bulking impacts other firmware functions: On the node where bulking is enabled: * The relay packet function is disabled. * New neighbor solicitations messages are not sent. Commands -------- The newly added bulk command controls the bulk function. Examples. bulk set 4 10 To enable bulking: Bulk storage is enabled with threshold of 4 packets and a delay of 10 sec. bulk set 0 0 To disable bulking: bulk show To see bulk settings. bulk flush To flush/print current bulk storage. Debugging --------- A new debug option is added. This can be very useful for understanding and troubleshooting. debug bulk Example report -------------- &: TXT=V_RUM PS=0 T=22.38 V_A3=280 [ADDR=56.90 SEQ=224 TTL=15 RSSI=22 LQI=255 DRP=0.75 DELAY=167] We see new option DELAY=167. This means this report has been stored 167 sec. This delay needs to taken in consideration when packet get time-stamped. Firmware -------- The 7.3-beta firmware for model S2 adds experimental support for this. Firmware details ---------------- The implementation uses the GPIO pin pb1 for communication with the GW. It is set high when the bulk threshold is reached. The GPIO pin can be used to trigger a start of of the gateway. If the GW lacks ON/OFF pin. An open-drain FET-transistor can control the power. The bulk delay should be tuned to match and hide the start-up time. After the bulk has been transferred to GW the pb1 pin is set low. Experiences and feedback ------------------------- Please use mailing list for experiences and issues. wsndev@herjulf.se