Solved: Archer C7 Wifi button

Report problems and success stories with Gargoyle on various hardware platforms.

Moderator: Moderators

Adamon
Posts: 20
Joined: Tue Sep 06, 2016 5:17 am

Re: Archer C7 Wifi button

Post by Adamon »

Hello Lantis,
I don't see any difference to the already existing gargoyle_button_handler:

Code: Select all

cat gargoyle_button_handler 
#!/bin/sh

. /lib/functions.sh
do_button () {
        local button
        local action
        local handler
        local min
        local max

        config_get button $1 button
        config_get action $1 action
        config_get handler $1 handler
        config_get min $1 min
        config_get max $1 max

        [ "$ACTION" = "$action" -a "$BUTTON" = "$button" -a -n "$handler" ] && {
                [ -z "$min" -o -z "$max" ] && eval $handler 
                [ -n "$min" -a -n "$max" ] && {
                        [ $min -le $SEEN -a $max -ge $SEEN ] && eval $handler 
                }
        }
}
config_load system
config_foreach do_button button
All files in this directory point to it:

Code: Select all

ls -l
lrwxrwxrwx    1 root     root            23 Jul  7 23:55 failsafe -> gargoyle_button_handler
-rwxr-xr-x    1 root     root           523 Jul  7 22:40 gargoyle_button_handler
lrwxrwxrwx    1 root     root            23 Jul  7 23:55 power -> gargoyle_button_handler
lrwxrwxrwx    1 root     root            23 Jul  7 23:55 reset -> gargoyle_button_handler
lrwxrwxrwx    1 root     root            23 Jul  7 23:55 rfkill -> gargoyle_button_handler
lrwxrwxrwx    1 root     root            23 Jul  7 23:55 wps -> gargoyle_button_handler
And, please forgive a newbie, how, do I run a logread? I tried

Code: Select all

logread -f
Nothing returned
and

Code: Select all

logread |grep user
Tue Sep  6 20:00:44 2016 user.notice root: vsftpd init: mounted = 0
Tue Sep  6 20:00:44 2016 user.emerg syslog: ERROR: No drives attached, no directories to share!
Tue Sep  6 20:00:44 2016 user.emerg syslog: setting up led USB1
Tue Sep  6 20:00:44 2016 user.emerg syslog: setting up led USB2
Tue Sep  6 20:00:44 2016 user.emerg syslog: setting up led WLAN2G
Tue Sep  6 20:00:44 2016 user.emerg syslog: setting up led WLAN5G
Wed Sep  7 08:40:31 2016 user.notice firewall: Reloading firewall due to ifup of wan6 (eth0)
Wed Sep  7 08:40:43 2016 user.notice firewall: Reloading firewall due to ifup of wan (pppoe-wan)
Same output when I pushed the button on or off. Is this what you meant?

Adamon
Posts: 20
Joined: Tue Sep 06, 2016 5:17 am

Re: Archer C7 Wifi button

Post by Adamon »

Mmh, strange, your script is different. I replaced the exiting one with Lantis one, it required a reboot of both router and PC and then

Code: Select all

logread |grep user
Wed Sep  7 20:50:15 2016 user.notice firewall: Reloading firewall due to ifup of wan (pppoe-wan)
I am lost. Completely.

Lantis
Moderator
Posts: 6753
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Archer C7 Wifi button

Post by Lantis »

Yes my version had 1 line different.

Just for a sanity check, can you please press the WPS button and then run another logread and see if it is shown?


I think we have reached the compiling new firmware stage.
I'll try and do a test run first
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

Adamon
Posts: 20
Joined: Tue Sep 06, 2016 5:17 am

Re: Archer C7 Wifi button

Post by Adamon »

Lantis wrote:Yes my version had 1 line different.
I checked both gargoyle_button_handler again, could not find any difference....

Adamon
Posts: 20
Joined: Tue Sep 06, 2016 5:17 am

Re: Archer C7 Wifi button

Post by Adamon »

Lantis wrote:Just for a sanity check, can you please press the WPS button and then run another logread and see if it is shown?
- with "logread -f" no output at all, neither by switching the wifi nor the wps button
- I noticed that the GUI pretends that plugin-gargoyle-logread ist not installed.
- I ran "opkg install plugin-gargoyle-logread", reboutet router and PC. Then did another logread. No difference.

Am I running logread ('logread -f') properly?

Lantis
Moderator
Posts: 6753
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Archer C7 Wifi button

Post by Lantis »

You're getting way ahead of yourself.

Logread is a base function. Just type "logread" like I've said every other time. No extra switches, greps or other malarkey.
You don't require the logread gargoyle plugin.
Further on gargoyle plugins, please only install them using the GUI. Using the command line incorrectly (as you did) will make it much harder to remove and modify later. If you are interested in installing them correctly using the command line, the correct script is at /usr/lib/gargoyle/install_gargoyle_package.sh which requires parameters.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

Adamon
Posts: 20
Joined: Tue Sep 06, 2016 5:17 am

Re: Archer C7 Wifi button

Post by Adamon »

Lantis wrote:Further on gargoyle plugins, please only install them using the GUI. Using the command line incorrectly (as you did) will make it much harder to remove and modify later. If you are interested in installing them correctly using the command line, the correct script is at /usr/lib/gargoyle/install_gargoyle_package.sh which requires parameters.
Ooops, that's quite unusual.

Adamon
Posts: 20
Joined: Tue Sep 06, 2016 5:17 am

Re: Archer C7 Wifi button

Post by Adamon »

Lantis wrote:Logread is a base function. Just type "logread" like I've said every other time. No extra switches, greps or other malarkey.
Thank you for clarification. "grep" facilitates the identfication from long outputs. However, I used "logread" both with and without it and compared the output then. There was no difference, so I just presented the shorter output.

Adamon
Posts: 20
Joined: Tue Sep 06, 2016 5:17 am

Re: Archer C7 Wifi button

Post by Adamon »

Meanwhile I found another thread on this topic on the openwrt forum (https://forum.openwrt.org/viewtopic.php?id=66174).

It confirms in principle my reluctance to do a build myself. Apparently, things can go wrong fairly easily.

Lantis, your guidance is appreciated!

Lantis
Moderator
Posts: 6753
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Archer C7 Wifi button

Post by Lantis »

5th line from the end there is a modification to the script you mentioned by the way which facilitates the log output for the switch events.
That is pretty important otherwise we won't see anything.

I'll do a build with a relevant patch and see how we go. 99% sure it won't fail. It's not too hard to fix if it does anyway
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

Post Reply