Skip to content

Instantly share code, notes, and snippets.

@jmadden173
Created November 27, 2024 00:36
Show Gist options
  • Save jmadden173/b33a9e60e8cdb1772296ef58e530921e to your computer and use it in GitHub Desktop.
Save jmadden173/b33a9e60e8cdb1772296ef58e530921e to your computer and use it in GitHub Desktop.
Update ADR on TTN to static values
#!/bin/bash
APPLICATION_ID="soil-power-sensor"
DEVICES=("eui-0080e1150535c0f5" "eui-0080e11505372f68")
for DEVICE_ID in "${DEVICES[@]}"; do
# The dynamic mode didn't seem to work, unsure why
#./ttn-lw-cli end-devices set \
# --application-id ${APPLICATION_ID} \
# --device-id ${DEVICE_ID} \
# --mac-settings.adr.mode.dynamic
#./ttn-lw-cli end-devices set \
# --application-id ${APPLICATION_ID} \
# --device-id ${DEVICE_ID} \
# --mac-settings.adr.mode.dynamic.min-data-rate-index 1
#./ttn-lw-cli end-devices set \
# --application-id ${APPLICATION_ID} \
# --device-id ${DEVICE_ID} \
# --mac-settings.adr.mode.dynamic.max-data-rate-index 2
./ttn-lw-cli end-devices set \
--application-id ${APPLICATION_ID} \
--device-id ${DEVICE_ID} \
--mac-settings.adr.mode.disabled
./ttn-lw-cli end-devices set \
--application-id ${APPLICATION_ID} \
--device-id ${DEVICE_ID} \
--mac-settings.adr.mode.static \
--mac-settings.adr.mode.static.data-rate-index 1 \
--mac-settings.adr.mode.static.tx-power-index 0 \
--mac-settings.adr.mode.static.nb-trans 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment