From 588aa653b097e46cd8cc85dafd91c00d67e0b52c Mon Sep 17 00:00:00 2001 From: Felix Date: Thu, 9 Jan 2025 20:35:50 -0600 Subject: [PATCH] Set region fix. Updated to latest arduino lib. --- .github/workflows/build-iotnode-lorawan.yml | 2 +- sfeIoTNodeLoRaWAN/flxLoRaWANDigi.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-iotnode-lorawan.yml b/.github/workflows/build-iotnode-lorawan.yml index 3abdfbf..6c977e4 100644 --- a/.github/workflows/build-iotnode-lorawan.yml +++ b/.github/workflows/build-iotnode-lorawan.yml @@ -70,7 +70,7 @@ jobs: - name: Install The XBee LoRaWAN library run: | arduino-cli config set library.enable_unsafe_install true - arduino-cli lib install --git-url "https://github.com/sparkfun/XBeeArduino.git" + arduino-cli lib install --git-url "https://github.com/digidotcom/XBeeArduino" arduino-cli lib install FastLED # Compile time - build the Firmware for the data logger. diff --git a/sfeIoTNodeLoRaWAN/flxLoRaWANDigi.cpp b/sfeIoTNodeLoRaWAN/flxLoRaWANDigi.cpp index 4d26be5..61e396a 100644 --- a/sfeIoTNodeLoRaWAN/flxLoRaWANDigi.cpp +++ b/sfeIoTNodeLoRaWAN/flxLoRaWANDigi.cpp @@ -340,6 +340,22 @@ bool flxLoRaWANDigi::configureModule(void) flxLog_N_(F(".")); + // Set the region + flxLog_N_(F(". settingthe LoRaWAN Region to `%s`["), name(), getRegionName()); + if (!_pXBeeLR->setLoRaWANRegion(_lora_region)) + { + flxSerial.textToYellow(); + flxLog_N_(F("failed")); + } + else + { + flxSerial.textToGreen(); + flxLog_N_(F("ok")); + } + flxSerial.textToNormal(); + flxLog_N_(F("] ")); + flxLog_N_(F(".")); + // Save the config to the module if (!_pXBeeLR->writeConfig()) {