2018-10-21 19:00:20 +02:00
|
|
|
// COUNTRY AND PROJECT SPECIFIC DEFINITIONS FOR LMIC STACK
|
|
|
|
|
2022-02-21 10:45:27 +01:00
|
|
|
// workaround for arduino-espressif32 v2.0.0 (see isse #714 @ MCCI_LMIC)
|
|
|
|
#define hal_init LMICHAL_init
|
|
|
|
|
2018-10-21 19:00:20 +02:00
|
|
|
// COUNTRY SETTINGS
|
|
|
|
// --> please check with you local regulations for ISM band frequency use!
|
|
|
|
|
2019-09-07 18:02:27 +02:00
|
|
|
#define CFG_eu868 1 // Europe (high band)
|
|
|
|
//#define CFG_eu433 1 // Europe (low band)
|
|
|
|
//#define CFG_us915 1 // USA, Canada and South America
|
|
|
|
//#define CFG_in866 1 // India
|
2020-01-01 18:25:17 +01:00
|
|
|
//#define CFG_au915 1 // Australia
|
2019-09-07 18:02:27 +02:00
|
|
|
//#define CFG_as923 1 // Asia
|
|
|
|
//#define CFG_cn783 1 // China (high band)
|
|
|
|
//#define CFG_cn490 1 // China (low band)
|
|
|
|
//#define CFG_kr920 1 // Korea
|
2018-10-21 19:00:20 +02:00
|
|
|
|
|
|
|
// LMIC LORAWAN STACK SETTINGS
|
|
|
|
// --> adapt to your device only if necessary
|
|
|
|
|
2019-08-31 15:19:49 +02:00
|
|
|
// use interrupts only if LORA_IRQ and LORA_DIO are connected to interrupt
|
2020-04-06 11:53:38 +02:00
|
|
|
// capable and separate GPIO pins on your board, if not don't enable
|
2020-12-29 14:25:59 +01:00
|
|
|
// note: this feature can't be used on ESP32 unless PR #556 of MCCI LMIC was merged
|
|
|
|
//#if (LORA_IRQ) != (LORA_IO1)
|
|
|
|
//#define LMIC_USE_INTERRUPTS 1
|
|
|
|
//#endif
|
2019-08-31 15:19:49 +02:00
|
|
|
|
2020-10-30 12:24:16 +01:00
|
|
|
// avoid lmic warning if we don't configure radio in case we haven't one
|
|
|
|
#if !(defined(CFG_sx1272_radio) || defined(CFG_sx1276_radio))
|
2020-04-10 22:56:17 +02:00
|
|
|
#define CFG_sx1276_radio 1
|
|
|
|
#endif
|
|
|
|
|
2019-08-31 15:19:49 +02:00
|
|
|
// time sync via LoRaWAN network, note: not supported by TTNv2
|
2020-03-04 21:59:38 +01:00
|
|
|
#define LMIC_ENABLE_DeviceTimeReq 1
|
2019-11-08 23:05:28 +01:00
|
|
|
|
2018-10-21 19:00:20 +02:00
|
|
|
// This tells LMIC to make the receive windows bigger, in case your clock is
|
|
|
|
// faster or slower. This causes the transceiver to be earlier switched on,
|
|
|
|
// so consuming more power. You may sharpen (reduce) this value if you are
|
2019-08-31 15:19:49 +02:00
|
|
|
// limited on battery.
|
2019-02-12 23:56:06 +01:00
|
|
|
// ATTN: VALUES > 7 WILL CAUSE RECEPTION AND JOIN PROBLEMS WITH HIGH SF RATES
|
2019-12-31 11:18:20 +01:00
|
|
|
//#define CLOCK_ERROR_PROCENTAGE 5
|
2018-10-21 19:00:20 +02:00
|
|
|
|
|
|
|
// Set this to 1 to enable some basic debug output (using printf) about
|
|
|
|
// RF settings used during transmission and reception. Set to 2 to
|
|
|
|
// enable more verbose output. Make sure that printf is actually
|
|
|
|
// configured (e.g. on AVR it is not by default), otherwise using it can
|
|
|
|
// cause crashing.
|
2021-10-02 13:20:03 +02:00
|
|
|
//#define LMIC_DEBUG_LEVEL 1
|
2018-10-21 19:00:20 +02:00
|
|
|
|
|
|
|
// Enable this to allow using printf() to print to the given serial port
|
|
|
|
// (or any other Print object). This can be easy for debugging. The
|
|
|
|
// current implementation only works on AVR, though.
|
|
|
|
//#define LMIC_PRINTF_TO Serial
|
|
|
|
|
2019-09-07 18:02:27 +02:00
|
|
|
// Change the SPI clock speed if you encounter errors
|
|
|
|
// communicating with the radio.
|
|
|
|
// The standard range is 125kHz-8MHz, but some boards can go faster.
|
|
|
|
//#define LMIC_SPI_FREQ 1E6
|
|
|
|
|
2018-10-21 19:00:20 +02:00
|
|
|
// Any runtime assertion failures are printed to this serial port (or
|
|
|
|
// any other Print object). If this is unset, any failures just silently
|
|
|
|
// halt execution.
|
|
|
|
#define LMIC_FAILURE_TO Serial
|
|
|
|
|
|
|
|
// Uncomment this to disable all code related to joining
|
|
|
|
//#define DISABLE_JOIN
|
|
|
|
// Uncomment this to disable all code related to ping
|
|
|
|
#define DISABLE_PING
|
|
|
|
// Uncomment this to disable all code related to beacon tracking.
|
2019-10-19 21:14:04 +02:00
|
|
|
// Requires ping to be disabled too#define DISABLE_BEACONS
|
2018-10-21 19:00:20 +02:00
|
|
|
|
|
|
|
// Uncomment these to disable the corresponding MAC commands.
|
|
|
|
// Class A
|
|
|
|
//#define DISABLE_MCMD_DCAP_REQ // duty cycle cap
|
|
|
|
//#define DISABLE_MCMD_DN2P_SET // 2nd DN window param
|
|
|
|
//#define DISABLE_MCMD_SNCH_REQ // set new channel
|
|
|
|
// Class B
|
|
|
|
//#define DISABLE_MCMD_PING_SET // set ping freq, automatically disabled by
|
|
|
|
// DISABLE_PING #define DISABLE_MCMD_BCNI_ANS // next beacon start, automatical
|
|
|
|
// disabled by DISABLE_BEACON
|
|
|
|
|
|
|
|
// In LoRaWAN, a gateway applies I/Q inversion on TX, and nodes do the
|
|
|
|
// same on RX. This ensures that gateways can talk to nodes and vice
|
|
|
|
// versa, but gateways will not hear other gateways and nodes will not
|
|
|
|
// hear other nodes. By uncommenting this macro, this inversion is
|
|
|
|
// disabled and this node can hear other nodes. If two nodes both have
|
|
|
|
// this macro set, they can talk to each other (but they can no longer
|
|
|
|
// hear gateways). This should probably only be used when debugging
|
|
|
|
// and/or when talking to the radio directly (e.g. like in the "raw"
|
|
|
|
// example).
|
|
|
|
//#define DISABLE_INVERT_IQ_ON_RX
|
|
|
|
|
|
|
|
// This allows choosing between multiple included AES implementations.
|
|
|
|
// Make sure exactly one of these is uncommented.
|
|
|
|
//
|
|
|
|
// This selects the original AES implementation included LMIC. This
|
|
|
|
// implementation is optimized for speed on 32-bit processors using
|
|
|
|
// fairly big lookup tables, but it takes up big amounts of flash on the
|
|
|
|
// AVR architecture.
|
2020-03-15 18:09:41 +01:00
|
|
|
//#define USE_ORIGINAL_AES
|
2018-10-21 19:00:20 +02:00
|
|
|
//
|
|
|
|
// This selects the AES implementation written by Ideetroon for their
|
|
|
|
// own LoRaWAN library. It also uses lookup tables, but smaller
|
|
|
|
// byte-oriented ones, making it use a lot less flash space (but it is
|
|
|
|
// also about twice as slow as the original).
|
2020-03-15 18:09:41 +01:00
|
|
|
#define USE_IDEETRON_AES
|
2018-12-16 23:36:17 +01:00
|
|
|
//
|
2019-09-07 18:02:27 +02:00
|
|
|
//#define USE_MBEDTLS_AES
|
2020-04-10 23:26:29 +02:00
|
|
|
|
|
|
|
// Define this for devices with external power.
|
|
|
|
//#define LMIC_MCMD_DEVS_BATT_DEFAULT MCMD_DEVS_EXT_POWER
|