Skip to content

How to save settings in custom driver? #1598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Phil1pp opened this issue Apr 8, 2025 · 3 comments
Open

How to save settings in custom driver? #1598

Phil1pp opened this issue Apr 8, 2025 · 3 comments

Comments

@Phil1pp
Copy link

Phil1pp commented Apr 8, 2025

I am trying to write a custom driver that requires to save some configuration data and restore it after reboot.
Is there already any function/library that can be used for this purpose?

@openshwprojects
Copy link
Owner

It's nice to hear that people are creating custom drivers. For saving data in flash, we don't have any universal API, but you can use retain channels (saved as short), as there are MAX_RETAIN_CHANNELS (12) of them and it's very unlikely that users will use all 12 of them... usually up to 4 are used.

Alternatively, you could try LFS

@Phil1pp
Copy link
Author

Phil1pp commented Apr 9, 2025

Thanks for your answer, however 8 shorts won't be enough.
I am trying to implement a KNX interface which will need a storage of up to 1024 bytes.
Can I read and write to the Flash somehow?
Is LFS implemented an how to use it?

@openshwprojects
Copy link
Owner

openshwprojects commented Apr 9, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants