PDA

Bekijk de volledige versie : Detecting EZSetup button press ?



scriptman
30-12-2006, 23:21
Hi all,

I want use the EZSetup button on the rear of my WL550GP as an input trigger for a script I have written and the PWR or AIR LED as a status indicator.

My question is how do I detect an EZSetup button press and how can I take control of the PWR and AIR LEDs?

Can I use “nvram get” to detect a EZSetup button press and can I use a “nvram set” to use one of the front LEDs?

The router is using oleg's firmware.

Any help would be greatly appreciated :o

Barefoot
02-01-2007, 14:48
I am sorry, I have no idea how to do it, but I am also extremely interested into this. It would solve my "power off safely" problem, because I could use the button to unmount the HDD. Nice idea, let's wait for a solution. :-)

scriptman
02-01-2007, 22:06
It would be nice if we could have the press of the EZbutton latched on or off ie. 1 or 0 in order for a script not to miss a press of EZSetup between port polls. (maybe Oleg can help here?:rolleyes: )

An example of that would be:

Pressing EZSetup:

Press 1: Bit in RAM gets latched to a 1
Press 2: Bit in RAM gets latched to a 0
Press 3: Bit in RAM gets latched to a 1
Etc..

It would also be necessary to have the option to reset the bit via a script using “nvram set” or similar so the script can acknowledge that the key was pressed.

SM

cyrax
21-03-2007, 19:47
if you still need one - check this link out - it is in russian, but look for a script named mini-cron
http://wl500g.info/showthread.php?t=8403

Barnosch
22-03-2007, 01:57
have you had a look at the big database or forum of OpenWRT?
Maybe they have a solution.

cyrax
22-03-2007, 08:44
have you had a look at the big database or forum of OpenWRT?
Maybe they have a solution.

btw - the posted link is the solution for wl500g :) it is running on my router and requires Oleg's firmware. I do not use OpenWRT, so sorry, but I do not know if there is any equivalent available

satirac
21-08-2007, 15:27
I am sorry, I have no idea how to do it, but I am also extremely interested into this. It would solve my "power off safely" problem, because I could use the button to unmount the HDD. Nice idea, let's wait for a solution. :-)

have you found a way to unmount the disc by prsssing the ezsetup button?

Satirac

peca89
22-08-2007, 07:28
Have you read the changes and news in 1.9.2.7-7g firmware?


24. Pressing EZ SETUP button for 3 seconds would cause /usr/local/sbin/ez-setup to be executed

Simply add something like umount /opt line in /usr/local/sbin/ez-setup

satirac
22-08-2007, 18:30
OK. I edited the "/usr/local/sbin/ez-setup" with vi. But when i write


umount /opt

and press the red button on the backside of the router (three or more seconds) nothing happens. That have probertly the reason that my samba server is still running. So i replaced it with


killall smbd
killall nmbd

but that doesent work too. What exactly should i write in the "ez-setup"? Or must i restart the router before it can work? I am a very linux beginner so please be patiant with me and dont hate me for for my stupid questions. And please dont blame me with my "english"

Satirac

edit: ok, i restarted the router with

flashfs save && flashfs commit && flashfs enable && reboot
but nothing changes...

peca89
23-08-2007, 07:27
Have you made the script executable?

chmod +x /usr/local/sbin/ez-setup
Does your script begin with #!/bin/sh

First of all you need to find out where the problem is. You need to check if script is executed at all and then check if there is a problem with commands within the script.

To check if the script is executed, just make it look something like

#!/bin/sh
touch /opt/share/hello make it executable, save with flashfs...... and reboot. If the script is working properly, you should be able to find a file named "hello" in /opt/share

satirac
23-08-2007, 22:20
i made it executable but it doesnt beginn with


#!/bin/sh

your "test-skript" works fine. Now i'll try to write a skript to stop samba and transmission and unmount my hdd

Thank you very much

Satirac