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

Описание к видео LoRa/LoRaWAN tutorial 22: OTAA and Uplink Demonstration With The Things Network

If you like this video and want to support me, go this page for my donation Paypal or crypto addresses:
   / mobilefish  

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:
https://www.mobilefish.com/developer/...

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: https://www.thethingsnetwork.org/map

Install the latest open source Arduino IDE. In this tutorial, version 1.8.7 is used.
https://www.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)
https://www.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:
https://www.mobilefish.com/services/g...

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:
   • LoRa/LoRaWAN tutorials  

Subscribe to my YouTube channel:
   / @mobilefish  

The presentation used in this video tutorial can be found at:
https://www.mobilefish.com/developer/...

#mobilefish #lora #lorawan

Комментарии

Информация по комментариям в разработке