I got some sx1276 modules and I’m trying to make them connect to TTN with a RP2040 using this library, lorawan-for-pico which is a porting of LoRaMAC-node for the Raspberry Pi Pico.
When I use the example code for OTAA activation, I get the following repeated logs from the serial output:
###### =========== MLME-Confirm ============ ######
STATUS : Rx 2 timeout
###### =========== MLME-Request ============ ######
###### MLME_JOIN ######
###### ===================================== ######
STATUS : OK
So I take it, that the node keeps trying to send a join request, but never gets a response from the gateway?
Looking at the gateway logs and the node logs I can see the join requests show up:
Hi, I have searched the forum extensively, but with no success. I have tried generating a new app key and even creating a whole new end device in the console, but I still get the same issue. I also tried in both little endian and big endian formats (not just for the app key, but also the joineui and deveui in different combinations).
When trying to decode the payload from the gateway in the lora packet decoder, it tells me that the MIC is invalid, but that’s not really news to me.
I’m not as familiar with LMIC but yes I believe so.
Yes, I have a 8-12dB antenna connected . In the console logs, I see uplink messages every few hours from other people’s devices in the area. I’ll try with the little swivel antenna that came with the gateway though, just to make sure.
I tested with the small antenna but still no luck. I also drove to another gateway in my area that I saw come up on the map recently, but I couldn’t connect through that one either.
Not clear if this means more MIC mismatches or some other failure mode, if you could clarify then I may be able to find some other people with other perspectives on this.
The MIC mismatch means the payload wasn’t able to be verified so no Join Accept is issued so nothing for the device to hear as a request.
Talking to my colleague about this I remembered that in LMn there are effectively two keys, both in the same place, AppKey and NwkKey, you need to make both of them the same for LW v1.0.x. I never got in to the why and my provisioning isn’t hard coded anymore so it was a distant memory.
PS: That honking great antenna is still off-limits - may well exceed permissible transmission power as well as skewing the reception & overpowering the RFM
It looks like in Sandeep’s porting of LMn, both the APP_KEY and NWK_KEY are already passed LoRaMacMibSetRequestConfirm(), which seems to eventually set the secure element keys defined in the file you linked.
As for the antenna, I’ll be sure to use the little one for now while I develop my devices and check up on regulations . I bought it because I my goal is to work with local winemakers to create soil/weather monitoring systems for vineyards for my year 12 project. There is not much TTN coverage in my area and these vineyards span quite a long distance.