Keys are lost for ABP devices after inactivity

Hi Guys

I notice a strange behavior, I bulk add a bunch of devices and I activate them (ABP) with keys and device id.

If the device is inactive for 1 or 2 months, the keys are lost and the activation tab shows empty

This is a big issue for us, do you have an idea why this would be happening?

this is not strange.
parameter device_session_ttl= in chirpstack-network-server.toml can control this.
after inactive time device keys etc. will gone.

3 Likes

One of the biggest problem with chirpstack.

There was a bad design decision about database keys for abp at the very start and it seems Broocar will not fix separate fields for abp and otaa keys.

Abp should never ever time out as there are very bad things that can happen on raspberries which does not have real time clocks for instance. Time can go backwards on these systems if power is lost.

Are the keys really gone?
Unfortunately I also overlooked that this setting exists.
I have now set the value much higher.
But the affected devices are built in, not accessible and cannot be rejoined.
How can I fix the device status in the application “This device has not (yet) been activated”?

Assuming you know what those keys are, you can manually reactivate the device by creating the keys yourself:

There is a corresponding REST API endpoint, as well.

1 Like

Thank you for pointing this out.

My question probably doesn’t quite fit into the topic.
I need to reactivate a whole series of OTAA devices whose DeviceSession in the REDIS database has been deleted due to inactivity.
I was already able to activate some of the devices with an old Linux snapshot because their DeviceSessions could still be found in REDIS.

The lost devices continue to transmit. The necessary data seems to be in the Postgres database. Can the deviceSessions be reconstructed from this?

You can re-activate OTAA devices using the same API as ABP devices. This feature is not available in the web-interface, but using the API it is possible :slight_smile: E.g. to migrate OTAA devices from one instance to an other.

2 Likes

The approach sounds good, thanks.
Since I know java best, I will take a closer look at java impementation.