Hi TTN,
I’m new to TTN and have an issue that I see many have experienced before. Using the “standard” ttn-otaa.ino sketch from the MCCI LMIC examples on github, I can contact TTN with a join request, and sometimes the TTIG gateway registers the accept, but I haven’t seen the join accept actually being received by the end device.
The end device (on serial port) inevitably says “EV_JOIN_TXCOMPLETE: no JoinAccept”.
I have tried the solutions I could find on the forum (although for sure I’ve not read everything yet), but I’m at the point where I need some experienced hands to help me out.
Hardware:
LoraWAN node: custom PCB with Teensy-LC and RFM95W
Gateway: TTIG
SW:
Lora 0.8.0 by Sandeep Mistry (only for testing locally)
MCCI_LoRaWAN_LMIC_library version 4.0.0 (for TTN)
Code:
ttn-otaa.ino from MCCI LMIC library only changed for keys and pinning (all pins are wired explicitly, including RESET, DIO0, DIO1, DIO2 on RFM95W)
TTN settings:
MAC v1.02
PHY v1.02 rev B
Frequency plan Europe 863-870 (SF9 for RX2 - recommended)
Activation mode OTAA
Join settings:
I have not set any of the IDs and Labels here, only the APPKEY which was prefilled
Tests done:
- Changed bit order of keys: any other permutation of keys leads to a MIC mismatch error in the TTN console
- bidirectional communication using Lora 0.8.0 library between two local nodes → all works like a charm
I tried the following solution variants from other forum posts and github:
// LMIC.dn2Dr = SF9;
// LMIC_setClockError(MAX_CLOCK_ERROR * 10 / 100);
// LMIC_setClockError(MAX_CLOCK_ERROR * 2 / 100);
/*
LMIC_setupChannel(0, 868000000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); // g-band
LMIC_setupChannel(1, 868300000, DR_RANGE_MAP(DR_SF12, DR_SF7B), BAND_CENTI); // g-band
LMIC_setupChannel(2, 868500000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); // g-band
LMIC_setupChannel(3, 867100000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); // g-band
LMIC_setupChannel(4, 867300000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); // g-band
LMIC_setupChannel(5, 867500000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); // g-band
LMIC_setupChannel(6, 867700000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); // g-band
LMIC_setupChannel(7, 867900000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); // g-band
LMIC_setupChannel(8, 868800000, DR_RANGE_MAP(DR_FSK, DR_FSK), BAND_MILLI); // g2-band
*/
//LMIC_setLinkCheckMode(0);
//LMIC_selectSubBand(0);
//LMIC_setDrTxpow(DR_SF7,14);
//LMIC_setDrTxpow(DR_SF12,14);
and also tried the solutions found in these posts:
Readme from LMIC:
https://github.com/matthijskooijman/arduino-lmic
Forum entries tried:
https://www.thethingsnetwork.org/forum/t/what-is-the-difference-between-otaa-and-abp-devices/2723/17
https://www.thethingsnetwork.org/forum/t/how-often-should-a-node-do-an-otaa-join-and-is-otaa-better-than-abp/11192
https://www.thethingsnetwork.org/forum/t/lmic-node-one-example-to-rule-them-all/46964
https://www.thethingsnetwork.org/forum/t/lmic-lora-pkt-fwd-unable-to-receive-downlinks/16742/14
https://www.thethingsnetwork.org/forum/t/downlink-error-in-v3-ui-message-not-arriving-at-gateway-nor-device/46952/14
https://www.thethingsnetwork.org/forum/t/node-not-receiving-downlinks-from-ttig/49847/9
https://www.thethingsnetwork.org/forum/t/problem-with-multiple-otaa-join/22478
https://www.thethingsnetwork.org/forum/t/downlink-error-in-v3-ui-message-not-arriving-at-gateway-nor-device/46952/30
https://www.thethingsnetwork.org/forum/t/otaa-accept-not-received-when-in-reach-of-multiple-gateways/32074/33
https://www.thethingsnetwork.org/forum/t/no-downlink-observed-at-otaa-when-gtw-id-is-missing-in-uplink/31008
https://www.thethingsnetwork.org/forum/t/join-requests-receive-but-not-accept/34402
https://www.thethingsnetwork.org/forum/t/ttig-does-not-support-downlinks-when-not-frequently-receiving-uplinks/32052
https://www.thethingsnetwork.org/forum/t/join-not-accepted-by-node/34543
Typical TTN console output of live data from end device:
Typical gateway (TTIG) output on console:
The keys are all OK, everything seems fine for as far as I can tell.
TTIG serial logging of the same time period:
2021-08-05 19:22:02.195 [SYS:DEBU] Free Heap: 18944 (min=15464) wifi=5 mh=7 cups=8 tc=4
2021-08-05 19:22:07.199 [SYS:DEBU] Free Heap: 18944 (min=15464) wifi=5 mh=7 cups=8 tc=4
2021-08-05 19:22:10.577 [S2E:VERB] RX 868.1MHz DR4 SF8/BW125 snr=9.8 rssi=-95 xtime=0x6900022CEE1804 - jreq MHdr=00 JoinEui=4e69:59a3:96e4:2210 DevEui=86e4
2021-08-05 19:22:12.203 [SYS:DEBU] Free Heap: 18944 (min=15464) wifi=5 mh=7 cups=8 tc=4
2021-08-05 19:22:12.435 [S2E:DEBU] ::1 diid=64312 [ant#0] - next TX start ahead by 3s123ms
2021-08-05 19:22:15.538 [S2E:VERB] ::1 diid=64312 [ant#0] - starting TX in 19ms881us
INFO: tx_start_delay=1493 () - (0, bw_delay=, notch_delay=)
2021-08-05 19:22:15.566 [S2E:INFO] TX ::1 diid=64312 [ant#0] - dntxed: 868.1MHz 16.0dBm ant#0(0) DR4 SF8/BW125 frame=20949B454A3A2F38C891AAB4…4F7E5BD6
2021-08-05 19:22:15.692 [S2E:DEBU] Tx done diid=64312
2021-08-05 19:22:16.715 [SYN:VERB] Time sync rejected: quality=2074 threshold=1067
2021-08-05 19:22:17.206 [SYS:DEBU] Free Heap: 18944 (min=15464) wifi=5 mh=7 cups=8 tc=4
2021-08-05 19:22:18.819 [SYN:INFO] Time sync qualities: min=1044 q90=1066 max=2074 (previous q90=1067)
2021-08-05 19:22:22.210 [SYS:DEBU] Free Heap: 18944 (min=15464) wifi=5 mh=7 cups=8 tc=4
2021-08-05 19:22:27.214 [SYS:DEBU] Free Heap: 18944 (min=15464) wifi=5 mh=7 cups=8 tc=4
2021-08-05 19:22:31.431 [SYN:VERB] Time sync rejected: quality=1504 threshold=1066
Note that the TTIG reports time two hours earlier, these screenshots and logs are from the same join requests. Could that be a problem?
In my noob eyes all appears good until this point (except maybe the time sync failure). I don’t know what to do next to try and debug it.
Any suggestions? These are my best hypotheses:
- Maybe the end device RFM95W somehow isn’t switching from TX to RX. With Sandeep Mistry’s Lora library this hardware could send and receive. But the RFM95W doesn’t expose an explicit RXTX pin to force the switch, should LMIC do that under the hood?
- Somehow there is a timing problem and my understanding of the LoraWAN protocol isn’t good enough to pinpoint it.
In either case I don’t feel these hypotheses are too likely and I don’t know what else to try to figure this problem out.
Any help is greatly appreciated.
Best,
TUJP