Automatically update DeviceProfiles using DeviceProfileTemplates

Hello!

I’m currently implementing a Continuous Delivery system to automatically update our DeviceProfiles with the latest codecs and saw that Chirpstack has a the import-lorawan-device-profiles command which seemed to ostensibly do what I was looking for.

However, this only updates the DeviceProfileTemplates. I have looked at the documentation and the source code and have not found a way to programmatically update our DeviceProfiles with their respective DeviceProfileTemplate.

And thus, this leaves me with the following question :
In Chirpstack 4.12, is there a way (through a gRPC request for example) to update a DeviceProfile using it’s template? I am aware that I could update the DeviceProfile directly, but it seems a bit hacky.

Thank your for your time!
Philippe

The DeviceProfile and DeviceProfileTemplate objects are pretty similar. If you just stripped the extra fields from DeviceProfileTemplate you could use a GetDeviceProfileTemplate call into a UpdateDeviceProfile call to update your device profiles (assuming they have the same name or you have some way to match the template to the profile).

Just as an FYI though, the import-lorawan-device-profiles repository is outdated. It still functions for many devices but there are many missing and some newer software updates to devices would not be included.

Hi Liam!

This does indeed seem the likely solution. Were I to implement it and knowing what DeviceProfile is associated to which codec, I would simply fetch the target DeviceProfile using GetDeviceProfileRequest, swap out the codec (which is a string) for the updated version then create an UpdateDeviceProfileRequest and execute it. However, this method bypasses the import-lorawan-device-profiles command and the templates, which makes me wonder if I misunderstood what the command is used for.

As for the repository you have mentioned, lorawan-device-profiles, it seems to be up-to-date, albeit with not that many existing templates currently.

Also, to my understanding of the newer command, I can simply pass a path to a file structure matching the lorawan-device-profiles repository. As such, I would only need to fork or replicate the file structure for the command to execute properly.

Not if you use getDeviceProfileTemplate command, then use that output + your adjusted codec in an updateDeviceProfile command.

Its 3 years old now:

this is the new one we’re working on.

I have done a few pr’s in the last week for some devices.

Just unsure on how to implement it into chirpstack at the moment, i left a few issues on the repo so hopefully when @broccar gets some time he can let me know or update the readme and chirpstack docs.

1 Like