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
643 stars 210 forks source link

No EV_TXCOMPLETE event #695

Closed tbornon closed 3 years ago

tbornon commented 3 years ago

Describe the bug

No EV_TXCOMPLETE event is fired.

Environment

To Reproduce

Code can be found there : https://gist.github.com/tbornon/05a4429068546dba98ac0673ab69b4f3

Expected behavior

The EV_TXCOMPLETE should happen after a EV_TXSTART

Screenshots

Power draw

terrillmoore commented 3 years ago

TTN V3? You have to wait 5 seconds for TX complete. See discussion at https://github.com/mcci-catena/arduino-lmic/discussions/699.

tbornon commented 3 years ago

Hi @terrillmoore , Thanks for your answer. I've effectivly seen that TTN v3 is using a 5s RX delay but as you can see, my TXSTART is at 18,6ms and therefore the TXCOMPLETE should happend at around 23,6ms but it doesn't. Each time division is 5s so it means I've waited until 27ms without TXCOMPLETE event. It should have covered RX1 and RX2 windows. I even tried to wait for a few minutes with much more success.

tbornon commented 3 years ago

I ended up fixing the problem. It was a stupid mistake, I copied the pin mapping for the Feather 32u4 from the exemples provided without checking it. By default, Feather 32u4's pin 6 isn't connected to DIO1.

I proposed PR #703 to add a warning for the users