This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

INIT SCRIPT
#1
Hello

I would like to store parameters (email addresses, numbers for sms) in some parameters and give the possibility to the end user to change them.
Can I make the user change the data and store them in a file and have them recovered from the init script when the device is turned on?

Thanks so much
Reply
#2
You can use virtual objects with "250 byte string" data type for this.
Reply
#3
(25.03.2021, 11:05)admin Wrote: You can use virtual objects with "250 byte string" data type for this.

Yes,
I am using string values but if user changes the value at the next reboot what values will the empty string have or earth the previous value?
Reply
#4
Object values are saved in the database which is saved to disk every 30 minutes. The only case when changes might be missing is if the user changes something then does a power cycle right away.
Reply
#5
(25.03.2021, 12:05)admin Wrote: Object values are saved in the database which is saved to disk every 30 minutes. The only case when changes might be missing is if the user changes something then does a power cycle right away.

thank you so much
Reply
#6
One simple solution is to use a single resident script and poll button state periodically. If the state changes then run the open/close algorithm. Once it's finished then the polling starts again. Just make sure to add a delay between polling (at least 0.5 seconds) so you don't overload the CPU.
Reply


Forum Jump: