From 3338034ac7966b7fe2cf45b5f8501c54651f5d45 Mon Sep 17 00:00:00 2001 From: StevenCellist Date: Sat, 13 Jan 2024 00:15:52 +0100 Subject: [PATCH] [LoRaWAN] Update examples --- .../LoRaWAN_End_Device/LoRaWAN_End_Device.ino | 15 ++++++++------- .../LoRaWAN_End_Device_ABP.ino | 15 ++++++++------- .../LoRaWAN_End_Device_Persistent.ino | 8 ++++++++ .../LoRaWAN_End_Device_Reference.ino | 15 ++++++++------- 4 files changed, 32 insertions(+), 21 deletions(-) diff --git a/examples/LoRaWAN/LoRaWAN_End_Device/LoRaWAN_End_Device.ino b/examples/LoRaWAN/LoRaWAN_End_Device/LoRaWAN_End_Device.ino index 732da594..c755a8bd 100644 --- a/examples/LoRaWAN/LoRaWAN_End_Device/LoRaWAN_End_Device.ino +++ b/examples/LoRaWAN/LoRaWAN_End_Device/LoRaWAN_End_Device.ino @@ -38,6 +38,14 @@ SX1278 radio = new Module(10, 2, 9, 3); // based on your geographical location! LoRaWANNode node(&radio, &EU868); +// for fixed bands with subband selection +// such as US915 and AU915, you must specify +// the subband that matches the Frequency Plan +// that you selected on your LoRaWAN console +/* + LoRaWANNode node(&radio, &US915, 2); +*/ + void setup() { Serial.begin(9600); @@ -78,13 +86,6 @@ void setup() { // when connecting to LoRaWAN 1.0 network, "appKey" will be disregarded // and can be set to NULL - // some frequency bands only use a subset of the available channels - // you can select the specific band or set the first channel and last channel - // for example, either of the following corresponds to US915 FSB2 in TTN - /* - node.selectSubband(2); - node.selectSubband(8, 15); - */ // on EEPROM-enabled boards, after the device has been activated, // the session can be restored without rejoining after device power cycle diff --git a/examples/LoRaWAN/LoRaWAN_End_Device_ABP/LoRaWAN_End_Device_ABP.ino b/examples/LoRaWAN/LoRaWAN_End_Device_ABP/LoRaWAN_End_Device_ABP.ino index 5ac9261f..ec1252e9 100644 --- a/examples/LoRaWAN/LoRaWAN_End_Device_ABP/LoRaWAN_End_Device_ABP.ino +++ b/examples/LoRaWAN/LoRaWAN_End_Device_ABP/LoRaWAN_End_Device_ABP.ino @@ -39,6 +39,14 @@ SX1278 radio = new Module(10, 2, 9, 3); // based on your geographical location! LoRaWANNode node(&radio, &EU868); +// for fixed bands with subband selection +// such as US915 and AU915, you must specify +// the subband that matches the Frequency Plan +// that you selected on your LoRaWAN console +/* + LoRaWANNode node(&radio, &US915, 2); +*/ + void setup() { Serial.begin(9600); @@ -82,13 +90,6 @@ void setup() { // when connecting to LoRaWAN 1.0 network, "appKey" will be disregarded // and can be set to NULL - // some frequency bands only use a subset of the available channels - // you can select the specific band or set the first channel and last channel - // for example, either of the following corresponds to US915 FSB2 in TTN - /* - node.selectSubband(2); - node.selectSubband(8, 15); - */ // if using EU868 on ABP in TTN, you need to set the SF for RX2 window manually /* diff --git a/examples/LoRaWAN/LoRaWAN_End_Device_Persistent/LoRaWAN_End_Device_Persistent.ino b/examples/LoRaWAN/LoRaWAN_End_Device_Persistent/LoRaWAN_End_Device_Persistent.ino index 672506c6..a475e725 100644 --- a/examples/LoRaWAN/LoRaWAN_End_Device_Persistent/LoRaWAN_End_Device_Persistent.ino +++ b/examples/LoRaWAN/LoRaWAN_End_Device_Persistent/LoRaWAN_End_Device_Persistent.ino @@ -43,6 +43,14 @@ SX1278 radio = new Module(10, 2, 9, 3); // based on your geographical location! LoRaWANNode node(&radio, &EU868); +// for fixed bands with subband selection +// such as US915 and AU915, you must specify +// the subband that matches the Frequency Plan +// that you selected on your LoRaWAN console +/* + LoRaWANNode node(&radio, &US915, 2); +*/ + void setup() { Serial.begin(9600); diff --git a/examples/LoRaWAN/LoRaWAN_End_Device_Reference/LoRaWAN_End_Device_Reference.ino b/examples/LoRaWAN/LoRaWAN_End_Device_Reference/LoRaWAN_End_Device_Reference.ino index 2d8c84cf..0507d5f2 100644 --- a/examples/LoRaWAN/LoRaWAN_End_Device_Reference/LoRaWAN_End_Device_Reference.ino +++ b/examples/LoRaWAN/LoRaWAN_End_Device_Reference/LoRaWAN_End_Device_Reference.ino @@ -41,6 +41,14 @@ SX1278 radio = new Module(10, 2, 9, 3); // based on your geographical location! LoRaWANNode node(&radio, &EU868); +// for fixed bands with subband selection +// such as US915 and AU915, you must specify +// the subband that matches the Frequency Plan +// that you selected on your LoRaWAN console +/* + LoRaWANNode node(&radio, &US915, 2); +*/ + void setup() { Serial.begin(9600); @@ -81,13 +89,6 @@ void setup() { // when connecting to LoRaWAN 1.0 network, "appKey" will be disregarded // and can be set to NULL - // some frequency bands only use a subset of the available channels - // you can select the specific band or set the first channel and last channel - // for example, either of the following corresponds to US915 FSB2 in TTN - /* - node.selectSubband(2); - node.selectSubband(8, 15); - */ // now we can start the activation // this can take up to 10 seconds, and requires a LoRaWAN gateway in range