given your code seems to look generic how are you restricting your device frequency to match your single channel gateway?
I am using the tftelkamp/single_chan_pkt_fwd library for the gateway. And if downlinks are essential for OTAA to work then that explains it, because it is quite clear in the Read.me file that downlinks are not yet supported.
So, taking this into consideration, could you please suggest me another library for a simple Raspberry Pi single channel gateway?
Also, where could I read more details on how ABP and OTAA work under the hood?
Thank you for the answer! Well, I am not sure if that is enough, but I am doing the following.
Is there anything else I should pay attention to?
In gateway:
// Set spreading factor (SF7 - SF12)
sf_t sf = SF7;
// Set center frequency
uint32_t freq = 868100000; // in Mhz! (868.1)
In node (at least in the ABP version):
LMIC_setupChannel(0, 868100000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); // g-band
// While keeping the rest of frequencies commented out.
Check out this thread :Can LMIC 1.6 be set up to use a single channel and SF?
The issue at the end of the day is that none of these libraries have been written with single channel gateways in mind, fighting against the tide
I would fall back to https://github.com/matthijskooijman/arduino-lmic library first and prove the ABP code is doing what 100% it should, check uploads, downloads, acknowledgments etc, then turn to the OTAA example code (not the same as ABP) - check out the examples. Be careful you are starting from the example code supplied from its library too.
MCCI lmic library seems to extend some functionality - but I would not use first, this library caught me out on the config file for a day or so, it seems to work fine now - default is set to USA frequencies etc.
Check this fork of the single channel software, with the mods described here. Not necessarily you solve everything, but at least downlinks are supported. And receiving downlinks could also be problematic on the node (some slow platform need clock error relaxation).