User scripts upon button press and LEDs

  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

b0ngz

New Around Here
Hello,

I just bought a AC68U that will replace a WRT160v3 running DDWRT.

I'd like to migrate a script that runs when the SES\WPS button on the wrt160v3 in DDWRT is pressed. I read the WIKI post about user scripts but I didn't find a section regarding scripts that get executed when a certain button is pressed. Is there a way to activate a script upon pressing the WPS button?

I'm also having a hard time understanding how to control the LEDs on the AC68U and can't find its GPIO documentation where it states LED colors supported along with their assigned values. executing gpio in SSH returns "not found".

Thanks in advance for any comments given!
 

RMerlin

Asuswrt-Merlin dev
Hello,

I just bought a AC68U that will replace a WRT160v3 running DDWRT.

I'd like to migrate a script that runs when the SES\WPS button on the wrt160v3 in DDWRT is pressed. I read the WIKI post about user scripts but I didn't find a section regarding scripts that get executed when a certain button is pressed. Is there a way to activate a script upon pressing the WPS button?

I'm also having a hard time understanding how to control the LEDs on the AC68U and can't find its GPIO documentation where it states LED colors supported along with their assigned values. executing gpio in SSH returns "not found".

Thanks in advance for any comments given!


There's no user script linked to the WPS or reset button at this time.

The gpio command isn't implemented. Use the led_ctrl command instead, as not all LEDs are controlable through GPIO anyway.

Code:
led_ctrl lednumber state

led definitions:
Code:
#define LED_POWER                       0
#define LED_USB                         1
#define LED_WPS                         2
#define FAN                             3
#define HAVE_FAN                        4
#define LED_LAN                         5
#define LED_WAN                         6
#ifdef RTCONFIG_LED_ALL
#define LED_ALL                         0xFE
#endif
#define LED_2G                          7
#define LED_5G                          8
#define LED_USB3                        9
#ifdef RTCONFIG_LAN4WAN_LED
#define LED_LAN1        10
#define LED_LAN2        11
#define LED_LAN3        12
#define LED_LAN4        13
#endif
#define LED_TURBO                       14
#ifdef RTCONFIG_QTN
#define BTN_QTN_RESET                   15
#endif
#define LED_SWITCH                      20
#define LED_5G_FORCED                   21      // Will handle ledbh & nvram flag

state is either 0 or 1.
 

ml70

Regular Contributor
If WPS button is configured as radio-on/off button, could it also include one 'sync' command? It'd be nice for cases when router is unresponsive and needs to be forcefully shut down.
 

b0ngz

New Around Here
Thank you very much for the detailed reply and the time you've dedicated on the firmware Rmerlin.
 

RMerlin

Asuswrt-Merlin dev
If WPS button is configured as radio-on/off button, could it also include one 'sync' command? It'd be nice for cases when router is unresponsive and needs to be forcefully shut down.

If it's unresponsive, then it most likely won't be able to run a sync command (or any other script either). Otherwise, you could do the same thing just through SSH.
 

ml70

Regular Contributor
If it's unresponsive, then it most likely won't be able to run a sync command (or any other script either). Otherwise, you could do the same thing just through SSH.

Unresponsive as in not being able to telnet or ssh in...yes it happens sometimes, routing and running apps (dl master/transmission) still work but can't get in; user fault but that's exactly why the sync would be nice, to minimize chances of any permanent corruption.
 

Similar threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top