Correct / most sensible way to disable reset button

Hi,

I have an Archer C7 v2. It has a reset/WPS button which is protruding from the router. Per default, it resets the router when running OpenWRT.

It is way too easy to push this button when cleaning, dusting, adjusting antenna (it's next to one of the antennas and I often accidentally know over the antenna).

While I think it is a bit... cumbersome to have such a sensitive reset button per default (IMHO it should require some time of holding down, say 5-10 seconds) -

what would be the most correct way to disable the reset button? Better yet, just in case I actually need the reset functionality, disable short presses but actually perform a reboot if it's being held down?

As a quick & dirty workaround editing /etc/rc.button/reset is suggested: Is it possible to disable reset button?

This page is confusing the hell out of me: https://openwrt.org/docs/guide-user/hardware/hardware.button - I suppose I could figure it out by some trial and error.

Is there a luci-app-* for controlling hardware buttons?

# ls -l /sys/firmware/devicetree/base/keys
-r--r--r--    1 root     root            10 Mar  2 21:07 compatible
-r--r--r--    1 root     root             5 Mar  2 21:07 name
drwxr-xr-x    2 root     root             0 Mar  2 21:07 reset
drwxr-xr-x    2 root     root             0 Mar  2 21:07 rfkill

I concluded the "reset" button is a procd button and only runs /etc/rc.buttons/reset and there is no way to change that?

But looking at the script it seemed quite straightforward to change the value it needs to be pressed for anything to happen.

With the following modification, reset only happens if held down for more than 5 seconds, and factory reset with more than 30 seconds. The logger does not seem to function from this script (a permissions issue?), but I just put it in there for testing. I'm not sure when the timeout happens. The buttons page doesn't link to relevant documentation, which would be nice indeed.

But the main goal is achieved: I don't get reboots when physically working around the router and moving it!

#!/bin/sh

. /lib/functions.sh

OVERLAY="$( grep ' /overlay ' /proc/mounts )"

case "$ACTION" in
pressed)
        [ -z "$OVERLAY" ] && return 0

        return 30
;;
timeout)
        . /etc/diag.sh
        set_state failsafe
;;
released)
        if [ "$SEEN" -lt 5 ]
        then
                logger "PWS/RESET button pressed for less than 5 seconds"
        if [ "$SEEN" -ge 5 -a "$SEEN" -lt 15 ]
        then
                echo "REBOOT" > /dev/console
                sync
                reboot
        elif [ "$SEEN" -ge 15 -a -n "$OVERLAY" ]
        then
                echo "FACTORY RESET" > /dev/console
                jffs2reset -y && reboot &
        fi
;;
esac

return 0

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.