Hi to everyone,
I have a question that maybe is not possible, but i would like to know.
I am using ESP32 (custom board) with RFM96W from HopeRF using the LMIC library, and they work good, but some times it happens that my node send a joinrequest and the gateway is so far that i receive the join request in the gateway (cause a use a good antenna) but i can not receive the join accept in my device, so it sais join failure, so the node tries again to do the join.
I always get the join-request messages in the gateway, but sometimes with some nodes it takes very long to receive the joining answer to continue with the uplink.
I would like to know if it is possible after some uplink without response in the node, to send the message and in this way get the information in TTN even when i cant’t get the join accept mensage on de end node.
Thank you very much,
Miguel
What connection do your gateway use - fiber, 4G or ?
With 4G I have seen the latency between the gateway and the TTN server is to high, then your node battles to join as the latency is to high. Or at least in our region this is the case sometimes.
But once the join have happened the node works fine.
No. The join response contains the DevAddr and information required to calculate the encryption session keys needed for uplinks.
However it seems you are looking at a more fundamental issue, your node needs to join just once and the information received at that time combined with the internal state of the LoRaWAN stack should be retained (possibly saved) on the node and be restored to be re-used for uplinks. You should not join every time you send data to TTN.
the think is that i put the esp32 in sleep mode, and it lose the information and needts to re-join, i have check on this forum and with esp32 people suffer also this problems losing the data
I am using fiber, but i don’t think this is my problem, when i am close to the gateway i dont have any problems to inmediately conect
They don’t suffer as such, they have just not coded it saving of the join info.
Which means you’ll lose any sensor data you’ve saved, so it’s better to code to save both join info & sensor data.
Re-joins on the new stack will eventually fail as you will run out of Nonces so you will have to do this at some point.
As @descartes mentions you have a limit on the number of joins a node can perform. Joining every uplink is not a viable solution. You need to invest effort in saving the state in NVRAM. If you search the forum you should find (a link to) code for that purpose as someone already implemented it (for LMIC). The other solution is to use a microcontroller that is less forgetful in sleep mode. Most ARM controllers retain RAM content in low power sleep. (Some STM controllers drop to 4 micro ampere and still retain RAM. Microchip has devices that retain RAM contents at 800 nana ampere)
@kersing @descartes Thanks, i will search this piece of code to solve my problems and avoid to make that soo much join request.