Packet REJECTED (jit error=2) on Join Response

Hello,

I try to develop my own network server. I use Semtech Packet Forwarder on gateway. I receive messages from gateway via UDP, process them then return response.

I tested my network server yesterday and end device activated successfully. The packet logs is below

JSON up: {“rxpk”:[{“tmst”:30915763,“chan”:0,“rfch”:1,“freq”:868.100000,“stat”:1,“modu”:“LORA”,“datr”:“SF7BW125”,“codr”:“4/5”,“lsnr”:10.5,“rssi”:-65,“size”:23,“data”:“AEDaAdB+1bNworF3OF/UwQA4XrTLMrE=”}]}
INFO: [up] PUSH_ACK received in 14 ms
INFO:[down] PULL_RESP received - token[221:217]
JSON down: {“txpk”:{“imme”:false,“rfch”:0,“powe”:14,“ant”:0,“brd”:0,“tmst”:35915763,“freq”:868.1,“modu”:“LORA”,“datr”:“SF7BW125”,“codr”:“4/5”,“ipol”:true,“size”:33,“data”:“IAk1vCBIp9YdCyWRlQX+GoiVtUKp1ng9nrb+hz0/QKyP”}}

Today I restarted all system devices (gateway, network server and end-device) and I got this error during OTAA.

JSON up: {“rxpk”:[{“tmst”:15806531,“chan”:2,“rfch”:1,“freq”:868.500000,“stat”:1,“modu”:“LORA”,“datr”:“SF7BW125”,“codr”:“4/5”,“lsnr”:8.8,“rssi”:-69,“size”:23,“data”:“AEDaAdB+1bNworF3OF/UwQDStXYnUMs=”}]}
INFO: [up] PUSH_ACK received in 6 ms
INFO: [down] PULL_ACK received in 10 ms
INFO: [down] PULL_RESP received - token[109:55]
JSON down: {“txpk”:{“imme”:false,“tmst”:20806531,“freq”:868.5,“rfch”:0,“powe”:14,“modu”:“LORA”,“datr”:“SF7BW125”,“codr”:“4/5”,“fdev”:0.0,“ipol”:true,“prea”:0,“size”:33,“data”:“IBMVtH/Dz63YHiqdCqEuToB/4Zc/ryH2hlr8gO7VKxXs”,“ncrc”:true}}
src/jitqueue.c:251:jit_enqueue(): ERROR: Packet REJECTED, timestamp seems wrong, too much in advance (current=22870252, packet=20806531, type=0)
ERROR: Packet REJECTED (jit error=2)

For now, I get tmst value from end-device with rxpk package and add 5000000 to this value then I send (tmst+5000000) to end-device. I get this error and end-device didn’t connect to network server yet.

P.S. 1 : LoraWan 1.0.2 used
P.S. 2 : Gateway module doesn’t have GPS

this is not related to TTN

Indeed, this is off topic, you’ve taken on a huge project that cannot really be supported here, as this forum is about TTN and thus using TTN’s existing network servers.

You seem to be scheduling a reply that is so late (~2 seconds in the past) that it would only be hit once the 32-bit counter rolls over in about 71 minutes.

Make sure you aren’t processing stale uplink data, and that you don’t have excessive latency in getting your replies back to the gateway. Since this is being rejected, it’s likely that the error is survivable and that the next timely reply you attempt will work.