Uplink frame counter limit

Hi guys, I’m testing the LoRa Server for six months now. We are just using some nodes with temperature and humidity data. But, something happens when the uplink frame counter is 65535 the device stop working, so we delete the device on lora server and add a new one with the same config. Then its working again but again when its uplink frame counter to 65535 its stop working …Its a uplink counter limit? We are trying to find the reason on the code. But if someone has passed for the same problem, please help us! TKS!

In what mode you have activated your device ? ABP or OTA?

The end device must rejoin the network on a counter rollover to prevent reuse of the key/counter combination. Using a 16 bit only counter means that the device would have to rejoin every 65535 frames.

We are using ABP, thank you for helping us!

Is there an automatic way to do the rejoin? Where do I do this (in the loraserver or in the node’s firmware)?

have you gone through this?