868 MHz Adafruit Feather 32u4

TTN version: TTNv3 / TTS SANDBOX
Activation: ABP
Device Class: Class A
Last revision: October 28, 2024

At the Feather 32u4‘s heart is at ATmega32u4 clocked at 8 MHz and at 3.3V logic. Feather 32u4 LoRa Radio uses the extra space left over to add an RFM9x LoRa 868/915 MHz radio module. We use 868 MHz one. See complete specification here.Adafruit Feather 32u4 board

Prepare

  • Adafruit Feather 32u4 RFM95 LoRa Radio
  • 1x wire
  • breadboard (optional)
  • 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://adafruit.github.io/arduino-board-index/package_adafruit_index.json
  4. Click OK.Adafruit 32u4 Arduino2 Setup
  5. Install the Adafruit boards via Boards Manager -> search Adafruit AVR Boards -> Install.Adafruit 32u4 Arduino2 Setup
  6. You should see in Tools -> Board -> Adafruit AVR Boards the Adafruit Feather 32u4.Adafruit 32u4 Arduino2 Setup
  7. Connect Adafruit Feather 32u4 using micro USB cable to your computer.
  8. Choose the appropriate COM port which is used for communication with Adafruit.Adafruit 32u4 Arduino2 Setup

 

MCCI LoRaWAN LMIC library setup

  1. In the Arduino IDE Library Manager search MCCI LoRaWAN LMIC library by Terry Moore and install it.Adafruit 32u4 Arduino2 Setup

ABP configuration for Adafruit Feather 32u4

  1. On Windows open lmic_project_config.h located in \Documents\Arduino\libraries\MCCI_LoRaWAN_LMIC_library\project_config\
  2. Change project definitions to definitions listed bellow and save it:
// project-specific definitions
#define CFG_eu868 1                  //for Europe (change it based on your location)
#define CFG_sx1276_radio 1
#define DISABLE_JOIN 1
#define DISABLE_PING 1
#define DISABLE_BEACONS 1
#define DISABLE_MCMD_DlChannelReq 1

 

Add Adafruit Feather 32u4 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)
  7. Additional LoRaWAN class capabilities – None (class A only)
  8. Deselect – Use network’s default MAC settings
  9. Rx1 data rate offset = 0
  10. Rx1 delay = 1
  11. Resets frame counters – Enabled
  12. Rx2 data rate = 3
  13. Rx2 frequency = 869,525 MHz
  14. Add entry = 868100000
  15. Add entry = 868300000
  16. Add entry = 868500000
  17. Add entry = 867100000
  18. Add entry = 867300000
  19. Add entry = 867500000
  20. Add entry = 867700000
  21. Add entry = 867900000
  22. DevEUI – Generate
  23. Device address – Generate
  24. AppSKey – Generate
  25. NwkSKey – Generate
  26. End device ID – here you can name your device
  27. After registration – View registered end device
  28. Click on button Register end device
  29. Click on Settings
  30. Network layer – Expand
  31. Click on Advanced MAC settings
  32. Desired Rx1 delay = 1
  33. Adaptive data rate (ADR) – Dynamic mode
  34. Click on button Save changes

 

Sending “Hello LoRa!” to TTS

  1. First of all wire up the board’s IO1 pin with pin 6.
    Adafruit Feather 32u4 board                                   wire_between_pins
  2. 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
       };
    }
  3. Save changes
  4. To your Arduino IDE copy and paste program Sending Hello LoRa.
  5. 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.
  6. Connect Adafruit Feather 32u4 using micro USB cable to your computer.
  7. Choose the appropriate COM port which is used for communication with Adafruit.Adafruit 32u4 Arduino2 Setup
  8. In Arduino IDE click on Upload button to upload program to your Adafruit Feather 32u4.
  9. In Arduino IDE click on Serial Monitor button and you should every +-1 minute see “Sending – Hello, LoRa!”:Adafruit 32u4 Arduino2 Serial Monitor
  10. In TTS -> Applications -> YourAppName -> YourEndDeviceName -> Live data you should see this:TTS_Hello_Lora