Welcome! Log In Create A New Profile

Advanced

Turning off Netgear Stora NAS with the Power button

Posted by tme 
tme
Turning off Netgear Stora NAS with the Power button
May 28, 2017 04:16AM
Thanks to the information available at this site, and to the great support of 'bodhi', I have successfully upgraded all my 3 Neatgear Stora NAS boxes to the latest versions of u-boot, u-boot environment, LInux and Debian. They are all running fine. Thanks, again!

There is one feature in paricular of the original stock Netgear firmware that I miss. From the user guide: "To correctly shut down your Stora, press and hold the Power button for about 5 seconds. The blue light on the front panel blinks before shutting off. If the unit is hung, press and hold the Power button to force shutdown." I do not know the other kirkwood boxes, but I assume some of them have a similar power button, and could benefit from making this feature available.

Is this a feature that can be enabled in the latest kernel (linux-4.10.9-kirkwood-tld-1 of 14 April 2017 )?
Or is there some development work that need to be done to make this work?


Regards,
Trond Melen
Re: Turning off Netgear Stora NAS with the Power button
May 28, 2017 04:43AM
Trond Melen,

Since we are running the latest kernel (not stock), we need to set up to use Power button (and other buttons) this way:

http://forum.doozan.com/read.php?2,32460,32467#msg-32467

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
tme
Re: Turning off Netgear Stora NAS with the Power button
May 28, 2017 03:43PM
Thanks bodhi, for your swift response!

I intalled 'esekeyd' and modified '/etc/default/esekeyd' to get it running at boot, and added the "dummy" actions:
root@stabburet:~# diff /etc/default/esekeyd.orig /etc/default/esekeyd     
4c4
< START_ESEKEYD=false
---
> START_ESEKEYD=true
root@stabburet:~# cat /etc/esekeyd.conf
POWER:/usr/bin/logger -s -i "POWER button pushed"
RESTART:/usr/bin/logger -s -i "RESTART button pushed"
COPY:/usr/bin/logger -s -i "COPY Button pushed"
root@stabburet:~#

I now do get "POWER button pushed" messages in the system log, but I realize that to implement the original functionality "POWER button released" information is also needed. According to the manpage, 'esekeyd' listens to '/dev/input/event0'. Release button information is indeed available on this device, but seems not to be passed on by 'esekeyd'. I believe "34+Y*" is "POWER button pushed" and "44+Y*" is "POWER button released":
root@stabburet:~# cat  /dev/input/event0
34+Yh.t34+Yh.44+Y��t44+Y��^C
root@stabburet:~#

Regards,
Trond Melen
Re: Turning off Netgear Stora NAS with the Power button
May 28, 2017 04:37PM
Trond Melen,

> believe "34+Y*" is "POWER button pushed" and "44+Y
> *" is "POWER button released":

Thanks for the info! I'll take a look at the kernel DTS for the Stora, perhaps it needs some modification.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Turning off Netgear Stora NAS with the Power button
May 28, 2017 06:05PM
Trond Melen,

Your info is a different setting (not GPIO). Power Button GPIO key is 36. And Reset Button GPIO key is 38.

So to implement these actions, GPO keys cannot be used. It probably needs to be monitored as input event data.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 2 time(s). Last edit at 05/28/2017 06:07PM by bodhi.
tme
Re: Turning off Netgear Stora NAS with the Power button
May 29, 2017 02:22PM
I'm sorry for misleading you, bodhi. This hex dump may be slightly more useful:
root@stabburet:~# cat /dev/input/event0 > /tmp/events
^C
root@stabburet:~# xxd /tmp/events
0000000: 776b 2c59 9a85 0b00 0100 7400 0100 0000  wk,Y......t.....
0000010: 776b 2c59 9a85 0b00 0000 0000 0000 0000  wk,Y............
0000020: 7c6b 2c59 1b6b 0500 0100 7400 0000 0000  |k,Y.k....t.....
0000030: 7c6b 2c59 1b6b 0500 0000 0000 0000 0000  |k,Y.k..........
root@stabburet:~# 

root@stabburet:~# cat  /dev/input/event0 > /tmp/events
^C
root@stabburet:~# xxd /tmp/events
0000000: a073 2c59 dab0 0900 0100 7400 0100 0000  .s,Y......t.....
0000010: a073 2c59 dab0 0900 0000 0000 0000 0000  .s,Y............
0000020: a573 2c59 196b 0500 0100 7400 0000 0000  .s,Y.k....t.....
0000030: a573 2c59 196b 0500 0000 0000 0000 0000  .s,Y.k..........
root@stabburet:~#

Here I twice pushed and held down the power button for 5 seconds and released it, before hitting ^C. I believe the first few bytes are time stamps.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: