Skip to content
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

Chirpstack not returning JoinAccept #12

Open
haimiko opened this issue May 25, 2022 · 3 comments
Open

Chirpstack not returning JoinAccept #12

haimiko opened this issue May 25, 2022 · 3 comments

Comments

@haimiko
Copy link

haimiko commented May 25, 2022

I'm running OTAA join requests on Chirpstack. I'm seeing JoinRequest on Chirpstack but never a JoinAccept. Usually this means the App key is incorrect but I'm not seeing this as the case.

My device.json

{
    "Device": {
        "JoinEUI": "ded70e37a48e4289",
        "DevEUI": "ded70e37a48e4289"
    },
    "RootKeys": {
        "AppKey": "1CB94D4B9B5522C11233D2EEFE64D82A",
        "NwkKey": "1CB94D4B9B5522C11233D2EEFE64D82A"
    }
}

My join request:

#mote join  -n
2022-05-25 22:24:26,558 - INFO - Forming a join request message -
NwkKey: 1CB94D4B9B5522C11233D2EEFE64D82A, AppKey: 1CB94D4B9B5522C11233D2EEFE64D82A, AppEUI: ded70e37a48e4289, DevEUI: ded70e37a48e4289, DevNonce: 19, MIC: bad07cea,Final Join Req: 0089428ea4370ed7de89428ea4370ed7de1300bad07cea --

2022-05-25 22:24:26,559 - INFO - Sending a PUSH DATA -
Verson: 02, Token: 5bd6, Identifier: 00, GatewayEUI: 4e7b2799b9bfd427

2022-05-25 22:24:26,560 - INFO - Receiving a PUSH ACK -
Version: 02, Token: 5bd6, Identifier: 01

2022-05-25 22:24:28,563 - INFO - No response is received from remote servers

I'm getting the following error on the app server:

`time="2022-05-25T22:24:27.058915588Z" level=info msg="backend/joinserver: sending response" dev_eui=ded70e37a48e4289 message_type=JoinAns receiver_id=000000 result_code=Success sender_id=ded70e37a48e4289 transaction_id=4008038692

time="2022-05-25T22:24:28.141512925Z" level=warning msg="finished unary call with code FailedPrecondition" ctx_id=a4afba43-49d5-4ffb-a20a-b494c9c17039 error="rpc error: code = FailedPrecondition desc = devaddr does not match, the security-context is out of sync" grpc.code=FailedPrecondition grpc.method=ReEncryptDeviceQueueItems grpc.service=as.ApplicationServerService grpc.start_time="2022-05-25T22:24:28Z" grpc.time_ms=63.609 peer.address="172.24.0.3:40256" span.kind=server system=grpcod

time="2022-05-25T22:24:30.396006389Z" level=warning msg="finished unary call with code FailedPrecondition" ctx_id=40d097b0-4f3b-4905-95b8-8420ffe3b9cf error="rpc error: code = FailedPrecondition desc = devaddr does not match, the security-context is out of sync" grpc.code=FailedPrecondition grpc.method=ReEncryptDeviceQueueItems grpc.service=as.ApplicationServerService grpc.start_time="2022-05-25T22:24:30Z" grpc.time_ms=63.557 peer.address="172.24.0.3:40256" span.kind=server system=grpc
`

Suggestions?

@Xiao-Di
Copy link

Xiao-Di commented May 26, 2022

Hi @haimiko ,
The problem you mentioned may probably be caused by the mismatch of DevAddr.
It is suggested to perform the following three steps to check it out:

  1. Whether the gateway is registered before;
  2. mote pull before JOIN;
  3. Check out on the ChirpStack website whether the JoinReq message has been recieved.

@haimiko
Copy link
Author

haimiko commented May 26, 2022

Hi @haimiko , The problem you mentioned may probably be caused by the mismatch of DevAddr. It is suggested to perform the following three steps to check it out:

  1. Whether the gateway is registered before;
  2. mote pull before JOIN;
  3. Check out on the ChirpStack website whether the JoinReq message has been recieved.

Tried the pull, made no difference. Tried recreating the device as well. JoinReq message has been received by the Chirpstack website, not getting JoinAccept because the "security context is out of sync".

@haimiko
Copy link
Author

haimiko commented May 26, 2022

Ok for some reason now i'm receiving a JoinAccept

#mote join -n
2022-05-26 20:39:58,409 - INFO - Forming a join request message -
NwkKey: ab581cd5fdb6d129a46920a61997117c, AppKey: ab581cd5fdb6d129a46920a61997117c, AppEUI: ded70e37a48e4290, DevEUI: ded70e37a48e4290, DevNonce: 7, MIC: ef403bd9,Final Join Req: 0090428ea4370ed7de90428ea4370ed7de0700ef403bd9 --


2022-05-26 20:39:58,409 - INFO - Sending a PUSH DATA -
Verson: 02, Token: 2b0c, Identifier: 00, GatewayEUI: 4e7b2799b9bfd427


2022-05-26 20:39:58,412 - INFO - Receiving a PUSH ACK -
Version: 02, Token: 2b0c, Identifier: 01


2022-05-26 20:39:59,479 - INFO - Receiving a PULL RESP -
Version: 02, Token: 01cd, Identifier: 03 --


2022-05-26 20:39:59,481 - INFO - -----Parsing a join acpt message -
devaddr: 50b8e762, joinnonce: 000007, homenetid: 000868, optneg: 0, rx1droffset: 0, rx2dr: 0, Calculated MIC: 7d292f0b --


2022-05-26 20:39:59,481 - INFO - Join Accept (MIC verified) -
Original data: 07000068080062e7b8500001184f84e85684b85e84886684586e8400
MHDR: 20,Join type: ff,DevAddr: 50b8e762, OptNeg: 0, CFList: 184f84e85684b85e84886684586e8400,

DevAddr matches the DevAddr in Chirpstack, but when I try to send data I get MIC errors:

# mote pull
2022-05-26 20:41:21,444 - INFO - PULL DATA -
Version: 02, Token: 6641, Identifier: 02, GatewayEUI: 4e7b2799b9bfd427


2022-05-26 20:41:21,445 - INFO - PULL ACK -
Version: 02, Token: 6641, Identifier: 04,


# mote app helloworld
2022-05-26 20:41:28,007 - INFO - Uplink application data -
MHDR: 80, FHDR: 62e7b850000000, FOpts: , FPort: 60, FRMPayload (after encryption): c72c88465d38ab89efdf, MIC: 5d7c33da --


2022-05-26 20:41:28,008 - INFO - Sending a PUSH DATA -
Verson: 02, Token: b755, Identifier: 00, GatewayEUI: 4e7b2799b9bfd427


2022-05-26 20:41:28,010 - INFO - Receiving a PUSH ACK -
Version: 02, Token: b755, Identifier: 01


2022-05-26 20:41:30,012 - INFO - No response is received from remote servers

And this is what shows up in Chirpstack

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants