868 MHz Seeeduino LoRaWAN

TTN version: TTNv3 / TTS SANDBOX
Frequency: Europe 863-870 MHz (SF9 for RX2 – recommended)
Activation: OTAA / ABP
Device Class: Class A, B, C
LoRaWAN: 1.0.3
Last revision: December 14, 2024

Seeeduino LoRaWAN is an Arduino development board with LoRaWAN protocol embedded, through which you can get started quickly to experience LoRa’s advantage in the field of IoT. Based on the communication module RHF76-052DM v3.5.13, Seeeduino LoRaWAN is compatible with LoRaWAN Class A, B, C and supports a variety of communication frequenciesSee complete specification here.Seeduino board

Prepare

  • Seeeduino LoRaWAN
  • PC + micro USB cable

 

Arduino IDE setup

  1. Download Arduino IDE.
  2. Run Arduino IDE.
  3. In the Arduino IDE File -> Preferences copy and paste the link below into the Additional Boards Manager URLs.
    https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json
  4. Click OK.Seeduino Arduino Preferences
  5. Install the Seeed SAMD Boards via Boards Manager -> search Seeeduino LoRaWAN -> Install.Seeduino Arduino Boards Manager
  6. You should see in Tools -> Board -> Seeed SAMD Boards the Seeeduino LoRaWAN.Seeduino Arduino Board
  7. Connect the Seeeduino LoRaWAN using micro USB cable to your computer.
  8. Choose the appropriate COM port which is used for communication with Seeeduino.Seeduino Arduino COM

Seeeduino LoRaWAN library setup

  1. Download as ZIP this 868 MHz Seeeduino LoRaWAN library.
  2. In the Arduino IDE Sketch -> Include Library -> Add .ZIP Library… choose downloaded ZIP.

 

Activation

Over The Air Activation (OTAA) – the most secure and recommended activation method for end devices. Devices perform a join procedure with the network, during which a dynamic device address is assigned and security keys are negotiated with the device.

Activation By Personalization (ABP) – requires hardcoding the device address as well as the security keys in the device. ABP is less secure than OTAA and also has the downside that devices can not switch network providers without manually changing keys in the device.

See the documentation for more information on activation.

 

Device classes

The LoRaWAN specification defines three device types: Class A, Class B, and Class C. All LoRaWAN devices must implement Class A, whereas Class B and Class C are extensions to the specification of Class A devices. All device classes support bi-directional communication (uplink and downlink).

See the documentation for more information on device classes.

 

Fair Use Policy

The TTN documentation says about Fair Use Policy:

On The Things Network’s public community network a Fair Use Policy applies which limits the uplink airtime to 30 seconds per day (24 hours) per node and the downlink messages to 10 messages per day (24 hours) per node. If you use a private network, these limits do not apply, but you still have to be compliant with the governmental and LoRaWAN limits.

Note: Don’t send more than 10 downlinks per day per node.

 

Europe 863-870 MHz (SF9 for RX2 – recommended)

Over The Air Activation (OTAA)

Add Seeeduino LoRaWAN into The Things Stack

  1. Create an account on The Things Network if you don’t have one.
  2. Login on The Things Network.
  3. Click on your username and choose Console.
  4. Select a network cluster.
Add application
  1. Go to applications.
  2. Click on button + Add application.
  3. Write something into Application ID.
  4. Click on button Create application.
Add end device
  1. In your application click on button + Register end device.
  2. Input Method – Choose Enter end device specifics manually.
  3. Frequency plan – Europe 863-870 MHz (SF9 for RX2 – recommended)
  4. LoRaWAN version – LoRaWAN Specification 1.0.3
  5. Click on Show advanced activation, LoRaWAN class and cluster settings
  6. Activation mode – Over the air activation (OTAA)

Class A

  1. Additional LoRaWAN class capabilities – None (class A only)
  2. Deselect – Use network’s default MAC settings
  3. Rx2 data rate = 3
  4. Rx2 frequency = 869,525 MHz

Class B

  1. Additional LoRaWAN class capabilities – Class B (Beaconing)
  2. Deselect – Use network’s default MAC settings
  3. Class B timeout – Set to value less than the time between two ping slots (ping slot periodicity) (for example every 15 seconds)
  4. Ping slot periodicity – The amount of time between two receive windows (ping slots) (for example every 16 seconds)
  5. Ping slot data rate – 3
  6. Beacon frequency – 869,525 MHz
  7. Ping slot frequency – 869,525 MHz
  8. Rx2 data rate = 3
  9. Rx2 frequency = 869,525 MHz

Class C

  1. Additional LoRaWAN class capabilities – Class C (Continuous)
  2. Deselect – Use network’s default MAC settings
  3. Class C timeout – 300 seconds
  4. Rx2 data rate = 3
  5. Rx2 frequency = 869,525 MHz

  1. JoinEUI – 0000000000000000
  2. Click on Confirm.
  3. DevEUI – Generate
  4. AppKey – Generate
  5. End device ID – here you can name your device
  6. After registration – View registered end device
  7. Click on button Register end device
  8. Click on Settings
  9. Network layer – Expand
  10. Click on Advanced MAC settings
  11. Desired Rx1 delay = 1
  12. Rx1 data rate offset = 0
  13. Add Frequency = 868100000
  14. Add Frequency = 868300000
  15. Add Frequency = 868500000
  16. Add Frequency = 867100000
  17. Add Frequency = 867300000
  18. Add Frequency = 867500000
  19. Add Frequency = 867700000
  20. Add Frequency = 867900000
  21. Adaptive data rate (ADR) – Dynamic mode
  22. Click on button Save changes

 

Sending “Hello LoRa!” to TTS

  1. In TTS -> Applications -> YourAppName -> YourEndDeviceName -> Payload formatters -> Uplink change Formatter type to Custom Javascript formatter and to Formatter code copy and paste code bellow:
    function Decoder(bytes, port) { 
       return {
              mydata: String.fromCharCode.apply(null, bytes) // Decode plain text
       };
    }
  2. Save changes

 

Class A

  1. In the Arduino IDE File -> Examples -> 868_SeeeduinoLoRaWan-x.x.x -> open 868_OTAA_Class_A_Hello_LoRa
  2. In program replace APP_EUI, DEV_EUI and APP_KEY with keys in TTS. Keys are in TTS -> Applications -> YourAppName -> YourEndDeviceName -> Activation information.
  3. Connect Seeeduino LoRaWAN using micro USB cable to your computer.
  4. Choose the appropriate COM port which is used for communication with Seeeduino.Seeduino Arduino COM
  5. In Arduino IDE click on Upload button to upload program to your Seeeduino LoRaWAN.
  6. In Arduino IDE click on Serial Monitor button and you should every +-300 seconds see “Sending – Hello, LoRa!”:Arduino serial monitor
  7. In TTS -> Applications -> YourAppName -> YourEndDeviceName -> Live data you should see this:Hello LoRa, TTS Console

 

Class B

  1. In the Arduino IDE File -> Examples -> 868_SeeeduinoLoRaWan-x.x.x -> open 868_OTAA_Class_B_Hello_LoRa
  2. In program replace APP_EUI, DEV_EUI and APP_KEY with keys in TTS. Keys are in TTS -> Applications -> YourAppName -> YourEndDeviceName -> Activation information.
  3. Connect Seeeduino LoRaWAN using micro USB cable to your computer.
  4. Choose the appropriate COM port which is used for communication with Seeeduino.Seeduino Arduino COM
  5. In Arduino IDE click on Upload button to upload program to your Seeeduino LoRaWAN.
  6. In Arduino IDE click on Serial Monitor button and you should every +-300 seconds see “Sending – Hello, LoRa!”:
  7. In TTS -> Applications -> YourAppName -> YourEndDeviceName -> Live data you should see this:

 

Class C

  1. In the Arduino IDE File -> Examples -> 868_SeeeduinoLoRaWan-x.x.x -> open 868_OTAA_Class_C_Hello_LoRa
  2. In program replace APP_EUI, DEV_EUI and APP_KEY with keys in TTS. Keys are in TTS -> Applications -> YourAppName -> YourEndDeviceName -> Activation information.
  3. Connect Seeeduino LoRaWAN using micro USB cable to your computer.
  4. Choose the appropriate COM port which is used for communication with Seeeduino.Seeduino Arduino COM
  5. In Arduino IDE click on Upload button to upload program to your Seeeduino LoRaWAN.
  6. In Arduino IDE click on Serial Monitor button and you should every +-300 seconds see “Sending – Hello, LoRa!”:Arduino serial monitor class C
  7. In TTS -> Applications -> YourAppName -> YourEndDeviceName -> Live data you should see this:TTS Console, class c

 

Low Power – Sending “Hello LoRa!” to TTS

Class A

  1. In the Arduino IDE File -> Examples -> 868_SeeeduinoLoRaWan-x.x.x -> open 868_OTAA_Class_A_Hello_LoRa_Low_Power
  2. In program replace APP_EUI, DEV_EUI and APP_KEY with keys in TTS. Keys are in TTS -> Applications -> YourAppName -> YourEndDeviceName -> Activation information.
  3. In the Arduino IDE Library Manager search RTCZero by Arduino and install it.
  4. Connect Seeeduino LoRaWAN using micro USB cable to your computer.
  5. Choose the appropriate COM port which is used for communication with Seeeduino.Seeduino Arduino COM
  6. In Arduino IDE click on Upload button to upload program to your Seeeduino LoRaWAN.
  7. In Arduino IDE click on Serial Monitor button and you should every +-300 seconds see “Sending – Hello, LoRa!”:

 

Sending values to TTS, downlink reception and Cayenne LPP decoding

 

Activation By Personalization (ABP)

Add Seeeduino LoRaWAN into The Things Stack

  1. Create an account on The Things Network if you don’t have one.
  2. Login on The Things Network.
  3. Click on your username and choose Console.
  4. Select a network cluster.
Add application
  1. Go to applications.
  2. Click on button + Add application.
  3. Write something into Application ID.
  4. Click on button Create application.
Add end device
  1. In your application click on button + Register end device.
  2. Input Method – Choose Enter end device specifics manually.
  3. Frequency plan – Europe 863-870 MHz (SF9 for RX2 – recommended)
  4. LoRaWAN version – LoRaWAN Specification 1.0.3
  5. Click on Show advanced activation, LoRaWAN class and cluster settings
  6. Activation mode – Activation by personalization (ABP)

Class A

  1. Additional LoRaWAN class capabilities – None (class A only)
  2. Deselect – Use network’s default MAC settings
  3. Rx1 data rate offset = 0
  4. Rx1 delay = 1
  5. Resets frame counters – Enabled
  6. Rx2 data rate = 3
  7. Rx2 frequency = 869,525 MHz

Class B

  1. Additional LoRaWAN class capabilities – Class B (Beaconing)
  2. Rx1 data rate offset = 0
  3. Rx1 delay = 1
  4. Resets frame counters – Enabled
  5. Class B timeout – Set to value less than the time between two ping slots (ping slot periodicity) (for example every 15 seconds)
  6. Ping slot periodicity – The amount of time between two receive windows (ping slots) (for example every 16 seconds)
  7. Beacon frequency – 869,525 MHz
  8. Ping slot frequency – 869,525 MHz
  9. Rx2 data rate = 3
  10. Rx2 frequency = 869,525 MHz

Class C

  1. Additional LoRaWAN class capabilities – Class C (Continuous)
  2. Deselect – Use network’s default MAC settings
  3. Rx1 data rate offset = 0
  4. Rx1 delay = 1
  5. Resets frame counters – Enabled
  6. Class C timeout – 300 seconds
  7. Rx2 data rate = 3
  8. Rx2 frequency = 869,525 MHz

  1. Add entry = 868100000
  2. Add entry = 868300000
  3. Add entry = 868500000
  4. Add entry = 867100000
  5. Add entry = 867300000
  6. Add entry = 867500000
  7. Add entry = 867700000
  8. Add entry = 867900000
  9. DevEUI – Generate
  10. Device address – Generate
  11. NwkSKey – Generate
  12. AppSKey – Generate
  13. End device ID – here you can name your device
  14. After registration – View registered end device
  15. Click on button Register end device
  16. Click on Settings
  17. Network layer – Expand
  18. Click on Advanced MAC settings
  19. Desired Rx1 delay = 1
  20. Adaptive data rate (ADR) – Dynamic mode
  21. Click on button Save changes

 

Sending “Hello LoRa!” to TTS

  1. In TTS -> Applications -> YourAppName -> YourEndDeviceName -> Payload formatters -> Uplink change Formatter type to Custom Javascript formatter and to Formatter code copy and paste code bellow:
    function Decoder(bytes, port) { 
       return {
              mydata: String.fromCharCode.apply(null, bytes) // Decode plain text
       };
    }
  2. Save changes

 

Class A

  1. In the Arduino IDE File -> Examples -> 868_SeeeduinoLoRaWan-x.x.x -> open 868_ABP_Class_A_Hello_LoRa
  2. In program replace NWKSKEY, APPSKEY and DEVADDR with keys of your end device registred in TTS. Keys are in TTS -> Applications -> YourAppName -> YourEndDeviceName -> Device overview -> Session information.
  3. Connect Seeeduino LoRaWAN using micro USB cable to your computer.
  4. Choose the appropriate COM port which is used for communication with Seeeduino.Seeduino Arduino COM
  5. In Arduino IDE click on Upload button to upload program to your Seeeduino LoRaWAN.
  6. In Arduino IDE click on Serial Monitor button and you should every +-300 seconds see “Sending – Hello, LoRa!”:
  7. In TTS -> Applications -> YourAppName -> YourEndDeviceName -> Live data you should see this:

 

Low Power – Sending “Hello LoRa!” to TTS

Class A

  1. In the Arduino IDE File -> Examples -> 868_SeeeduinoLoRaWan-x.x.x -> open 868_ABP_Class_A_Hello_LoRa_Low_Power
  2. In program replace NWKSKEY, APPSKEY and DEVADDR with keys of your end device registred in TTS. Keys are in TTS -> Applications -> YourAppName -> YourEndDeviceName -> Device overview -> Session information.
  3. In the Arduino IDE Library Manager search RTCZero by Arduino and install it.
  4. Connect Seeeduino LoRaWAN using micro USB cable to your computer.
  5. Choose the appropriate COM port which is used for communication with Seeeduino.Seeduino Arduino COM
  6. In Arduino IDE click on Upload button to upload program to your Seeeduino LoRaWAN.
  7. In Arduino IDE click on Serial Monitor button and you should every +-300 seconds see “Sending – Hello, LoRa!”: