Switch LoRaWAN server by rejoin feature
Table of Contents:
1. Introduction
This chapter describes how to switch LoRaWAN server by rejoin feature.
2. What is the rejoin feature?
Rejoin feature is that if the ACK packet sent by the platform to the node is not received within the set time range, the offline detection will be started.
2.1 Offline Rejoining(LWS007)
AT Command: AT+DDETECT
AT+DDETECT=<Flag>,<ACK_Timout_1>,<ACK_Timout_2> (Default Value: AT+DDETECT=1,1440,2880)
- ACK_Timout_1: Unit: min
- ACK_Timout_2: Unit: min
Command Example | Function | Response |
AT+DDETECT=1,1440,2880 value1 | Enable online detect | 1 OK |
AT+DDETECT=1,?,2880 value2 | Online detection packet sending time |
OK |
AT+DDETECT=1,1440,? value3 | Process rejoin |
OK |
Downlink Command: 0x32
Format: Command Code (0x32) followed by 2 bytes mode value.
If the downlink payload=320105A00B40, it means set end node to use confirm mode, while type code is 32.
- Example 1: Downlink Payload: 320105A00B40 // Set AT+DDETECT=1,1440,2880
- 0x01 : Flag
- 0x05A0 : ACK_Timout_1 : 1440minutes (24 hours)
- 0x0B40 : ACK_Timout_2 : 2880minutes (48 hours)
- Explain: Enable Online Detect, if end node doesn't receive any downlink within ACK_Timout_1( 1440 minutes or 24 hours). End node will use confirmed uplink to send packets during ACK_Timout_1 (the 24th hour) to ACK_Timout_2 ( the 48th hour). If from the 24th to 48th hour, end node got an downlink from server, it will switch back to unconfirmed uplink. end node will restart ACK_Timout_1. If from the 24th to 48th hour, end node still not got any downlink, means device doesn't get ACK from server within last 48 hours. Device will process rejoin, rejoin request interval is AT+RJTDC period. For AU915/ US915, device will use the sub-band used for last join.
2.2 Change Uplink Interval
Feature: Change LoRaWAN End Node Transmit Interval.
AT Command: AT+TDC
Command Example | Function | Response |
AT+TDC=? | Show current transmit Interval | 30000 OK the interval is 30000ms = 30s |
AT+TDC=60000 | Set Transmit Interval | OK Set transmit interval to 60000ms = 60 seconds |
Downlink Command: 0x01
Format: Command Code (0x01) followed by 3 bytes time value.
If the downlink payload=0100003C, it means set the END Node's Transmit Interval to 0x00003C=60(S), while type code is 01.
- Example 1: Downlink Payload: 0100001E // Set Transmit Interval (TDC) = 30 seconds
- Example 2: Downlink Payload: 0100003C // Set Transmit Interval (TDC) = 60 seconds
3. Examples and Explanations
Switching platforms by rejoin function: Use device LHT65N to switch from TTN to ChirpStack as an example.
The following example shows the parameters of the LHT65N. Users need to check the Wiki instructions to confirm the parameters of the equipment they have purchased.
(User Manual for LoRaWAN End Nodes))
3.1 Configure appropriate operation times
Firstly, the user sent downlink commands through the original registration platform (TTN) to modify the required TDC time and offline detection time.
Note: Users need to set the TDC time shorter than the offline detection ACK_Timeout_1, the best offline detection time is more than twice the TDC time.
- Configuration via TTN downlink:
Note: When configuring the device using downlink commands, you need to wait for the original TDC time, and the platform plans downlink after the end node complete uplink.
TDC changed successfully:
Confirm that the TDC configuration is successful, and then configure the offline detection time:
- Configure using the AT commands by Serial Port Utility:
3.2 Delete the device and add the device to the new platform
Delete device:
Register the device on the new platform and wait for the offline detection time for the device to automatically request to join the network.
3.3 Restore the default TDC time and the default offline detection time
- It is recommended to restore the factory reset directly:
Downlink payload: 0x04FE
After the delivery is successful, the node is connected to the network again and factory Settings are restored.
- If the device has other configurations to keep, users can also choose to configure the default TDC and default offline detection time separately.
Note: To set these two commands separately, users must restore the default offline detection time before configuring the default TDC time.