Join-Request error code: MICFailed

Hi everyone,
I installed lora server some weeks ago and now I’m trying to use a lopy4 with OTAA. However, I had the next problem with the code of example (https://github.com/brocaar/pycom-examples)

“level=error msg="processing uplink frame error"
data_base64="AAEBAQEBAQEBq4vqm0nVs3CpqNTz+xA=" error="join-request to join-server
error: response error, code: MICFailed, description: invalid mic"”

I attach the logs (in case somebody can help me with this error)

Logs Lora-server

Logs Lora-gateway-bridge

Response in the app

Thank you.

This error means that the keys that you have setup are invalid. In other words the MIC is generated with a key that doesn’t match the key in LoRa App Server meaning the MIC can’t be validated.

Ok, but I’m copyng the next key in my code

And my code is like this:
app_eui = binascii.unhexlify(‘0101010101010101’)
app_key = binascii.unhexlify(‘81f07035a1f1b010373a5cb2b0c81f7b’)

I dont’t see where is the mistake, I would appreciate some tips

Maybe the byte-order is the issue? See the MSB / LSB toggle :slight_smile:

1 Like

I tried the two options but I had the same response :frowning_face:

I had the same issue when configuring a sensor via NFC. It did not properly read the original keys via the NFC process, so the keys where suddenly wrong in the sensor (the device had already joined). So I got the same MIC error on LNS level. Maybe this helps your old case :slight_smile: