Closed meijerwynand closed 3 years ago
About timezone, I already implemented (but not committed) an option to change timezone directly inside sqlite db. In this manner it's compatible with the app.
I will try to integrate cron and syslog in the hack.
Thank you for your code.
Closing
Syslog is missing, I will check if I can integrate it.
Greetings,
I was unable to get the timestamps on my camera to display according to my timezone (I did a factory reset and did not use the eWeLink app to configure anything). I also wanted to have my cronjobs saved and not lost after each reboot.
Code stuff
Script
The code for all three these matters:
Installing
/mnt/mmc/sonoff-hack/script/crond.sh
with the contents shown above/mnt/mmc/sonoff-hack/script/crond.sh
to the bottom of/mnt/mmc/sonoff-hack/script/system.sh
as a single lineDisable the ntpdate in the database file -
/mnt/mtd/db/ipcsys.db
(not sure if this really does anything)UPDATE "main"."t_sys_param" SET "c_param_value"=0 WHERE c_param_name = "NTPEnable"
This was done via sqlitebrowser, copy the file locally, change it and then replace the running version on the cameraNotes
crontab
After various attempts it appears the
crond
does not honor the-c $work_path
flag. For this work around a symlink is created with the actual saving of the crontabs to the/mnt/mmc/sonoff-hack/
path. Using this method also allows the crontabs to be saved to the SD card and they remain even after reboots.syslog
By troubleshooting the initial
crond
issues,syslogd
as later added to aid in understanding the strange behavior ofcrond
(not honoring-c
). It turned out to actually be a welcomed addition and decided to keep it. This is also save to the SD card which can serve as "off-line" logs.zoneinfo
I ended up finding a copy of my zoneinfo on my local pc, so I uploaded it. During boot I remove the default
/etc/localtime
(Hong Kong) and do another symlink to the copy of my zoneinfo file. Followed by a timesync viantpd
and updating thehwclock
to the (new) system zoneinfo.Now once I have booted the device and logged in, my time is correct
*nix paths
Here it is attempted to conform to the standard
var/
etc/
paths. Similar to a *nix environment where stuff generally is found, it is now only prefixed with the SONOFF_HACK path,Conclusion
These changes seem to keep after reboots and helps with fiddling with the device. I trust someone will find this useful or even better some of these ideas make it into the project.