LoRa/LoRaWAN tutorial 22: OTAA and Uplink Demonstration With The Things Network @Mobilefish
LoRa/LoRaWAN tutorial 22: OTAA and Uplink Demonstration With The Things Network  @Mobilefish
Uploaded October 2018 | Updated September 2026, 2 weeks ago
If you like this video and want to support me, go this page for my donation Paypal or crypto addresses:
youtube.com/c/mobilefish/about

This is part 22 of the LoRa/LoRaWAN tutorial.

In this video series different topics will be explained which will help you to understand LoRa/LoRaWAN.
It is recommended to watch each video sequentially as I may refer to certain LoRa/LoRaWAN topics explained earlier.

In this tutorial I will demonstrate the Over-The-Air-Activation method.
In the demonstration I will use my self build LoRa development board to send messages to The Things Network using the MCCI Arduino LMIC library.

Self build LoRa development board, make sure an antenna is connected, see:
mobilefish.com/developer/lorawan/lorawan_quickguide_build_lora_node_rfm95_arduino_uno.html

The HopeRF RFM95 LoRa transceiver module is compatible with SX1276.

Make sure a LoRa gateway is your area and your LoRa end device can send messages to this gateway.
Use this map: thethingsnetwork.org/map

Install the latest open source Arduino IDE. In this tutorial, version 1.8.7 is used.
arduino.cc/en/Main/Software

Now install the MCCI Arduino LMIC Library.
- In the Arduino IDE, select menu Sketch | Include Library | Manage Libraries
- In the search box enter: MCCI
- Click the MCCI library.
- Select the latest version and press the Install button.

The Arduino libraries are installed on these default locations:
Windows: C:\Users\username\Documents\Arduino\libraries
OSX: /Users/username/Documents/Arduino/libraries
Linux: /home/username/arduino/sketchbook/libraries

Configure the MCCI Arduino LMIC Library according to your situation.
Edit file lmic_project_config.h. This file can be found at:
../libraries/MCCI_LoRaWAN_LMIC_library/project_config
Make changes to the lmic_project_config.h file.

The Arduino Uno (ATmega328) has 32kBytes of flash memory for the bootloader + uploaded sketch.
It is important to use these settings:
#define DISABLE_PING
#define DISABLE_BEACONS
#define LMIC_DEBUG_LEVEL 0
#define USE_IDEETRON_AES
...otherwise the compiled sketch does fits the Arduino Uno flash memory.
There are more configuration settings which can be overridden by the lmic_project_config.h file, see:
.../libraries/MCCI_LoRaWAN_LMIC_library/src/lmic/config.h
But in this demonstration I do not override any of these other settings.

Create an account on The Things Network (TTN)
thethingsnetwork.org

On TTN, add an application:
Application ID: youtube_demo_app
Description: My YouTube LoRawan demo application

On TTN, register a device:
Device ID: youtube_demo_device
Device EUI: F9C01FAA68E1D265 (Enter a random value consisting of 8 bytes)
You can use this tool to create the device EUI:
mobilefish.com/services/guid/guid.php

Make sure the activation method is OTAA.
The App Key is generated.

In the Arduino IDE, select menu File | Examples | MCC LoRaWAN LMIC library and select the ttn-otaa sketch.
Re-save the ttn-otaa sketch and call it ttn-otaa-mydemo.
From The Things Network console copy YOUR DevEUI, AppEUI and AppKey to the ttn-otaa-mydemo sketch.
Watch out:
The DevEUI and AppEUI must be in little-endian format.
The AppKey must be in big endian format.

Big-endian and little-endian are terms that describe the order in which a sequence of bytes are stored in computer memory.
Big-endian is an order in which the most significant bit (msb) is stored first.
Little-endian is an order in which the least significant bit (lsb) is stored first.

Connect the self build LoRa development board to your computer using the USB cable.

In the Arduino IDE, select menu Tools | Board and select: Arduino/Genuino Uno
In the Arduino IDE, select menu Tools | Port and select: your_port

Compile ttn-otaa-mydemo sketch.
You should not see any errors.

Upload the ttn-otaa-mydemo sketch to the Arduino Uno.
You should not see any errors.

In the Arduino IDE, select menu Tools | Serial Monitor
Select baud rate: 9600

Goto The Things Network console:
- Select the app: youtube_demo_app
- Select the registered device: youtube_demo_device
- Select reset frame counters. Do this each time your end device is powered up.
In the Device Overview screen, top right corner, select Data.
Your device is being registered and after a few minutes the message “Hello, world!” (in hex: 48 65 6c 6c 6f 2c 20 77 6f 72 6c 64 21) is received by a gateway and send to the network server and displayed in the The Things Network console.

Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g

Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1

The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html

#mobilefish #lora #lorawan
LoRa/LoRaWAN tutorial 22: OTAA and Uplink Demonstration With The Things NetworkSend humidity and temperature data from DHT11 sensor to The Things Network, part 7LoRa/LoRaWAN tutorial 37: Balanced and Unbalanced Feed Lines and Antennas and BalunLoRa/LoRaWAN tutorial 42: Monopole Antenna and Ground PlaneDownload, configure and startup single channel Lora gateway, part 3LoRa/LoRaWAN tutorial 5: Decibel, dBm, dBi, dBdBlockchain tutorial 21: Peer-to-peer network, propagation and latencyBlockchain tutorial 30: HMACLoRa/LoRaWAN tutorial 48: Yagi-Uda AntennaBlockchain tutorial 25: Testnet and faucetsLoRa/LoRaWAN tutorial 50: Enclosures and IP RatingBlockchain tutorial 28: Bitcoin Improvement Proposal 39 (BIP-39) mnemonic words
Mobilefish.com |

LoRa/LoRaWAN tutorial 22: OTAA and Uplink Demonstration With The Things Network

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER