ericpaulbishop / gargoyle

Gargoyle Router Management Utility
http://www.gargoyle-router.com
468 stars 221 forks source link

New plugin - Gargoyle STA Manager #836

Closed lantis1008 closed 4 years ago

lantis1008 commented 4 years ago

A Gargoyle variant of the popular "Travelmate" by Dirk Brenken @dibdot. This is a rewrite of that application specifically for use with the Gargoyle web interface. Core differences include how the config files are used and some of the internal logic/features. Some of these features will be reintroduced in subsequent versions after initial crowd testing.

image

In v1.1.0 the ability to scan for networks in range and add them without having to type out information manually will be introduced. In v1.2.0 the ability to automatically scan and connect to open networks will be introduced. In v1.3.0 the ability to check for internet connectivity on connection, and actively disconnect if it is not detected will be introduced.

This PR will sit open for a few days waiting feedback before i merge it.

dibdot commented 4 years ago

Great, that you finally did it! Thanks for sharing! :+1:

obsy commented 4 years ago
root@Gargoyle:~# uci show gargoyle_stamgr
gargoyle_stamgr.global=gargoyle_stamgr
gargoyle_stamgr.global.max_retry='3'
gargoyle_stamgr.global.max_wait='45'
gargoyle_stamgr.global.disconnect_quality_threshold='50'
gargoyle_stamgr.global.connect_quality_threshold='70'
gargoyle_stamgr.global.blacklist_timer='600'
gargoyle_stamgr.global.enabled='1'
gargoyle_stamgr.stamgr_ap_1=stacfg
gargoyle_stamgr.stamgr_ap_1.radio='radio0'
gargoyle_stamgr.stamgr_ap_1.ssid='xxxxx'
gargoyle_stamgr.stamgr_ap_1.encryption='psk2'
gargoyle_stamgr.stamgr_ap_1.key='1234567890'

root@Gargoyle:~# uci show wireless
wireless.radio0=wifi-device
wireless.radio0.type='mac80211'
wireless.radio0.channel='11'
wireless.radio0.hwmode='11g'
wireless.radio0.path='platform/ar933x_wmac'
wireless.radio0.htmode='HT20'
wireless.radio0.noscan='1'
wireless.stacfg=wifi-iface
wireless.stacfg.device='radio0'
wireless.stacfg.mode='sta'
wireless.stacfg.network='wan'
wireless.stacfg.ssid='ExistingWireless'
wireless.stacfg.encryption='none'

and...

Mon Jul  1 22:49:24 2019 user.info Gargoyle STA Manager: Starting...
Mon Jul  1 22:49:25 2019 user.debug Gargoyle STA Manager: Loaded global = gargoyle_stamgr
Mon Jul  1 22:49:25 2019 user.debug Gargoyle STA Manager: Loaded stamgr_ap_1 = stacfg
Mon Jul  1 22:49:25 2019 user.debug Gargoyle STA Manager: Loaded  =
Mon Jul  1 22:49:25 2019 user.info Gargoyle STA Manager: Loaded 1 STA configs from gargoyle_stamgr
Mon Jul  1 22:49:25 2019 user.debug Gargoyle STA Manager: STA section IDs: stamgr_ap_1
Mon Jul  1 22:49:25 2019 user.debug Gargoyle STA Manager: 2.4GHz radio: radio0. 5GHz radio:
Mon Jul  1 22:49:25 2019 user.info Gargoyle STA Manager: Disabled. Exiting...

Why disabled?

obsy commented 4 years ago

Why Config ID is printed? This gives no information to the user.

obsy commented 4 years ago

And bug for single band AP:

a

There is no radio1 in my device.

lantis1008 commented 4 years ago

Line 41 of /usr/lib/gargoyle/gargoyle_stamgr.sh Change $pkgname to 'global' I think will fix not loading. I think that's a typo from me.

obsy commented 4 years ago

BTW: enable checkbox should be active only if stacfg exists (== wifi configured as client)?

lantis1008 commented 4 years ago

Couple of points:

  1. Config ID is printed to user because it is the easiest way to distinguish different APs quickly to them. In the future i may change this to allow it to be a personalised name of the connection or a "friendly" name.
  2. I'll disable WPA3 where necessary
  3. I'll disable extra radios where necessary
  4. I'll fix the enable checkbox. The script has an auto terminate condition for this already, but it makes sense from a GUI point of view

Thanks for your feedback as always :)

lantis1008 commented 4 years ago

Latest fixes added. I might end up squashing all of these commits at some point before merge. Note i haven't actually runtime tested the latest fixes. I'll be able to test tomorrow but it should be ok.

obsy commented 4 years ago

If I add some AP with wrong password, sta manager display status as green for a while. But this is not true, there is no connection at all.

obsy commented 4 years ago

And lot of bugs:

Thu Oct 24 23:25:15 2019 daemon.err sh[25474]: No such wireless device: radio1
Thu Oct 24 23:25:31 2019 daemon.err sh[25474]: No such wireless device: wlan0
Thu Oct 24 23:25:31 2019 kern.info kernel: [ 1985.596388] IPv6: ADDRCONF(NETDEV_UP): tmp.radio0: link is not ready
Thu Oct 24 23:25:33 2019 daemon.err sh[25474]: No such wireless device: radio1
Thu Oct 24 23:25:49 2019 daemon.err sh[25474]: No such wireless device: wlan0
Thu Oct 24 23:25:49 2019 kern.info kernel: [ 2003.596258] IPv6: ADDRCONF(NETDEV_UP): tmp.radio0: link is not ready
Thu Oct 24 23:25:51 2019 daemon.err sh[25474]: No such wireless device: radio1
Thu Oct 24 23:26:07 2019 daemon.err sh[25474]: No such wireless device: wlan0
Thu Oct 24 23:26:07 2019 kern.info kernel: [ 2021.566531] IPv6: ADDRCONF(NETDEV_UP): tmp.radio0: link is not ready
Thu Oct 24 23:26:09 2019 daemon.err sh[25474]: No such wireless device: radio1
Thu Oct 24 23:26:25 2019 daemon.err sh[25474]: No such wireless device: wlan0
Thu Oct 24 23:26:25 2019 kern.info kernel: [ 2039.556254] IPv6: ADDRCONF(NETDEV_UP): tmp.radio0: link is not ready
Thu Oct 24 23:26:27 2019 daemon.err sh[25474]: No such wireless device: radio1
Thu Oct 24 23:26:43 2019 daemon.err sh[25474]: No such wireless device: wlan0
Thu Oct 24 23:26:43 2019 kern.info kernel: [ 2057.546254] IPv6: ADDRCONF(NETDEV_UP): tmp.radio0: link is not ready
Thu Oct 24 23:26:45 2019 daemon.err sh[25474]: No such wireless device: radio1
Thu Oct 24 23:27:01 2019 daemon.err sh[25474]: No such wireless device: wlan0
Thu Oct 24 23:27:01 2019 kern.info kernel: [ 2075.516247] IPv6: ADDRCONF(NETDEV_UP): tmp.radio0: link is not ready
Thu Oct 24 23:27:03 2019 daemon.err sh[25474]: No such wireless device: radio1
Thu Oct 24 23:27:19 2019 daemon.err sh[25474]: No such wireless device: wlan0
Thu Oct 24 23:27:19 2019 kern.info kernel: [ 2093.471727] IPv6: ADDRCONF(NETDEV_UP): tmp.radio0: link is not ready
Thu Oct 24 23:27:21 2019 daemon.err sh[25474]: No such wireless device: radio1
Thu Oct 24 23:27:37 2019 daemon.err sh[25474]: No such wireless device: wlan0
Thu Oct 24 23:27:37 2019 kern.info kernel: [ 2111.456236] IPv6: ADDRCONF(NETDEV_UP): tmp.radio0: link is not ready
Thu Oct 24 23:27:39 2019 daemon.err sh[25474]: No such wireless device: radio1
Thu Oct 24 23:27:55 2019 daemon.err sh[25474]: No such wireless device: wlan0
Thu Oct 24 23:27:55 2019 kern.info kernel: [ 2129.436391] IPv6: ADDRCONF(NETDEV_UP): tmp.radio0: link is not ready
Thu Oct 24 23:27:57 2019 daemon.err sh[25474]: No such wireless device: radio1
Thu Oct 24 23:28:13 2019 daemon.err sh[25474]: No such wireless device: wlan0
Thu Oct 24 23:28:13 2019 kern.info kernel: [ 2147.416381] IPv6: ADDRCONF(NETDEV_UP): tmp.radio0: link is not ready
Thu Oct 24 23:28:15 2019 daemon.err sh[25474]: No such wireless device: radio1
lantis1008 commented 4 years ago

All outstanding issues resolved. Console log is cleaned up.

dibdot commented 4 years ago

@lantis1008 the latest change redirect errors to stdout, is this the intended behaviour? I think you should redirect to /dev/null instead.

lantis1008 commented 4 years ago

Works ok in the piped instance (obviously) but not the first one. Didn't pay enough attention there. Thanks

ispyisail commented 4 years ago

I assume the STA manager is only for WiFi

It would be really good if we could add "WAN" and/or "3G/4G"

If the WAN goes down the cell phones network would take over or even hotspot from you cell phone

lantis1008 commented 4 years ago

That's right. Its for managing multiple upstream APs that you might want to connect to. I can look at some kind of failover. From memory cezary already has a plugin in his repository.

obsy commented 4 years ago

No, I have never had it. If necessary, I use mwan3.

lantis1008 commented 4 years ago

Merged. Will now handle any bug reports after more user testing. Will do a wiki write up at some point.