2020-03-05 14:07:57 +01:00
|
|
|
#ifndef __LORACONF_H__
|
|
|
|
#define __LORACONF_H__
|
|
|
|
|
2020-03-16 19:13:01 +01:00
|
|
|
#if (HAS_LORA)
|
2018-07-14 20:07:33 +02:00
|
|
|
|
2018-03-18 19:45:17 +01:00
|
|
|
/************************************************************
|
|
|
|
* LMIC LoRaWAN configuration
|
2018-06-12 19:50:58 +02:00
|
|
|
*
|
2018-05-20 11:47:13 +02:00
|
|
|
* Read the values from TTN console (or whatever applies), insert them here,
|
|
|
|
* and rename this file to src/loraconf.h
|
2018-06-12 19:50:58 +02:00
|
|
|
*
|
2020-03-16 00:03:22 +01:00
|
|
|
* You can configure OTAA or ABP Activation. In order to use ABP, uncomment
|
|
|
|
* (enable) the following line, but you should only do so, if you have good
|
|
|
|
* reasons for not using OTAA.
|
2020-03-05 14:07:57 +01:00
|
|
|
*
|
|
|
|
*************************************************************/
|
|
|
|
|
|
|
|
//#define LORA_ABP
|
|
|
|
|
2020-03-16 00:03:22 +01:00
|
|
|
#ifndef LORA_ABP
|
2020-03-05 14:07:57 +01:00
|
|
|
/************************************************************
|
|
|
|
* OTAA configuration
|
|
|
|
*
|
2020-03-16 00:03:22 +01:00
|
|
|
* DEVEUI, APPEUI and APPKEY should all be specified in MSB format as
|
|
|
|
* displayed in TTN console, so you can cut & paste from there. This is different
|
|
|
|
* from standard LMIC-Arduino which expects DEVEUI and APPEUI in LSB format.
|
|
|
|
* For TTN, APPEUI in MSB format always starts with 0x70, 0xB3, 0xD5.
|
|
|
|
|
|
|
|
* Set your DEVEUI here, if your device has have a fixed one.
|
|
|
|
* If you leave this untouched, then the DEVEUI will be derived from device's
|
|
|
|
* MAC adress during startup and will be displayed on device's screen as well as
|
|
|
|
* on serial console, if you set 'verbose 1' in paxcounter.conf and
|
|
|
|
* 'debug_level 3' in platformio.ini.
|
|
|
|
* If using a board with Microchip 24AA02E64 Uinique ID for deveui, the DEVEUI
|
|
|
|
* will be overwritten by the one contained in the Microchip module.
|
2018-06-12 19:50:58 +02:00
|
|
|
*
|
2018-03-18 19:45:17 +01:00
|
|
|
************************************************************/
|
|
|
|
|
2018-06-12 19:50:58 +02:00
|
|
|
static const u1_t DEVEUI[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
2018-03-18 19:45:17 +01:00
|
|
|
|
2018-06-12 19:50:58 +02:00
|
|
|
static const u1_t APPEUI[8] = {0x70, 0xB3, 0xD5, 0x00, 0x00, 0x00, 0x00, 0x00};
|
2018-03-18 19:45:17 +01:00
|
|
|
|
2018-06-12 19:50:58 +02:00
|
|
|
static const u1_t APPKEY[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
2018-07-14 20:07:33 +02:00
|
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
2020-03-05 14:07:57 +01:00
|
|
|
|
2020-03-16 19:13:01 +01:00
|
|
|
#endif
|
2020-03-05 14:07:57 +01:00
|
|
|
|
2020-03-16 00:03:22 +01:00
|
|
|
#ifdef LORA_ABP
|
2020-03-05 14:07:57 +01:00
|
|
|
/************************************************************
|
|
|
|
* ABP configuration (for development)
|
2020-03-16 19:13:01 +01:00
|
|
|
*
|
2020-03-05 14:07:57 +01:00
|
|
|
* Get your
|
|
|
|
* - Network Session Key (NWKSKEY)
|
|
|
|
* - App Session Key and your (APPSKEY)
|
|
|
|
* - Device Address (DEVADDR)
|
2020-03-16 00:03:22 +01:00
|
|
|
* from e.g. TTN console and replace the example values below.
|
2020-03-05 14:07:57 +01:00
|
|
|
*
|
|
|
|
* NOTE: Use MSB format (as displayed in TTN console, so you can cut & paste
|
|
|
|
* from there)
|
|
|
|
*
|
2020-03-16 00:03:22 +01:00
|
|
|
* NOTE: You may also need to adjust lorawan_abp.cpp in order to configure
|
|
|
|
* different channels and data rate channels to match your country's regulations
|
|
|
|
* and your network's settings.
|
|
|
|
*
|
2020-03-05 14:07:57 +01:00
|
|
|
************************************************************/
|
|
|
|
|
2020-03-16 19:13:01 +01:00
|
|
|
// ID of LoRaAlliance assigned Network (for a list, see e.g. here
|
|
|
|
// https://www.thethingsnetwork.org/docs/lorawan/prefix-assignments.html)
|
2020-03-05 14:07:57 +01:00
|
|
|
static const u1_t NETID = 0x13; // TTN
|
|
|
|
|
2020-03-16 19:13:01 +01:00
|
|
|
static const u1_t NWKSKEY[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
|
|
0x00, 0x00, 0x00, 0x00};
|
2020-03-05 14:07:57 +01:00
|
|
|
|
2020-03-16 19:13:01 +01:00
|
|
|
static const u1_t APPSKEY[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
|
|
0x00, 0x00, 0x00, 0x00};
|
2020-03-05 14:07:57 +01:00
|
|
|
|
2020-03-16 19:13:01 +01:00
|
|
|
static const u4_t DEVADDR =
|
|
|
|
0x00000000; // <-- Change this address for every node!
|
2020-03-05 14:07:57 +01:00
|
|
|
|
|
|
|
// set additional ABP parameters in loraconf_abp.cpp
|
|
|
|
void setABPParamaters();
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // HAS_LORA
|
2018-07-14 20:07:33 +02:00
|
|
|
|
2020-03-05 14:07:57 +01:00
|
|
|
#endif // __LORACONF_H__
|