Replies: 4 comments 13 replies
-
Have you got the IQ polarity configured correctly? Edit: sorry, stupid question. If you've ported LoRaMac-node, it will be setting the IQ polarity correctly already. I'd double check the encryption keys are right first. And check that the actual received bytes in the JoinAccept look sane. I think they're sent unencrypted, with just that CMAC check that you linked protecting them. So if the bytes other than the CMAC look sane, it will be an encryption issue. |
Beta Was this translation helpful? Give feedback.
-
Hi, and thank you so much for answering so quickly! I confirm I'm using the driver for the sx1262 provided by LoRaMac-node, which seems to configures the IQ polarity properly. Regarding the encryption keys, the TTN console allows me to specify a device EUI, 'AppKey' and 'NwkKey'. I ensured that the device EUI, the AppKey and the NwkKey from the TTN console correspond to the one specified in se-identity.h. The byte order seems to be correct, as TTN would report a "MIC mismatch" error when I revert them. I left all the other keys (J_S_INT_KEY, J_S_ENC_KEY, F_NWK_S_INT_KEY and many others) from this file to their default value. I added a few debug logs to check the data sent and received. Here is the result :
I've just noticed that the first time it attempts to join the network, the function I don't know how to check that the data sent and received are sane. Could you link me to resources so I can learn to understand the content of the packets? Thanks again for your help 👍 |
Beta Was this translation helpful? Give feedback.
-
If you are concerned about timing accuracy for the RX window, set the This is the safest way to handle timing inaccuracies without potentially breaking code changes. |
Beta Was this translation helpful? Give feedback.
-
Also, have you gotten loramac node and your new credentials working on one of the project's supported boards? It will allow you to narrow down your problems. |
Beta Was this translation helpful? Give feedback.
-
Hello!
I'm currently trying to port LoRaMac to the Pine64 PineDio LoRa USB adapter. This is basically a board with a SX1262 and a CH341 USB to SPI converter.
So I implemented the RTC, SPI, GPIO,... porting layers and adapted them to the desktop PC environment. Now, I'm trying to run the LoRaMac "periodic-uplink-lpp" demo application. I'm using the TTN network.
I reached a point where my code sends the join-request message, TTN receives it and accepts it and forward the join-accept message to the gateway:
However, my application have big troubles to receive those messages : most of the time, nothing is received and sometimes, it receives a message but fails at decoding it (This check in soft-se.c fails).
I checked with my SDR device : I can see the messages sent by my USB board and the one sent by the gateway. So, the join-accept message is sent by the GW but my USB board fails to receive it properly.
As most of RX errors seem to be caused by incorrect timing for RX1/RX2 windows, I changed the code so that the SX1262 would go into RX mode indefinitely as soon as TX Done is triggered. This way, I'm pretty sure the module is listening when the gateway sends the join-accept message, with no more luck, unfortunately.
So now, I'm looking for help : do you have any idea why RX does not work properly? Is there anything I can do to debug this issue?
Thanks !
Beta Was this translation helpful? Give feedback.
All reactions