Hello,
hopefully somebody can give me a hint to move on, i’m struggling for days now to get downlink messages properly working.
Uplink works fine.
Downlink does not work for 90% of the messages.
I have a TTN Gateway and several “BSFrance LoRa32u4 II v1.2” devices.
I use the downlink section in the console to be sure that the message is queued.
I use the well known code part found in many examples. (OTAA)
case EV_TXCOMPLETE:
printf1("=============EV_TXCOMPLETE================\n");
if (LMIC.dataLen != 0) {
// data received in rx slot after tx
printf2("%X\n", LMIC.frame[LMIC.dataBeg]);
message.byte1 = LMIC.frame[LMIC.dataBeg];
handle_received_message();
}
else
{
printf1("--Nothing--\n");
}
Output:
5930448: engineUpdate, opmode=0x908
5931266: TXMODE, freq=868300000, len=15, SF=7, BW=125, CR=4/5, IH=0
5996920: RXMODE_SINGLE, freq=868300000, SF=7, BW=125, CR=4/5, IH=0
6058840: RXMODE_SINGLE, freq=869525000, SF=9, BW=125, CR=4/5, IH=0
6063388: processRx2DnData*****
6063472: [processRx2DnData]--Nothing--
6063580: processDnData*****
** Event received ** 10 [a403]
=============EV_TXCOMPLETE================
--Nothing--
6067031: engineUpdate, opmode=0x900
I defined the LMIC_DEBUG_LEVEL 1 in the limic library and also added some extra debugging in lmic.c.
The uplink message is send to TTN, but it seems that the downlink message is never received by the lmic library in the slot after tx.
In the TTN Console Gateway Traffic,I see that the downlink message is received. (see pictures).
I use: https://github.com/matthijskooijman/arduino-lmic
Can someone help?, thanks.
Tony