5 - Class B
This book explores in depth how to use Class B in end devices implementing LoRaWAN® 1.0.4. Class B mode enables the end device to receive downlinks at regular intervals. We teach you how to configure your end device to receive Class B downlinks using beacons and ping slots and best practices to follow to increase the chance of receiving downlinks while maintaining reasonable battery life.
Updating the Network Downlink Route
The network server analyzes the gateways it received Class A uplinks through to calculate which gateway to use to transmit downlinks to the end device. Over time, environmental factors can cause interference, or the end device may be moved, meaning that the gateway with the highest chance of reaching the end device may change. To keep the network updated, the end device must regularly broadcast Class A uplinks. This must be handled outside of the LoRaWAN network layer, so you must consider this when designing your application. The decision on how frequently to send a regular uplink should consider your use case, how essential the Class B downlinks are to device operation, and ensuring reasonable battery life.
If you know that your end device will move regularly, you can program the device to send an additional uplink after it has moved significantly. This uplink will be sent via the nearest gateways in the new location, and the network will select one of these to send subsequent downlinks to.
If your end device has a GPS on board, or an accelerometer, this can be used to detect that the device has moved and trigger the uplink. Alternatively, the end device can use the gateway specific (GwSpecific) octets of the beacon, which identify the gateway that beacons were received from. The GwSpecific octets from each beacon can be compared against a record of recent beacons to identify when a new gateway is seen. If a new gateway is seen, the end device can assume it may have moved and issue a Class A uplink to update the network. Because not every gateway will include a gateway specific field, GPS or accelerometer is more reliable option if available. Learn more about the GwSpecific field in section 13.3 'Beacon GwSpecific field Format' (page 68) of the LoRaWAN Link Layer Specification v1.0.4.