LMIC timings changed to avoid JOIN WAIT issue
This commit is contained in:
parent
27b3e88c3c
commit
c58971a2c6
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
// use interrupts only if LORA_IRQ and LORA_DIO are connected to interrupt
|
// use interrupts only if LORA_IRQ and LORA_DIO are connected to interrupt
|
||||||
// capable GPIO pins on your board, if not disable interrupts
|
// capable GPIO pins on your board, if not disable interrupts
|
||||||
#define LMIC_USE_INTERRUPTS 1
|
//#define LMIC_USE_INTERRUPTS 1
|
||||||
|
|
||||||
// time sync via LoRaWAN network, note: not supported by TTNv2
|
// time sync via LoRaWAN network, note: not supported by TTNv2
|
||||||
// #define LMIC_ENABLE_DeviceTimeReq 1
|
// #define LMIC_ENABLE_DeviceTimeReq 1
|
||||||
@ -28,7 +28,7 @@
|
|||||||
// so consuming more power. You may sharpen (reduce) this value if you are
|
// so consuming more power. You may sharpen (reduce) this value if you are
|
||||||
// limited on battery.
|
// limited on battery.
|
||||||
// ATTN: VALUES > 7 WILL CAUSE RECEPTION AND JOIN PROBLEMS WITH HIGH SF RATES
|
// ATTN: VALUES > 7 WILL CAUSE RECEPTION AND JOIN PROBLEMS WITH HIGH SF RATES
|
||||||
//#define CLOCK_ERROR_PROCENTAGE 7
|
#define CLOCK_ERROR_PROCENTAGE 7
|
||||||
|
|
||||||
// Set this to 1 to enable some basic debug output (using printf) about
|
// Set this to 1 to enable some basic debug output (using printf) about
|
||||||
// RF settings used during transmission and reception. Set to 2 to
|
// RF settings used during transmission and reception. Set to 2 to
|
||||||
|
@ -485,19 +485,8 @@ void lmictask(void *pvParameters) {
|
|||||||
os_init(); // initialize lmic run-time environment
|
os_init(); // initialize lmic run-time environment
|
||||||
LMIC_reset(); // initialize lmic MAC
|
LMIC_reset(); // initialize lmic MAC
|
||||||
|
|
||||||
#if defined(CFG_eu868)
|
// pre-join settings
|
||||||
// Note that The Things Network uses the non-standard SF9BW125 data rate for
|
LMIC_setDrTxpow(assertDR(LORADRDEFAULT), LORATXPOWDEFAULT);
|
||||||
// RX2 in Europe and switches between RX1 and RX2 based on network congestion.
|
|
||||||
// Thus, to avoid occasionally join failures, we set datarate to SF9 and
|
|
||||||
// bypass the LORAWAN spec-compliant RX2 == SF12 setting
|
|
||||||
LMIC_setDrTxpow(EU868_DR_SF9, KEEP_TXPOW);
|
|
||||||
#else
|
|
||||||
// Set the data rate to Spreading Factor 7. This is the fastest supported
|
|
||||||
// rate for 125 kHz channels, and it minimizes air time and battery power.
|
|
||||||
// Set the transmission power to 14 dBi (25 mW).
|
|
||||||
LMIC_setDrTxpow(DR_SF7, 14);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
LMIC_setLinkCheckMode(0);
|
LMIC_setLinkCheckMode(0);
|
||||||
|
|
||||||
// This tells LMIC to make the receive windows bigger, in case your clock is
|
// This tells LMIC to make the receive windows bigger, in case your clock is
|
||||||
@ -508,7 +497,6 @@ void lmictask(void *pvParameters) {
|
|||||||
LMIC_setClockError(MAX_CLOCK_ERROR * CLOCK_ERROR_PROCENTAGE / 100);
|
LMIC_setClockError(MAX_CLOCK_ERROR * CLOCK_ERROR_PROCENTAGE / 100);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#if defined(CFG_US915) || defined(CFG_au921)
|
|
||||||
#if CFG_LMIC_US_like
|
#if CFG_LMIC_US_like
|
||||||
// in the US, with TTN, it saves join time if we start on subband 1
|
// in the US, with TTN, it saves join time if we start on subband 1
|
||||||
// (channels 8-15). This will get overridden after the join by parameters
|
// (channels 8-15). This will get overridden after the join by parameters
|
||||||
|
@ -47,8 +47,8 @@
|
|||||||
#define MEM_LOW 2048 // [Bytes] low memory threshold triggering a send cycle
|
#define MEM_LOW 2048 // [Bytes] low memory threshold triggering a send cycle
|
||||||
#define RETRANSMIT_RCMD 5 // [seconds] wait time before retransmitting rcommand results
|
#define RETRANSMIT_RCMD 5 // [seconds] wait time before retransmitting rcommand results
|
||||||
#define PAYLOAD_BUFFER_SIZE 51 // maximum size of payload block per transmit
|
#define PAYLOAD_BUFFER_SIZE 51 // maximum size of payload block per transmit
|
||||||
#define LORADRDEFAULT 5 // 0 .. 15, LoRaWAN datarate, according to regional LoRaWAN specs [default = 5]
|
#define LORADRDEFAULT 3 // 0 .. 15, LoRaWAN datarate, according to regional LoRaWAN specs [use 3 for TTN in EU]
|
||||||
#define LORATXPOWDEFAULT 7 // 0 .. 255, LoRaWAN TX power in dBm [default = 14]
|
#define LORATXPOWDEFAULT 14 // 0 .. 255, LoRaWAN TX power in dBm [default = 14]
|
||||||
#define MAXLORARETRY 500 // maximum count of TX retries if LoRa busy
|
#define MAXLORARETRY 500 // maximum count of TX retries if LoRa busy
|
||||||
#define SEND_QUEUE_SIZE 10 // maximum number of messages in payload send queue [1 = no queue]
|
#define SEND_QUEUE_SIZE 10 // maximum number of messages in payload send queue [1 = no queue]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user