...
Note |
---|
The applicable and possible downlinks depend on the device and the firmware version. The described examples do not claim to be complete and are used at your own risk. |
Remote Configuration
IoT devices are often installed at places that are difficult to reach. If you need to change the settings of such a device it is often not easily possible to get physical access to attach a config adapter.
...
If you are using Remote Configuration, please be aware that LoRaWAN devices can only be reached by the network under certain conditions. See Uplinks and Downlinks.
Lobaro LoRaWAN devices receive remote configuration commands as Downlinks on port 128. Responses to those commands will be sent as Uplinks on port 128 (and 129-131 for long responses). The remote commands and their responses are all encoded in ASCII, to make it easier for humans to use them.
...
Changing configuration does nothing until you save the changes and reboot the device. The device has a safety feature that prevents configurations that make the device unusable. A new configuration is tested in the first run after rebooting. Only after the device reaches a stable state will the configuration be adopted and used permanently. If a problem occurs the device will restore its last stable connection and reboot. If the device uses OTAA (which we recommend) the device will only adopt the new configuration only after a join request is accepted, to make sure the LoRaWAN parameters are correct. After a few failed attempts it will restore the previous configuration. This can take up to about 10 minutes.
Downlink Messages (Port 128)
Responses are sent as uplinks on port 128 and 129-131 for long responses.
...
Warning | ||
---|---|---|
| ||
Do not use |
Example: changing configuration
The following is a short example of how you can update two configuration values remotely (that includes rebooting the device).
...
For this example we want to set Time Synchronization to sync the internal clock every 10 days, and we want to deactivate Adaptive Date Rate (ADR). These are both LoRaWAN configuration parameters that are present on most devices (find details under LoRaWAN Configuration), but you can of course also change parameters specific to your device, e.g. Modbus configuration or wMBus configuration, with this feature.
...
After sending the final command, the device will reboot and try the new configuration. If the boot process and the connection to the network are successful, the device will make the changes permanent. If there is a problem (if you accidentally set an invalid value, e.g. sADR=flase
or if you changed your AppKey
to wrong value and your OTAA fails), the device will revert to the previous configuration.
Downlinks on TTN
How you sent your downlinks depends on the LoRaWAN Network Server you use to connect your devices. You will most likely need to convert the commands (that are all ASCII) to some different representation, e.g. Hex or Base64.
...
You will have to encode the commands in hex. In the screenshot you see 73 54 69 6d 65 53 79 6e 63 3d 31 30
as the message to send; that is the hex representation of sTimeSync=10
. The Port used for remote configuration for our devices is 128. When you enter multiple messages to send, be sure to set the correct scheduling (last
). The preselected replace
will overwrite your previously enqueued messages.
Example 1: Getting the firmware version:
Example to do this over TTN Console:
On your TTN Console choose your Application and your Device, Messaging:
The downlink and response can be viewed in "live data":
The result of the converted HEX to ASCII is:
Example 2: Change Configuration Pressure and Temperature Sensor via Script:
Transform:
Code Block |
---|
SMbCmd=0 0/10 * * * *:R,9600,8N1:010300160002,010300260002,fa0400050001 |
...
Code Block |
---|
U01iQ21kPTAgMC8xMCAqICogKiAqOlIsOTYwMCw4TjE6MDEwMzAwMTYwMDAyLDAxMDMwMDI2MDAwMixmYTA0MDAwNTAwMDE= |
Example for TTN:
The downlink via a script via TTN would then look like this:
...
TTN Documentation scheduling-downlinks
Example for Chirpstack:
The downlink via a script via Chirpstack would then look like this:
...