OpenWrt Forum Archive

Topic: How can I misuse the SecureEasySetup Button?

The content of this topic has been archived on 7 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi Guys!

I am using the WRT54G Router (the one with the SecureEasySetup button).
Maybe it was a nice idea with this SES, but i do not need it. So, I have an unused button.

Maybe, you can help me to change this! Wouldn't it be nice to use this button for enabling/disabling WLAN radio?
For example:
I don't want to have the WLAN radio activated all the time because of several reasons.
That's why I've disabled it by default.

So, if I want to use WLAN with my laptop, I have to boot up my PC, that I am able to start WLAN radio.
Use WLAN with my Laptop; afterwards shutdown Laptop, WLAN and PC when I am finished with work.
This is very long winded (and silly).
It could be shortened with one "click" on SES button to activate and one "click" to deactivate radio.

Can you tell me how I can do this "mod" ? Or even where to begin?
Oh, and yes, I am a newbie ;-)

Thanks!

Search? There are other threads also but this is the one that popped right up.

- DL

You are right.
I found some threads in which people were thinking about it, showing code-snippets and packages.
Also I read about the idea to implement this feature in official openwrt release.
(wifi on/off via front button or reset button)

The problem is, I do not know what to do / where to place such code-snippets or howto use such a package.
Who can tell me if it is really planned to build in this feature in an new openwrt release? This would solve my problem easily.
Sorry, but I am completely new in this stuff.

If you want to use the packages in order to use the button for wifi on/off, just execute on your box:

ipkg install http://www.ethernal.org/openwrt/gpio_0.1-1_mipsel.ipk
ipkg install http://www.ethernal.org/openwrt/cisco-button_0.1-3_mipsel.ipk

Then, reboot and that's it.

(Last edited by jochen on 14 Jan 2006, 18:08)

jochen wrote:

If you want to use the packages in order to use the button for wifi on/off, just execute on your box:

ipkg install http://www.ethernal.org/openwrt/gpio_0.1-1_mipsel.ipk
ipkg install http://www.ethernal.org/openwrt/cisco-button_0.1-3_mipsel.ipk

Then, reboot and that's it.

OK.
Will it work for WRT54GL v1.0 on OpenWRT RC4 too?

(Last edited by booBot on 23 Mar 2006, 19:13)

booBot wrote:

OK.
Will it work for WRT54GL v1.0 on OpenWRT RC4 too?

At least, the GPIO works fine, havn't tried the ciscobutton-script

"gpio disable 2" light up the white led
"gpio enable 2" turn the white led off
"gpio enable 3" light up the orange/amber led
"gpio enable 3 " turn it off

I use it togther with my asterisk-server inside my 54GL:

Orange/amber: one or more incoming calls
White: one or more new voicemail messages

I havn't yet found a good way to detect if a call is missed or aswered so the orange led lights up in both cases.

EDIT: Now I tried the cisco-button-script and it worked just fine on my WRT54GL

(Last edited by mattiasc on 26 Mar 2006, 21:09)

I did this on RC5.
What else (beyond ipkg and reboot) should I do?

The button is not lit, it does not sence my pressings, the WiFi is always ON (according to it's LED).

Digging deeper...

root@OpenWrt:~# /etc/init.d/S60cisco-button start
root@OpenWrt:~# /usr/sbin/gpio: can't load library 'libgcc_s.so.1'
/usr/sbin/gpio: can't load library 'libgcc_s.so.1'

How solve this?

Is this what I miss?

Digging deeper still...
Yes, libgcc_3.4.4-8_mipsel.ipk is needed.

Now, how do I make S60cisco-button to start with "start" parameter?

----------------------

OK, one extra reboot with all dependancies resolved made this button working.

This is what I see in ps:

460 root        388 S   /bin/sh /usr/sbin/cisco-button
471 root        232 R   /usr/sbin/gpio poll 4
472 root        396 S   /bin/sh /usr/sbin/cisco-button

Hope this is normal.
Please comment.

By the way, with WiFi disabled I get POWER LED blinking as discussed elsewhere.
Hope this is normal too.

(Last edited by booBot on 5 Apr 2006, 14:12)

I'm really puzzled.
Why this script works at all?

root@OpenWrt:~# cat /etc/init.d/S60cisco-button
#!/bin/sh

case "$1" in
   start)
      /usr/sbin/cisco-button &
      ;;
   stop)
      # Horrible hack, but will kill the polling gpio..
      # as well as any others.. :)
      killall gpio
      ;;
   *)
      echo "Usage: $0 {start|stop}"
      exit 1
esac

exit 0

I can't see how it gets it's start parameter...

Sorry for making fuss out of nothing - I came from QNX4 world where there is no rc.d conception at all.

Do I get it right - all /etc/init.d/ scripts are given their start parameters by boot-process?

(Last edited by booBot on 10 Apr 2006, 21:44)

In the System-V world, a high-level script starts all these and passes a "start" to them.

Thank you, vincentfox.
Could you give a hint why ps shows two instances of cisco-button processes?

It all works OK but I'd like to scrap all unnesessary processes out...

(Last edited by booBot on 11 Apr 2006, 13:27)

Perhaps you started more than one?  I notice your script doesn't check if there are existing processes before starting a new instance. Traditionally in startup scripts they use something like recording a PID file when a process is started.  Then your script checks for either the PID file or the process already in the table, before starting a new one.

No, I did not start them manually - I just installed the packages and what they depend on - and rebooted. Rebooted several times - always these two instances...

And I can see only one /etc/init.d/S60cisco-button there...

OK.
This is not due to how it is started.

It is somehow from this line in /usr/sbin/cisco-button script:

$gpio poll $cisco_button | while read value;do

A sort of spawns another process (gpio) and waits for it's output.
I have to learn more about bash I believe...
(In QNX4 I'm used to ksh)

(Last edited by booBot on 11 Apr 2006, 17:55)

The discussion might have continued from here.