I am working with an ESP32 and an RFM95W module. The library I use for communication is the latest version of LMIC (https://github.com/mcci-catena/arduino-lmic). Uplink and downlink communication works for ABP and OTAA activation without deep sleep mode.
To work with the deep sleep mode, I have saved the frame sequence counters (LMIC.seqnoUp and LLMIC.seqnoDn) in the RTC memory. It works for uplink but doesn’t receive the downlink message. Must I save any other parameter in RTC memory?
When you say it does not receive the downlink, are you remembering that downlinks come only in response to uplinks?
If your system wakes up, and then sends an uplink which is received by the network, and triggers a downlink reply, that should be receivable. Start by seeing if the radio actually activates for the receive window a second after the uplink (on the correct frequency for the downlink which was sent), if a packet is received, and if decoding succeeds or does not.
I am trying to make it work with ABP but later I would like it works with OTAA as well. But for now it is enough if I receive downlink messages with ABP.
In addition, I am implementing LoRaWAN class A, so I check if I received downlink messages after sending an uplink correctly. With the LMIC library, this means that I check the downlink message in the TX_COMPLETE event.
I have introduced a delay of 1 second (as you recommend) after the os_runlooponce() function but it still does not receive the message on ESP32.
Next, I attach a capture on the gateway (where it seems that the downlink message is received correctly) and the debug messages of the code (where it is not received):
We can see in the image that the message of 17 bytes is well received.
Doing that is absurd and would break everything. You cannot introduce any delay during the time between an uplink and the corresponding downlink windows.
Nor does your debug output yet give any indication that it has ever operated the radio in receive mode at all, let alone with the correct settings at the correct time.