mcci-catena / arduino-lmic

LoraWAN-MAC-in-C library, adapted to run under the Arduino environment
https://forum.mcci.io/c/device-software/arduino-lmic/
MIT License
629 stars 207 forks source link

EV_JOIN_TXCOMPLETE: no JoinAccept with TTGO-LoRa 2.1.6 #666

Open AlexandreMouyen opened 3 years ago

AlexandreMouyen commented 3 years ago

Hello there,

I am currently using a TTGO LoRa 2.16 in order to connect to the The Things Network. I replaced all the fields on the example sketch (ttn-otaa) from my TTN console. It has already been two days that I try, I every time have the "EV_JOIN_TXCOMPLETE: no JoinAccept" message.

There are my pins configuration: const lmic_pinmap lmic_pins = { .nss = 18, .rxtx = LMIC_UNUSED_PIN, .rst = 14, .dio = {26, 33, 32}, };

I am also using the CFG_eu868 config.

Can someone help me? Did I miss something?

haflinger commented 3 years ago

Hello,

Same issue here.

I use : const lmic_pinmap lmic_pins = { .nss = 18, .rxtx = LMIC_UNUSED_PIN, .rst = 23, .dio = {/*dio0*/ 26, /*dio1*/ 33, /*dio2*/ 32}, };

It works with ABP activation method but with OTAA i have EV_JOIN_TXCOMPLETE: no JoinAccept

RXMODE_RSSI
316058: engineUpdate, opmode=0x8
Packet queued
316081: EV_JOINING
316085: engineUpdate, opmode=0xc
603071: engineUpdate, opmode=0xc
603088: EV_TXSTART
603158: TXMODE, freq=868500000, len=23, SF=7, BW=125, CR=4/5, IH=0
918773: setupRx1 txrxFlags 00 --> 01
start single rx: now-rxtime: 4
919405: RXMODE_SINGLE, freq=868500000, SF=7, BW=125, CR=4/5, IH=0
rxtimeout: entry: 919933 rxtime: 919398 entry-rxtime: 535 now-entry: 4 rxtime-txend: 312375
981273: setupRx2 txrxFlags 0x1 --> 02
start single rx: now-rxtime: 4
981904: RXMODE_SINGLE, freq=869525000, SF=12, BW=125, CR=4/5, IH=0
rxtimeout: entry: 996257 rxtime: 981898 entry-rxtime: 14359 now-entry: 4 rxtime-txend: 374875
996274: processRx2Jacc txrxFlags 0x2 --> 00
996328: EV_JOIN_TXCOMPLETE: no JoinAccept
996562: engineUpdate, opmode=0xc
4660999: engineUpdate, opmode=0xc
4661014: EV_TXSTART
4661081: TXMODE, freq=868100000, len=23, SF=7, BW=125, CR=4/5, IH=0
4976695: setupRx1 txrxFlags 00 --> 01
start single rx: now-rxtime: 4
4977327: RXMODE_SINGLE, freq=868100000, SF=7, BW=125, CR=4/5, IH=0
rxtimeout: entry: 4977855 rxtime: 4977320 entry-rxtime: 535 now-entry: 4 rxtime-txend: 312375
5039195: setupRx2 txrxFlags 0x1 --> 02
start single rx: now-rxtime: 4
5039827: RXMODE_SINGLE, freq=869525000, SF=12, BW=125, CR=4/5, IH=0
rxtimeout: entry: 5054179 rxtime: 5039820 entry-rxtime: 14359 now-entry: 5 rxtime-txend: 374875
5054197: processRx2Jacc txrxFlags 0x2 --> 00
5054267: EV_JOIN_TXCOMPLETE: no JoinAccept
5054506: engineUpdate, opmode=0xc

Schema : https://github.com/LilyGO/TTGO-LoRa32-V2.1/blob/master/T3.jpg

terrillmoore commented 3 years ago

Hi @haflinger, we cannot use debug prints in the LMIC. Seriously. It disturbs timing to the point that you can't do downlinks. I have not taken them out becaue they're useful for debuggigng logic. But they are useless if the LMIC is not running on your platform because of timing events. This is not (even in theory) possible to fix, unless your debug print is infinitely fast and never blocks. The formatting from printf is not infinitely fast, and prints on Arduino always are blocking.

This is why I added the debug log functionality. I'm familiar with this from other protocols

I left debug prints in the code because I wanted to minimize the deviation from the original; but they're not useful unless the LMIC is crashing. Please turn them off when trying to debug downlink problems.

Thanks, --Terry

arangu97 commented 3 years ago

Hello, I am also using that board with the OTAA example and the following lines are printed in the Serial Monitor:

Packet queued 4804: EV_JOINING 96155: Unknown event 17

The Activation message appears in TTN : image

However it seem like the LoRa device is not getting the JOIN ACCEPT, an unknown event instead.

What could be happening?

Thank you

robputt commented 3 years ago

Hello,

I am using a TTGO T-Beam, so similar setup ESP32 and SX1276. I am also having issues with OTAA you can see my debug output here - https://www.thethingsnetwork.org/forum/t/otaa-v3-acting-weird/46394/6

Best Regards,

Rob

cyberman54 commented 3 years ago

Are you using full LoRaWAN compliant 8ch gateways? Otherwise OTAA can't work. See https://github.com/mcci-catena/arduino-lmic/issues/689

robputt commented 3 years ago

@cyberman54 - Sure am

JoeRu commented 3 years ago

I do see the joining request on my gateway - but an answer applies very late; Actually im using TTNv3 for testing. So maybe its about the anwer time.