OTAA join failed but ABP succeeds on LoRaGo Port + Rpi

I was using Aruino + Lora Shield to communicate with LoRaGo Port + Rpi gateway. The loraserver is also installed on the same Rpi. Arduino is running lmic sample code for both ABP and OTAA. The frequency is US_915MHz with LMIC_selectSubBand(0). While ABP mode succeeds, OTAA shows EV_JOIN_FAILED. Although the latter did assign device address, network session key and application session key and Live Frame Logs showed uplink and downlink traffic, there was no event of EV_JOINED. MQTT message shows the following:

application/1/node/<nodeID>/join {"applicationID":"1","applicationName":"app-name","deviceName":"Dev-Name-OTAA","devEUI":"xxxxxxxxxxxxxxxxxx","devAddr":"01020304"}

Anyone sees similar issue? BTW, how does OTAA to know which subband to use? Does it scan entire spectrum?

-Ming

BTW, the following is the gateway MQTT message for tx and rx:

gateway/0004a30b002226eb/rx {"rxInfo":{"mac":"xxxxxxxxxxxxxxxx","time":"2018-04-17T22:27:36.566103Z","timestamp":2164183212,"frequency":902300000,"channel":0,"rfChain":0,"crcStatus":1,"codeRate":"4/5","rssi":-37,"loRaSNR":13,"size":23,"dataRate":{"modulation":"LORA","spreadFactor":10,"bandwidth":125},"board":0,"antenna":0},"phyPayload":"APtC2yAmHJ6TVfxue2ZlluCkAmvDVlA="}
gateway/0004a30b002226eb/tx {"token":14177,"txInfo":{"mac":"xxxxxxxxxxxxxxxx","immediately":false,"timestamp":2169183212,"frequency":923300000,"power":20,"dataRate":{"modulation":"LORA","spreadFactor":10,"bandwidth":500},"codeRate":"4/5","iPol":null,"board":0,"antenna":0},"phyPayload":"ID2sw+IKG60ZWjj0pALELwQ="}
gateway/0004a30b002226eb/rx {"rxInfo":{"mac":"xxxxxxxxxxxxxxxx","time":"2018-04-17T22:27:43.014204Z","timestamp":2170644165,"frequency":903000000,"channel":8,"rfChain":0,"crcStatus":1,"codeRate":"4/5","rssi":-36,"loRaSNR":10.2,"size":23,"dataRate":{"modulation":"LORA","spreadFactor":8,"bandwidth":500},"board":0,"antenna":0},"phyPayload":"APtC2yAmHJ6TVfxue2ZlluClAoo3Amw="}

Here are some updates for this OTAA join issue:
lora-app-server log shows the following:

Apr 18 10:43:48 ttn-gateway lora-app-server[621]: time="2018-04-18T10:43:48-07:00" level=info msg="js: request received" message_type=JoinReq receiver_id=939e1c2620db42fb sender_id=010203 transaction_id=1877570482
Apr 18 10:43:48 ttn-gateway lora-app-server[621]: time="2018-04-18T10:43:48-07:00" level=info msg="device-keys updated" dev_eui=e09665667b6efc55
Apr 18 10:43:48 ttn-gateway lora-app-server[621]: time="2018-04-18T10:43:48-07:00" level=info msg="device-activation created" dev_eui=e09665667b6efc55 id=197
Apr 18 10:43:48 ttn-gateway lora-app-server[621]: time="2018-04-18T10:43:48-07:00" level=info msg="handler/mqtt: publishing message" qos=0 topic=application/1/node/e09665667b6efc55/join
Apr 18 10:43:48 ttn-gateway lora-app-server[621]: time="2018-04-18T10:43:48-07:00" level=info msg="js: sending response" message_type=JoinAns receiver_id=010203 result_code=Success sender_id=939e1c2620db42fb transaction_id=1877570482

loraserver log shows the following:
Apr 18 10:45:31 ttn-gateway loraserver[608]: time="2018-04-18T10:45:31-07:00" level=info msg="backend/gateway: rx packet received"
Apr 18 10:45:32 ttn-gateway loraserver[608]: time="2018-04-18T10:45:32-07:00" level=info msg="packet(s) collected" dev_eui=e09665667b6efc55 gw_count=1 gw_macs=0004a30b002226eb mtype=JoinRequest
Apr 18 10:45:32 ttn-gateway loraserver[608]: time="2018-04-18T10:45:32-07:00" level=info msg="device-queue flushed" dev_eui=e09665667b6efc55
Apr 18 10:45:32 ttn-gateway loraserver[608]: time="2018-04-18T10:45:32-07:00" level=info msg="device-session saved" dev_addr=07acdc62 dev_eui=e09665667b6efc55
Apr 18 10:45:32 ttn-gateway loraserver[608]: time="2018-04-18T10:45:32-07:00" level=info msg="device-activation created" dev_eui=e09665667b6efc55 id=198
Apr 18 10:45:32 ttn-gateway loraserver[608]: time="2018-04-18T10:45:32-07:00" level=info msg="backend/gateway: publishing tx packet" qos=0 topic=gateway/0004a30b002226eb/tx
Apr 18 10:45:47 ttn-gateway loraserver[608]: time="2018-04-18T10:45:47-07:00" level=info msg="backend/gateway: gateway stats packet received" mac=0004a30b002226eb
Apr 18 10:45:47 ttn-gateway loraserver[608]: time="2018-04-18T10:45:47-07:00" level=info msg="gateway updated" mac=0004a30b002226eb
Apr 18 10:45:53 ttn-gateway loraserver[608]: time="2018-04-18T10:45:53-07:00" level=info msg="backend/gateway: rx packet received"
Apr 18 10:45:53 ttn-gateway loraserver[608]: time="2018-04-18T10:45:53-07:00" level=error msg="processing rx packet error: get device-session error: device-session does not exist or invalid fcnt or mic" data_base64="QAFJUkSA2wEDEpMuFkZU1bbF5w=="

Thus the error is get device-session error. Can anyone suggest a solution or point to where the problem might be?

-Ming

Resolved by adding “LMIC_setClockError(MAX_CLOCK_ERROR * 1 / 100);” in Arduino + Lorashield setup after LMIC_reset();

1 Like