jimpastos / wink-relay-manager

Manage Wink Relay's native sensors and publish to MQTT
46 stars 24 forks source link

unable to save wink_manager.ini #18

Open sochartgit opened 1 year ago

sochartgit commented 1 year ago

Hi, thanks for all those information and hard work. I do experience something really weird. I've been able to save wink_manager.ini on the sdcard about 1 year ago.

In the meantimes, I've made some changes to it but I'm not able to save it anymore. I have no error, the file updates well on sdcard but reverts to previous version as soon as i do a reboot.

Please help.

Thanks a lot

jimpastos commented 1 year ago

How are you updating it?

sochartgit commented 1 year ago

That’s the process :

  1. Before adb push : -rw-rw-r-- root sdcard_rw 360 2022-03-16 15:48 wink_manager.ini

2) C:>adb push wink_manager.ini /sdcard wink_manager.ini: 1 file pushed, 0 skipped. 1.3 MB/s (490 bytes in 0.000s)

-rw-rw-r-- root sdcard_rw 490 2023-02-09 15:19 wink_manager.ini

  1. After Reboot file came back to previous version

-rw-rw-r-- root sdcard_rw 360 2022-03-16 15:48 wink_manager.ini

De : jimpastos @.> Envoyé : 9 février 2023 15:17 À : jimpastos/wink-relay-manager @.> Cc : sochartgit @.>; Author @.> Objet : Re: [jimpastos/wink-relay-manager] unable to save wink_manager.ini (Issue #18)

How are you updating it?

— Reply to this email directly, view it on GitHubhttps://github.com/jimpastos/wink-relay-manager/issues/18#issuecomment-1424755398, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AT2UUS2QKG4SCTAOWL6IURLWWVGFTANCNFSM6AAAAAAUW7UCHE. You are receiving this because you authored the thread.Message ID: @.**@.>>

sochartgit commented 1 year ago

I think a running service or a process locks the file

jimpastos commented 1 year ago

Thats very weird. Even if its locked (which it isn't because the process reads it at startup) it will never revert the file. Do you have any script/app that updates/copies the file on restart?

connect to your wink with adb shell, and check if the new file is correctly uploaded (ls, cat or you can even edit the file directly if you know how to use vi with busybox vi /sdcard/wink_manager.ini)

sochartgit commented 1 year ago

No script, every change is reverted, not only to the ini file, to folders too. If I do remove a whole folders it’s coming back after restarting the device And yes, the file is well uploaded. That’s really weird.

De : jimpastos @.> Envoyé : 9 février 2023 19:18 À : jimpastos/wink-relay-manager @.> Cc : sochartgit @.>; Author @.> Objet : Re: [jimpastos/wink-relay-manager] unable to save wink_manager.ini (Issue #18)

Thats very weird. Even if its locked (which it isn't because the process reads it at startup) it will never revert the file. Do you have any script/app that updates/copies the file on restart?

connect to your wink with adb shell, and check if the new file is correctly uploaded (ls, cat or you can even edit the file directly if you know how to use vi with busybox vi /sdcard/wink_manager.ini)

— Reply to this email directly, view it on GitHubhttps://github.com/jimpastos/wink-relay-manager/issues/18#issuecomment-1425008564, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AT2UUSZDO7BVURJGMHP47ELWWWCLXANCNFSM6AAAAAAUW7UCHE. You are receiving this because you authored the thread.Message ID: @.**@.>>

sochartgit commented 1 year ago

Finally, I think that's an SDcard issue. It looks corrupted so it does not apply changes.

jimpastos commented 1 year ago

:(

jeffh0821 commented 1 year ago

Just for historical purposes...

The SDCard storage devices on the Wink Relays have a VERY low cycle count and will, eventually, refuse additional writes to the media and effectively go "read-only". This is particularly pervasive for those using "KingRoot" for gaining sudo within Android ICS. KingRoot often behaves like a sort of spyware, recording it's use in a overly granular way. I have 2 relays that are now "frozen in time" in a config state that I can no longer update or persist across reboots.

Anything you can do to minimize writes to the SDcard storage will help prolong the relays writeable life (especially replacing KingRoot- https://github.com/HemanthJabalpuri/Replace_KingRoot_with_SuperSU). The good news is, if you find a configuration that works for you, and you end up hitting the cycle count - the device will continue to work perfectly fine. You will just not be able to change configs and/or expect anything to persist across reboots.

jimpastos commented 1 year ago

We can probably store the ini file somewhere else. The location is hardcoded in the binary at the moment, but its an easy change once we find a better location. We can make it look for it in a new place and revert to sdcard if not found

sochartgit commented 1 year ago

Hi @jeffh0821. That's exactly what I do experience. I've installed KingRoot a while ago, found a wink_manager.ini that was working for my purpose. Then upgraded my MQTT setup and have been unabled to write the changes. @jimpastos That could be very interesting. For example, the firmware could try to obtain TFTP server address from DHCP assignation and look for a wink_manager.ini file on it. Thanks for your help guys.

jimpastos commented 1 year ago

Well since we run as root, the binary is in a non sdcard location. We could put the ini file there too. Or any location