-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Join request is sent by node to chirpstack server and a join accept is sent back from server to node, but the node still sends another join request. #201
Comments
Hello @mirhamza708 This library has a built-in timeout for receiving the join accept message, and if the join accept is delayed or not properly acknowledged within this window, the node may continue sending join requests until it finally receives and processes the join accept. Ensure there is minimal delay in the communication between the ChirpStack server and your gateway. Sometimes network or processing delays can cause the join accept message to reach the node outside the expected window. Regarding the "Validate devnonce error" in the ChirpStack server, this error typically occurs when the device's devnonce has already been used or is invalid. If the same devnonce is sent by the node multiple times (likely due to repeated join requests), ChirpStack will reject it to prevent replay attacks. Make sure that the node device properly increments the devnonce with each join request. Kind Regards! |
Thank you for the reply eric, I tried to increase the timeout in the library from 6000ms to 30000ms but that didn't help either. Also I have some questions for the devnonce increment. Do i have to increment the devnonce for each join request even if the reason was timeout for last join request? And can we have the devnonce increment feature inside the library so the user of library does not have to worry about keeping track of the devnonce? |
Added delay before checking for timeout has resolved my issue of repeated join for now, will have to test a little bit more to be sure that it's the main reason of repeated join requests. As for the devnonce increment I am doing this:
one suggestion/feature request for the library, can we have a structure to be passed to the lora.join() so that we can pass the joining information. This will help if user want to store and pass the parameters again after resets. |
Hello @mirhamza708 Great to hear that adding the delay has helped resolve the repeated join request issue so far! As for your suggestion about passing a structure to lora.join(), that’s a great idea! Having a way to pass joining parameters after resets would indeed be useful for devices that need to retain state between power cycles or recover after an unexpected reset. This could be particularly valuable in scenarios where consistent device behavior and reduced network overhead are critical. In the meantime, if you have any further questions or additional feature requests, feel free to share! Kind regards! |
where are you adding these codes, which class? |
Keeping track of devnonce should be done in your application main.cpp file. There are no classes in the library I guess. These are C type functions in Loramac.cpp file and the RFM95.cpp file. |
i changed the library and source code with your code but problem is, first connects but if i made reset, stops retrying connect and devnonce problem still acquire, kindly can you share the library to [email protected] thanks alot! |
Issue
The node device sends a join request and is accepted by the chirpstack server but the node device does not stop sending a join request. This is repeated a few times and then finally the node device prints "joined". Is this because of the timeout in the library for the join accept?
Also some time I get the Validate devnonce error in chirpstack server, what does that mean and how to resolve that?
Thank you
Hamza
The text was updated successfully, but these errors were encountered: