What is the difference between 'error="get device-session error: object does not exist"' and 'error="get device-session error: invalid MIC"'?

All I know is that they are all related to the secret keys related to network access.

Can anyone explain their wrong differences in detail?

No idea :-). I just know that first error is discussed here and second error is discussed here. Did that help?

1 Like

After searching the LoRaWAN Specification, I think the first error is more serious because devaddr has been wrong and it is no longer necessary to calculate the mic.

The second error occurs when devaddr is correct but the mic value is calculated incorrectly.

I don’t know if I’m right.

For future reference, @haowong is right. get device-session error is an error where the network server can not lookup the session keys for a sensor, based on its device addres and deveui. I think the error can also happen when there is a newer device address associated with the deveui (the created_at date is recorded as well). If the lookup succeeds, then the network server has the required session keys for decryption of the lorawan payload. If it doesn’t succeed, you get the error.

The MIC is a signature of the lorawan message based on one of the session keys and device address. This is only used to check that the payload integrity. If the MIC calculation fails, this means that the lorawan payload was modified incorrectly. That could potentially be malicious, but also radio interference for instance, or the sensor and network server are using different session keys to sign/verify the same payload.