-
Notifications
You must be signed in to change notification settings - Fork 3
Get started
Navigate to The Things Network Community Edition console
and create a new application dedicated to LoRa communicators. Navigate to the
newly created application and go to "Payload formatters", "Uplink". Choose
Javascript as the "Formatter type", and paste the content of
ttn_v3_uplink_payload_formatter.js
into the "Formatter parameter" text area.
Next, navigate to "End devices" and create a new end device:
- Skip selecting a brand for this device. Go to manual device registration.
- Frequency plan: choose
Europe 863-870 MHz (SF9 for RX2 - recommended)
. - LoRaWAN version: choose
MAC V1.0.3
. - LoRaWAN class capabilities: unselect
Supports class B
and unselectSupports class C
.- The communicator is a class A device.
- Regional Parameters version: choose
PHY V1.0.3 REV A
. - Click "Show advanced activation, LoRaWAN class and cluster settings".
- Activation mode: choose
Activation by personalization (ABP)
.- As of December 2021, the software does not yet support OTAA.
- Uncheck "Use network's default MAC settings".
- Rx1 data rate offset: enter
0
. - Rx1 delay: enter
1
. - Resets frame counters: check (yes).
- Rx2 data rate: enter
3
- The data rate number matches the combination of 125KHz bandwidth and spreading factor 9, which correctly corresponds to the frequency plan choice.
- Rx2 frequency: enter
869.525 MHz
. - Factory preset frequencies, enter
868100000
,868300000
,868500000
,867100000
,867300000
,867500000
,867700000
,867900000
, one in each text box. - End device ID: enter a recognisable name for the device as you like.
Click the "Generate" button next to DevEUI, Device address, AppSKey, and NwkSKey.
Next, view the newly created device and go to "General settings", expand
"Network layer" and "Application layer" and note down the generated parameter
values - they will be used to construct a lorawan_creds.h
file later on.
Go to "Network layer" and expand "Advanced MAC settings". Correct any derivation from the following configuration:
- Rx1 and desired delay:
1
- Rx1 and desired data rate offset:
0
- Resets frame counters: yes
- Rx2 and desired data rate index:
3
- Rx2 and desired frequency:
869.525 MHz
- Maximum and desired duty cycle:
100%
- Factory preset frequencies:
868100000
,868300000
,868500000
,867100000
,867300000
,867500000
,867700000
,867900000
, one in each text box. - Status count periodicity:
200 messages
- Status time periodicity:
86400 seconds
- Use adaptive data rate (ADR): no
All of the parameters must match - otherwise there is a high likelihood of not being able to transmit or receive text messages!
Clone the repository and create a new text file include/lorawan_creds.h
with
the following content:
#pragma once
// Substitute # with the parameter values generated by the console.
static const u1_t PROGMEM NWKSKEY[16] = {0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##};
static const u1_t PROGMEM APPSKEY[16] = {0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##};
static const u4_t DEVADDR = 0x########;
Plug-in the TTGO T-Beam to the computer, open Device Manager and expand
"Ports (COM & LPT)", take note of the COM port number. Edit platformio.ini
and
change change dev_board_serial_port = COM#
to the COM port number.
Finally, install VSCode and Platform.IO plugin, open the cloned repository and
execute command PlatformIO: Upload
.