Solved: install package alt-f/python you have to install some other python packages, via pip, required to the following script. create /Alt-F/alarm and chdir into it git clone https://github.com/martin-vi/dns320_alarm change ctl_alarm.py , first line, interpreter is python and not python2 create the following file in /Alt-F/alarm/set_next
-------------------- cut here --------------------------
The original Andreas Böhler and particularly the modified Alt-F dns320l-daemon already have most things done; only a small amount of wrapping tape and debugging time is needed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Andreas Bohler told me that he no longer mantains that code (he buyed a better nas).
on my dns320l, actually i used the python solution and it works, and i try to change creating a solution in c (including all functions of andreas project features).
regards.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
[root@DNS-320L]# rcpower status
power:
Wakeup alarm set to: 2018-03-11 14:30
Poweroff set to "0 21 * "
Automatic Power Recovery set
Wake on Lan NOT set
[root@DNS-320L]# dns320l-daemon -x help
Available Commands:
The dns-320l support was done by Andreas Böhler, see in particular the "Working So Far" and the "Still Todo" section.
If you follow his method and devise how to make the RTC wakeup to work I will add that.
Solved:
install package alt-f/python
you have to install some other python packages, via pip, required to the following script.
create /Alt-F/alarm and chdir into it
git clone https://github.com/martin-vi/dns320_alarm
change ctl_alarm.py , first line, interpreter is python and not python2
create the following file in /Alt-F/alarm/set_next
-------------------- cut here --------------------------
!/bin/sh
HERE=/Alt-F/alarm/
nextmon=$(python -c 'import time; print time.localtime(time.time() + 243600).tm_mon')
nextday=$(python -c 'import time; print time.localtime(time.time() + 243600).tm_mday')
hour=18:00
date >> $HERE/log
$HERE/dns320_alarm/ctl_alarm.py write -d $nextday -m $nextmon -t 18:00 >> $HERE/log
-------------------- cut here --------------------------
change the root crontab with the following:
0 23 * * /Alt-F/alarm/set_next
0 1 * * shutdown
i used these settings:
wakeup at 18:00
at 1AM the shutdown, at 23:00 set the alarm.
thanks to the message of Andreas Bohler.
regards
Thanks for the pointer.
I will eventually add that feature to the dns320l-daemon, as having to install python just for that purpose is not practical.
I'm started a c project on github.
https://github.com/dg14/dns320_utils
for now, it compiles, writes and reads on serial. i've to proceed to update the alarm and develop if needed a socket server.
The original Andreas Böhler and particularly the modified Alt-F dns320l-daemon already have most things done; only a small amount of wrapping tape and debugging time is needed.
Andreas Bohler told me that he no longer mantains that code (he buyed a better nas).
on my dns320l, actually i used the python solution and it works, and i try to change creating a solution in c (including all functions of andreas project features).
regards.
Any news?
Implemented by svn commits r3819, r3824, r3828
[root@DNS-320L]# rcpower status
power:
Wakeup alarm set to: 2018-03-11 14:30
Poweroff set to "0 21 * "
Automatic Power Recovery set
Wake on Lan NOT set
[root@DNS-320L]# dns320l-daemon -x help
Available Commands:
DeviceReady, DeviceShutdown, ShutdownDaemon, EnablePowerRecovery, DisablePowerRecovery, GetPowerRecoveryState, EnableWOL, DisableWOL, GetWOLState, SetFanStop, SetFanHalf, SetFanFull, PowerLedOn, PowerLedOff, PowerLedBlink, ReadRtc, ReadAlarm, WriteAlarm, EnableAlarm, DisableAlarm, systohc, hctosys, GetTemperature, help, quit.
[root@DNS-320L]# dns320l-daemon -x readalarm
Wakeup alarm set to: 2018-03-11 14:30
[root@DNS-320L]# dns320l-daemon -x writealarm
ERR WriteAlarm: month day hour min | +N{d|m} (days|month) | now | disable