[Request] improvement to wireless AP+Client mode

Suggest improvements and new features for Gargoyle.

Moderator: Moderators

larcy
Posts: 16
Joined: Fri Aug 23, 2013 2:43 am

Re: [Request] improvement to wireless AP+Client mode

Post by larcy »

OK, worked out a workaround to do this if anyone else needs it

Only problem is, you need two routers. But one could be that old slow router you have lying around with no other use I guess

So the problem is a bug/feature in Gargoyle means that when using the router downstream configured as a gateway in client/AP mode, and using the router to wirelessly connect to an upstream router to get internet and having the downstream router then act as a wireless AP for clients, the downstream router will drop its wifi if/when the connection to the upstream router goes down for any reason. Since there is no wifi you then have to connect to it via a cable to see what is going on, fine if you can get to it, but if it is installed high up somewhere not always very practical

The workaround is to use two routers next to each other connected via a cable, we'll call them router 1 and router 2.
Configure router 1 as a wireless AP only, i.e in the configuration settings
configure device as = gateway
internet/ wan = DHCP wired
local network/LAN router IP = 192.168.x.1 (or other appropriate setting). The important thing is that x is different from the other 2 subnets on the upstream router and router 2
Wireless/wireless mode = AP access point, with SSID name/password/security etc as you wish

Connect a cable between the WAN port of router 1 and a LAN port of router 2

Configure router 2 as a client or client /AP depending what router you want to use for your wifi clients to connect to, i.e in the configuration settings
configure device as = gateway
internet/ wan = DHCP wireless
local network/LAN router IP = 192.168.y.1 (or other appropriate setting). The important thing is that y is different from the other 2 subnets on the upstream router and router 1
Wireless/wireless mode = AP access point or Client+AP, with SSID name/password/security etc as you wish

So now router 1 will always remain up and if router 2 loses its upstream link then ,since the bug only affects wireless, you will still be able to connect to router 2 by connecting wirelessly to router 1 and putting router 2's IP address into a browser. With no need to run a cable to it

Downside is you now have 2 routers sitting on a wall somewhere and maybe some performance degradation but at least you can always connect to them

Of course this wouldn't be needed if Gargoyle didn't have this bug, but at least there is a workaround

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

Re: [Request] improvement to wireless AP+Client mode

Post by Lantis »

Great inventive thinking.
Let me clarify something though. This problem is due to the operation of hostapd. Which is a product of openwrt. Not gargoyle.

I am working on a workaround that only requires 1 router. It doesn't modify the behaviour, simply allows for easier recovery.

So, again.
Openwrt problem. Not gargoyle.
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.

iain
Posts: 1
Joined: Sat Jul 23, 2016 11:10 am

Re: [Request] improvement to wireless AP+Client mode

Post by iain »

I've found another workaround to this problem on my HooToo Tripmate TM02, thanks to the helpful people at the OpenWrt forum.

Add to /etc/config/system :

Code: Select all

config button 'clear_wlan_button'
	option button 'reset'
	option action 'released'
	option handler 'logger clear_wlan ; /usr/lib/gargoyle/clear_wlan.sh ;'
	option min '1'
	option max '3'
And create file with correct permissions /usr/lib/gargoyle/clear_wlan.sh :

Code: Select all

#!/bin/sh
mode=$(uci -q get wireless.'stacfg'.mode)
if [ "$mode" = "sta" ]; then
        uci delete wireless.'stacfg'
        uci commit wireless
        uci commit network
        wifi
fi
(Don't know if the above is technically correct, today is the first time I've ever looked at bash code or whatever it is!) but it works for me.

Now with a short press of the reset button (1-3 seconds), it changes the WAN connection to DHCP (wired), thus reinstating the access point.

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

Re: [Request] improvement to wireless AP+Client mode

Post by Lantis »

That's a great and simple solution :)
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.

larcy
Posts: 16
Joined: Fri Aug 23, 2013 2:43 am

Re: [Request] improvement to wireless AP+Client mode

Post by larcy »

iain wrote:I've found another workaround to this problem on my HooToo Tripmate TM02, thanks to the helpful people at the OpenWrt forum.

Add to /etc/config/system :

Code: Select all

config button 'clear_wlan_button'
	option button 'reset'
	option action 'released'
	option handler 'logger clear_wlan ; /usr/lib/gargoyle/clear_wlan.sh ;'
	option min '1'
	option max '3'
And create file with correct permissions /usr/lib/gargoyle/clear_wlan.sh :

Code: Select all

#!/bin/sh
mode=$(uci -q get wireless.'stacfg'.mode)
if [ "$mode" = "sta" ]; then
        uci delete wireless.'stacfg'
        uci commit wireless
        uci commit network
        wifi
fi
(Don't know if the above is technically correct, today is the first time I've ever looked at bash code or whatever it is!) but it works for me.

Now with a short press of the reset button (1-3 seconds), it changes the WAN connection to DHCP (wired), thus reinstating the access point.
The only problem with this solution is that it still requires physical access to the router?

tapper
Moderator
Posts: 1076
Joined: Sun Oct 13, 2013 5:49 pm
Location: Stoke-on-trent UK

Re: [Request] improvement to wireless AP+Client mode

Post by tapper »

you could try installing ping wotchdog and wen pings fail to mane router set it to run script.
Linksys WRT3200ACM
NETGEAR Nighthawk R7800
NETGEAR R6260

larcy
Posts: 16
Joined: Fri Aug 23, 2013 2:43 am

Re: [Request] improvement to wireless AP+Client mode

Post by larcy »

tapper wrote:you could try installing ping wotchdog and wen pings fail to mane router set it to run script.
That is true. However problem with that approach is that if the upstream connection is intermittent, then a failure in the upstream connection would result in the router going into DHCP (wired) mode, thus preventing it from automatically reconnecting wirelessly to the upstream router.

The true answer is to fix the bug/feature that makes the AP part go down if connection to the upstream router is lost, i.e AP should stay up regardless of state of upstream router. However previous posters have pointed out that is caused by OpenWRT not Gargoyle so might be some time before it gets fixed.

Post Reply