Ok, so I found where to enable debug logging, you have to uncomment this line in lmic/config.h:
#define LMIC_PRINTF_TO Serial
Then my output is:
Starting
RXMODE_RSSI
4179: engineUpdate, opmode=0x8
Packet queued
4211: EV_JOINING
4215: engineUpdate, opmode=0xc
502452: engineUpdate, opmode=0xc
502473: EV_TXSTART
502538: TXMODE, freq=868300000, len=23, SF=7, BW=125, CR=4/5, IH=0
812635: setupRx1 txrxFlags 00 --> 01
start single rx: now-rxtime: 3
812765: RXMODE_SINGLE, freq=868300000, SF=7, BW=125, CR=4/5, IH=0
rxtimeout: entry: 825582 rxtime: 812759 entry-rxtime: 12823 now-entry: 4 rxtime-txend: 306356
877182: setupRx2 txrxFlags 0x1 --> 02
start single rx: now-rxtime: 4
877313: RXMODE_SINGLE, freq=869525000, SF=12, BW=125, CR=4/5, IH=0
rxtimeout: entry: 901906 rxtime: 877307 entry-rxtime: 24599 now-entry: 5 rxtime-txend: 370904
901927: processRx2Jacc txrxFlags 0x2 --> 00
902533: Unknown event: 20
904291: engineUpdate, opmode=0xc
Frequencies seems right, is the now-rx time normal ? (very small compared to other numbers)
I added this line in the setup but not very helpful:
LMIC_reset();
LMIC_setClockError(MAX_CLOCK_ERROR * 2 / 100); // <-----
Regarding the GW, the setup is in the right frequencies:
10.04.19 09:49:16 (+0200) main 07:49:16 INFO: radio 0 enabled (type SX1257), center frequency 867500000, RSSI offset -166.000000, tx enabled 1
10.04.19 09:49:16 (+0200) main 07:49:16 INFO: radio 1 enabled (type SX1257), center frequency 868500000, RSSI offset -166.000000, tx enabled 0
I also set the env variable GW_LOGGER to true, now I see those lines:
10.04.19 09:44:04 (+0200) main 07:44:04 INFO: [stats] received packet with bad CRC from mote: 9151CDC9 (fcnt=24032)
10.04.19 09:44:26 (+0200) main 07:44:26 INFO: [stats] received packet with valid CRC from mote: 7ED5B370 (fcnt=42753)
10.04.19 09:44:26 (+0200) main 07:44:26 INFO: [up] TTN lora packet send to server "bridge.eu.thethings.network"
But on TTN console, the GW traffic is empty Yesterday it did show some messages received (not from my device) so I though it was working fine.
Stupid question: we can see 8 chars long IDs in the log (7ED5B370 for example), what is it ? Node EUIs are on 16 chars
EDIT:
I found what was the Unknown event, the EV_JOIN_TXCOMPLETE wasn’t in the switch case, so now I have:
77082: EV_TXSTART
77146: TXMODE, freq=868500000, len=23, SF=7, BW=125, CR=4/5, IH=0
387243: setupRx1 txrxFlags 00 --> 01
start single rx: now-rxtime: 4
387373: RXMODE_SINGLE, freq=868500000, SF=7, BW=125, CR=4/5, IH=0
rxtimeout: entry: 400190 rxtime: 387367 entry-rxtime: 12823 now-entry: 4 rxtime-txend: 306356
451790: setupRx2 txrxFlags 0x1 --> 02
start single rx: now-rxtime: 3
451921: RXMODE_SINGLE, freq=869525000, SF=12, BW=125, CR=4/5, IH=0
rxtimeout: entry: 476514 rxtime: 451915 entry-rxtime: 24599 now-entry: 4 rxtime-txend: 370904
476534: processRx2Jacc txrxFlags 0x2 --> 00
477140: EV_JOIN_TXCOMPLETE
478963: engineUpdate, opmode=0xc
But still no EV_JOINED event