wake up DNS-320 rev A

1,548 views
Skip to first unread message

extenue

unread,
May 17, 2021, 4:04:40 PM5/17/21
to Alt-F
Hi Community,

I've searched and read say 20 min before posting as I did not see / understood any answer to my query.

I own the DNS-320 rev A and I am looking to save energy , per its location in my house , I don't have easy access so turn it on on pressing button is not an option.

I don't understand anything at /etc/init.d/rcS.

I can execute this but not applicable on my box so none commands works.

dns320l-daemon -x help
Available Commands:

DeviceReady, ...

If I knew it would work , I could purchase and plug the DNS-320 on a smart plug so I could wake up the box based on power recovery ?

Is anyone can tell what are the possibilities to shutdown / start the DNS-320 on demand ?

having a cron job which would shutdown and start (really possible ??) would be fine by me if that's really the only option

Thanks

XT

Jeremy Laidman

unread,
May 17, 2021, 11:41:13 PM5/17/21
to Alt-F
XT

Using a cron job to start your DNS320 is not possible, because cron isn't running (nor anything else) when the NAS is shut down. The CPU isn't even running.

Using a smart plug alone to shutdown the DNS320 is not a good idea. Being a Linux-based system, gracefully shutting down is important to reduce the risk of file and filesystem corruption. However, shutting down and then powering off would be fine. Powering on again using the smart plug might be possible, if power recovery is enabled and working.

According to <https://github.com/martin-vi/dns320_alarm>, the DNS320-revA is just the "L" version but with less RAM. So that suggests that WoL is supported by dns320l-daemon. I would expect you can enable WoL by running "dns320l-daemon -x EnableWOL".

However you said that none of the "dns320l-daemon" commands work. Can you please describe the symptoms you're seeing? Do you get an error message? Do you get any response to "dns320l-daemon -x GetTemperature" or "... GetWOLState"?

I tried these commands on my DNS320-L and they didn't work. They returned no output, and a return code of 1. I re-ran the commands through strace, and found that the daemon returned ERR on its socket. So I killed the process (pkill dns320l-daemon) and re-ran the commands, and they all started to work! I rebooted, to see if this was due to a weird boot-time state, and the commands worked after a reboot also. So you might want to reboot your DNS320 and try again.

After powering down using the GUI, my ethernet ports have flashing lights, indicating that they're still powered, and hinting that WoL might be possible. Having said that, even though I could enable WoL using dns320l-daemon, I couldn't get my NAS to wake up. However, I've never used WoL before, so I might just be getting something wrong when using WoL utilities. Also, there was some discussion on this forum about the possibility that the ethernet port's WoL line isn't wired to the power on line. Unless someone proves otherwise, I'm going to assume WoL isn't supported.

Assuming you have power recovery enabled (test by powering off in the GUI and unplugging+replugging power cord), you can probably do what you're asking for. You can schedule a power-down process by creating a cron task that runs "/usr/sbin/poweroff"; or run it from the command-line when required; or click the Poweroff button in the GUI.

Once powered down, use the smart plug app to power off/on the smart plug. Your NAS should power itself up.

Unfortunately, on my 320L, power recovery doesn't seem to work. If I power down using the "Poweroff" button in the GUI, and then do a power cycle by unplugging and replugging the power cord, the NAS doesn't power up. Instead I have to press the button to have it power up.

You might be able to get this to work on your DNS320-revA but if the only difference to my "DNS320L" version is the amount of RAM, you may find the same disappointing results.

Cheers
Jeremy


--
You received this message because you are subscribed to the Google Groups "Alt-F" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alt-f+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/alt-f/6a06f625-43f1-4fbf-b164-7b63b5ea3362n%40googlegroups.com.

Jeremy Laidman

unread,
May 17, 2021, 11:54:22 PM5/17/21
to Alt-F
According to <https://sourceforge.net/p/alt-f/featurerequests/32/#a96d> there were some updates to the dns320l-daemon to add ReadAlarm, WriteAlarm, EnableAlarm and DisableAlarm commands. With these, I believe you can schedule the box to power itself up at a particular time.

My dns320l-daemon doesn't have these commands.

João Cardoso

unread,
May 18, 2021, 1:04:43 PM5/18/21
to Alt-F
On Tuesday, May 18, 2021 at 4:54:22 AM UTC+1 Jezzaaaa wrote:
According to <https://sourceforge.net/p/alt-f/featurerequests/32/#a96d> there were some updates to the dns320l-daemon to add ReadAlarm, WriteAlarm, EnableAlarm and DisableAlarm commands. With these, I believe you can schedule the box to power itself up at a particular time.

My dns320l-daemon doesn't have these commands.

You might try using the the attached one.
Couldn't get WOL to work, but alarm wakeup is. It has to be rearmed after elapsed.
I think to remember that "automatic power up after power fail" means that it will return to the previous state after power fails -- if it was off it will remains off, though not sure.
I have webui and scripts to handle all that, but there are multiple dependencies between them, I might miss some, so not posting them.


dns320l-daemon.gz

Jeremy Laidman

unread,
May 18, 2021, 8:56:48 PM5/18/21
to Alt-F

I've managed to hack dns320_utils to work without segfaults - at least it now accepts commands to show the status of the alarm flag and to get/set the WOL status, but I haven't tested it for using the alarm. This might be an alternative to those not game enough to replace their dns320l-daemon binary.

On Wed, 19 May 2021 at 03:04, João Cardoso <whoami...@gmail.com> wrote:
You might try using the the attached one.

Thanks João.
 
Couldn't get WOL to work, but alarm wakeup is. It has to be rearmed after elapsed.
I think to remember that "automatic power up after power fail" means that it will return to the previous state after power fails -- if it was off it will remains off, though not sure.

I had the "auto powerup after power fail" set (GetPowerRecoveryState = 128), but it doesn't power on after I power down using the GUI. So I think what you're saying is that, if I pull the plug instead of powering down, then it will power up again when power is restored?

Would it be a viable option (for XT) to terminate services and unmount filesystems, then cut power using a smart plug? That way, the power is cut rather than powering itself down, yet no risk of filesystem corruption. I think this can be achieved by running /etc/init.d/rcE after ensuring /boot/.poweroff is removed?
 
I have webui and scripts to handle all that, but there are multiple dependencies between them, I might miss some, so not posting them.

That's fair. Perhaps in some future release of Alt-F?

João Cardoso

unread,
May 19, 2021, 1:50:25 PM5/19/21
to Alt-F
On Wednesday, May 19, 2021 at 1:56:48 AM UTC+1 Jezzaaaa wrote:

I've managed to hack dns320_utils to work without segfaults - at least it now accepts commands to show the status of the alarm flag and to get/set the WOL status, but I haven't tested it for using the alarm. This might be an alternative to those not game enough to replace their dns320l-daemon binary.

On Wed, 19 May 2021 at 03:04, João Cardoso <whoami...@gmail.com> wrote:
You might try using the the attached one.

Thanks João.
 
Couldn't get WOL to work, but alarm wakeup is. It has to be rearmed after elapsed.
I think to remember that "automatic power up after power fail" means that it will return to the previous state after power fails -- if it was off it will remains off, though not sure.

I had the "auto powerup after power fail" set (GetPowerRecoveryState = 128), but it doesn't power on after I power down using the GUI. So I think what you're saying is that, if I pull the plug instead of powering down, then it will power up again when power is restored?

Yes. I have done it right now on a DNS-320L.


Would it be a viable option (for XT)

He has a DNS-320 rev A, not B, so that's not an option.

You said: "According to <https://github.com/martin-vi/dns320_alarm>, the DNS320-revA is just the "L" version but with less RAM."
That is incorrect, according to the info I collected at the time (I have neither a DNS-320 rev-A nor rev-B box). It is correct for the DNS-320-rev-B.
In Alt-F, the rev-A does not use the dns320l-daemon, instead it uses a shell script, /usr/sbin/dns320-temp.sh, only for reading the temperature. That script is an adaptation of Lentin's findings, see https://jamie.lentin.co.uk/devices/dlink-dns325

to terminate services and unmount filesystems, then cut power using a smart plug? That way, the power is cut rather than powering itself down, yet no risk of filesystem corruption. I think this can be achieved by running /etc/init.d/rcE after ensuring /boot/.poweroff is removed?

Roughly, but to do a clean shutdown without actually powering itself down it is enough to call /usr/sbin/halt in a cronjob. That calls rcE, which orderly shuts down the system and then just halts the system (theoretically stopping the processor).

Only a DNS-320-rev-A owner can confirm that if at that point power is cut and restored the box will power up.

The DNS-325-rev-A works that way, and the trick is also applied to the 320-rev-A, but I really don't know if it works. See rcS:
# Tell PMU to turn back on after a power failure
if test $board = "DNR-322L-Ax" -o $board = "DNS-320-Ax" -o $board = "DNS-325-Ax"; then

 
I have webui and scripts to handle all that, but there are multiple dependencies between them, I might miss some, so not posting them.

That's fair. Perhaps in some future release of Alt-F?

At most in a snapshot "release", i.e., "this is what I'm using now, it might have loose ends"
 

Gilles Martinoty

unread,
May 19, 2021, 3:53:48 PM5/19/21
to al...@googlegroups.com
Le mer. 19 mai 2021 à 19:50, João Cardoso <whoami...@gmail.com> a écrit :

You said: "According to <https://github.com/martin-vi/dns320_alarm>, the DNS320-revA is just the "L" version but with less RAM."
That is incorrect, according to the info I collected at the time (I have neither a DNS-320 rev-A nor rev-B box). It is correct for the DNS-320-rev-B.
In Alt-F, the rev-A does not use the dns320l-daemon, instead it uses a shell script, /usr/sbin/dns320-temp.sh, only for reading the temperature. That script is an adaptation of Lentin's findings, see https://jamie.lentin.co.uk/devices/dlink-dns325

to terminate services and unmount filesystems, then cut power using a smart plug? That way, the power is cut rather than powering itself down, yet no risk of filesystem corruption. I think this can be achieved by running /etc/init.d/rcE after ensuring /boot/.poweroff is removed?

Roughly, but to do a clean shutdown without actually powering itself down it is enough to call /usr/sbin/halt in a cronjob. That calls rcE, which orderly shuts down the system and then just halts the system (theoretically stopping the processor).

Only a DNS-320-rev-A owner can confirm that if at that point power is cut and restored the box will power up.

I confirm it works on my DNS-320-rev-A : after calling halt, waiting, and unplugging the cord, the system powered up again when the cord was plugged back in.

Best regards.

João Cardoso

unread,
May 20, 2021, 12:22:51 PM5/20/21
to Alt-F
Thanks for confirming that.

So, XT can setup a cron job (Services->System, cron, Configure) to halt the box (using the /usr/sbin/halt command) a few minutes before the smart plug cuts power.
 

Best regards.

extenue

unread,
May 29, 2021, 4:22:52 PM5/29/21
to Alt-F
Thanks all , especially Jezzaaaa for his first answer.

Given the fact I have other issues with my other NAS (Dell Power Edge T20 , the disks are too hot there) , I have rethinking my setup and plan to have my old good DNS-320 turn on all the time , especially as the disks can be spindown , with drives sleeping , I think the whole power consumption should not very huge , actually I don't know how the Dlink consume (I can know it as the smart plug I planned to use to turn on the dlink can give power consumption). 

That being said , to make this post even better , I promise to do the test , verify the smart plug can wake up the Dlink shutdown by the schedule task as well as indicate power consumption of everything.

Thanks again for this thread.

See ya

XT

Rodrigo Izurieta

unread,
Jan 8, 2022, 11:34:23 PM1/8/22
to Alt-F
Hi:

I am using DNS-321-Ax.
Firmware says "Alt-F 1.0 with kernel 4.4.86, and is flashed with "Alt-F-1.0, initrd" and kernel "Alt-F-1.0, kernel 4.4.86"

I have been trying to follow how to get the DNS-321 to power on after power failure.  All I need is for the box to turn on after power is restored.  (It is in a difficult location to reach, so when power is lost, it is really a hassle to get to it to push a button to power on.)

I looked at https://jamie.lentin.co.uk/devices/dlink-dns325.  However, there is no rc.local file at /etc in my box.  I checked via SSH in root and in the Alt-F folder.

Is there something I need to install first?  Is there a fix I can download?

Any help is very much appreciated.

Thanks.

Rolf Pedersen

unread,
Jan 9, 2022, 8:03:54 AM1/9/22
to al...@googlegroups.com


On 1/8/22 8:34 PM, 'Rodrigo Izurieta' via Alt-F wrote:
Hi:

I am using DNS-321-Ax.
Firmware says "Alt-F 1.0 with kernel 4.4.86, and is flashed with "Alt-F-1.0, initrd" and kernel "Alt-F-1.0, kernel 4.4.86"

I have been trying to follow how to get the DNS-321 to power on after power failure.  All I need is for the box to turn on after power is restored.  (It is in a difficult location to reach, so when power is lost, it is really a hassle to get to it to push a button to power on.)

I looked at https://jamie.lentin.co.uk/devices/dlink-dns325.  However, there is no rc.local file at /etc in my box.  I checked via SSH in root and in the Alt-F folder.

Is there something I need to install first?  Is there a fix I can download?

Any help is very much appreciated.

Thanks.
That guy is using Debian.  You are using Alt-F.  If you want to follow his how-to, install what he has installed, Debian, not Alt-F.  There has been discussion on the list and you should search.*  Link is at the bottom of every email.  My recollection is that, with Alt-F, auto power-on cannot be achieved without soldering a hardware modification, if at all.
Rolf
* one search result:  https://groups.google.com/g/alt-f/c/ScFXyHzIoPg/m/AvyRDxhhBQAJ

On Saturday, May 29, 2021 at 3:22:52 PM UTC-5 ext...@gmail.com wrote:
Thanks all , especially Jezzaaaa for his first answer.

Given the fact I have other issues with my other NAS (Dell Power Edge T20 , the disks are too hot there) , I have rethinking my setup and plan to have my old good DNS-320 turn on all the time , especially as the disks can be spindown , with drives sleeping , I think the whole power consumption should not very huge , actually I don't know how the Dlink consume (I can know it as the smart plug I planned to use to turn on the dlink can give power consumption). 

That being said , to make this post even better , I promise to do the test , verify the smart plug can wake up the Dlink shutdown by the schedule task as well as indicate power consumption of everything.

Thanks again for this thread.

See ya

XT


Le jeudi 20 mai 2021 à 18:22:51 UTC+2, João Cardoso a écrit :
On Wednesday, May 19, 2021 at 8:53:48 PM UTC+1 gilles.m...@gmail.com wrote:
Le mer. 19 mai 2021 à 19:50, João Cardoso <whoami...@gmail.com> a écrit :

You said: "According to <https://github.com/martin-vi/dns320_alarm>, the DNS320-revA is just the "L" version but with less RAM."
That is incorrect, according to the info I collected at the time (I have neither a DNS-320 rev-A nor rev-B box). It is correct for the DNS-320-rev-B.
In Alt-F, the rev-A does not use the dns320l-daemon, instead it uses a shell script, /usr/sbin/dns320-temp.sh, only for reading the temperature. That script is an adaptation of Lentin's findings, see https://jamie.lentin.co.uk/devices/dlink-dns325

to terminate services and unmount filesystems, then cut power using a smart plug? That way, the power is cut rather than powering itself down, yet no risk of filesystem corruption. I think this can be achieved by running /etc/init.d/rcE after ensuring /boot/.poweroff is removed?

Roughly, but to do a clean shutdown without actually powering itself down it is enough to call /usr/sbin/halt in a cronjob. That calls rcE, which orderly shuts down the system and then just halts the system (theoretically stopping the processor).

Only a DNS-320-rev-A owner can confirm that if at that point power is cut and restored the box will power up.

I confirm it works on my DNS-320-rev-A : after calling halt, waiting, and unplugging the cord, the system powered up again when the cord was plugged back in.

Thanks for confirming that.

So, XT can setup a cron job (Services->System, cron, Configure) to halt the box (using the /usr/sbin/halt command) a few minutes before the smart plug cuts power.
 

Best regards.
--
You received this message because you are subscribed to the Google Groups "Alt-F" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alt-f+un...@googlegroups.com.

tera...@gmail.com

unread,
Mar 11, 2023, 3:10:04 AM3/11/23
to Alt-F
Hello. Did you make it work? I am struggling with the same problem.
Reply all
Reply to author
Forward
0 new messages