Closed Spomky closed 5 years ago
Wrong pin mapping.
change
.dio = {26, 34, 35},
to
.dio = {26, 35, 34},
…no effect…. The activation packets are still there, but no payload is received. The console displays:
Starting
Packet queued
2968: EV_JOINING
328911: EV_TXSTART
4691684: EV_TXSTART
9025098: EV_TXSTART
14003346: EV_TXSTART
Then check if you have a Heltec V2 board, or if it's a V1 (which has other pin mapping). Or do you perhaps use a single channel gateway (e.g. Dragino)? This won't work with OTAA. This sure won't be an issue of this library, since i am using this code on different Heltec boards, and all work.
I am sure it is a v2. It is clearly written on the board. With the v1 pin mapping nothing works. With the v2 pin mapping it works fine with ABP but not with OTAA. So no doubt for the version of the board.
The gateway is a brand new TTIG so 8 channels.
Do you think it may come from the project_config/lmic_project_config.h
file?
#define CFG_eu868 1
#define CFG_sx1276_radio 1
#define LMIC_USE_INTERRUPTS //Tried with and without this line
Don't use interrupts as long as you have not the current version of this library. The function was broken for ESP32 in the past.
Unfortunately, nothing changes with and without the interrupts
That’s great thank you!
I added the line LMIC_setClockError(10 * MAX_CLOCK_ERROR / 100);
after LMIC_reset();
and it works fine now.
I am not sure to clearly understand what’s the behaviour of this function but it solves the issue. Thank you so much. Would you like I create a PR in the doc to mention that for this board?
This is a workaround. Your application is likely causing timing problems breaking the lmic timing. This is usually not a hardware / board specific problem.
Well… I just opened the ttn-otaa
example, changed the PIN mapping, app eui, dev eui and app key values.
Nothing more, nothing less.
Yes, but using a Heltec board means you're obviously using ESP32-arduino framework, thus running LMIC on top of freeRTOS, while the LMIC library is intended to run on single core systems without RTOS. So timing can be different.
Hi,
The example using ABP works fine on a Heltec Lora v2 and packets are correctly received on my TTN console. When using it with OTAA, I can see activation packets that indicate the node is correctly registered, but the
EV_JOINED
is never triggered and thus no payload is sent.Note: for information, the working PIN map I use for the Heltec Lora v2 is the following one: