Some problems with LMIC - OTAA

I’ve been searching the web for a solution for a few days but can’t find anything and hope someone here can help me.
I use ESP8266 + SX1278 (SPI, DIO0, DIO1)
Arduino IDE 1.18.12, ESP8266 NodeMCU 0.9
MCCI Arduino LoRaWAN Library 0.9.1
MCCI LoRaWAN LMIC library 4.1.1

According to the map, two “blue” TTN gateways are each about 1km away as the crow flies (I don’t have one of my own)

The OTAA sample is compiled from the LIB.

#define CFG_eu868 1
#define CFG_sx1276_radio 1.

DEVEUI and APPKEY are created (APPEUI is 8 x 0x00)

Network Layer: "Europe 863-870 (SF9 for RX2)
LoRaWAN Version V1.0.2 - PHY V1.0.2 REV A oder
LoRaWAN Version V1.0.2 - PHY V1.0.2 REV B oder
LoRaWAN Version V1.0.3 … probiert (egal, ohne Auswirkung)

The ESP generates the following log:

22:35:56.388 → Starting
22:35:56.413 → RXMODE_RSSI
22:35:56.447 → 5353: engineUpdate, opmode=0x8
22:35:56.447 → Packet queued
22:35:56.447 → 5395: EV_JOINING
22:35:56.447 → 5400: engineUpdate, opmode=0xc
22:35:57.016 → 42929: engineUpdate, opmode=0xc
22:35:57.054 → 42996: EV_TXSTART
22:35:57.054 → 43074: TXMODE, freq=868100000, len=23, SF=7, BW=125, CR=4/5, IH=0

In the TTN, only the two events are “fired”:

Acccept join-request
Forward join-request

That’s it. Nothing else happens.
And now? What am I doing wrong?

If I restart the ESP via reset, the frequency of the TXMODE changes.

Best regards

  • Rene
1 Like

Hi Rene,

I had a similar problem and have managed to solve it somewhat.
When I setup the channels in the LMIC library and configure those channels in TTN as well as set the desired Rx1 Delay to 1 second i can succesfully join the network.

My channels are configured in LMIC using the following code:

    LMIC_setupChannel(0, 868100000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI);  // g-band
    LMIC_setupChannel(1, 868300000, DR_RANGE_MAP(DR_SF12, DR_SF7B), BAND_CENTI); // g-band
    LMIC_setupChannel(2, 868500000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI);  // g-band
    LMIC_setupChannel(3, 867100000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI);  // g-band
    LMIC_setupChannel(4, 867300000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI);  // g-band
    LMIC_setupChannel(5, 867500000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI);  // g-band
    LMIC_setupChannel(6, 867700000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI);  // g-band
    LMIC_setupChannel(7, 867900000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI);  // g-band

And the configuration of my device in TTNv3 looks like this:

It seems the problem was both the channels and the Rx1 Delay. Unfortunately I have not yet found out how to set the LMIC library to use the recommended Rx1 delay of 5 seconds. I’ll post here if i know more.

Kind regards,


1 Like

Unfortunately, there’s no API to set the RX window. You currently have to manually set LMIC.rxDelay to the desired RX1 time, in seconds, same place you set channels. There may be an API in a future version.