I wanted to use the config tree to store some minor settings. But to my suprise the settings I save is stored if i reboot the device etc. but not if I update the app . Tried both “update” and “app install” but both delete the my new “leaf”. I guess it is only preserved if I update the hole legato system? https://docs.legato.io/latest/howToSoftwareUpdate.html
Config tree items will be maintained across app updates. If you remove the application, then the config tree for that application is removed. So if you do a remove and then install, then the config tree items will not be available.
What modem and legato version are you seeing this behavior?
Have you got the permissions correct in the app.adef file? You need to make sure that you give yourself read and write permissions to your own config tree too. Something like this:
requires:
{
configTree:
{
[rw] . // read/write access to my own config tree
}
}
Note that I’ve sometimes seen the data ‘disappear’ when switching an app between sandboxed and unsandboxed. It appears that an unsandboxed app writes the config into the ‘root’ tree by default.
I got around this by explicitly adding the config tree root (by default appName:/ to each read and write to make sure I was always using the correct tree.
Note
If your app is running as root then the configuration will get added to the System Tree by default. System utilities also use the Config Tree and store their configurations in the system tree.
Okay. I ran this app unsandboxed and I did not add the configTree to my adef…
I could read back my stored settings using “config get /apps/myApp/” but not after an app update.