Re: [Howto](AAP) Automated Wifi network change if the current fails

Admittedly I was dumbfounded after reading this petulant post a good 3X.

Following instructions appears not to be a prerequiste for admission to this forum.

Nowhere in the clearly documented 7 steps is it given to 'name' a section - wifi-iface, yet there is proof -

RangerZ wrote:
config wifi-iface 'STA_name'
    option network 'wwan'
    option encryption 'psk2'
    ...

Which results in the documented initialisation failure of the section - wifi-iface network wwan -

RangerZ wrote:
...
Thu Feb 11 20:56:29 2016 user.notice DEBUG: hotplug (iface): action='ifup' devicename='' devname='' devpath='' product='' type='' interface='lan' 
Thu Feb 11 20:56:30 2016 user.notice DEBUG: hotplug (iface): action='ifup' devicename='' devname='' devpath='' product='' type='' interface='loopback'

Contrasted with -

RangerZ wrote:
...
Thu Feb 11 21:14:55 2016 user.notice DEBUG: hotplug (iface): action='ifup' devicename='' devname='' devpath='' product='' type='' interface='lan' 
Thu Feb 11 21:14:55 2016 user.notice DEBUG: hotplug (iface): action='ifup' devicename='' devname='' devpath='' product='' type='' interface='loopback' 
Thu Feb 11 21:16:08 2016 user.notice DEBUG: hotplug (iface): action='ifup' devicename='' devname='' devpath='' product='' type='' interface='wwan' 

where the section - wifi-iface network wwan is anonymous.

Here, remedial *nix is required -

RangerZ wrote:

after a few minutes i reran the log read

/etc/config$ /etc/config$ logread -e DEBUG
-ash: /etc/config$: not found

N.B. -

ash wrote:

/etc/config$: not found

/etc/config is a directory, not a command.

In all situations where placement of the hotplug filter scripts is adhered to, logger commands will write messages to the log buffer which are available to extract with logread.

HTH

Combatting ignorance since 2015.
(it's taking longer than I thought)


Be courteous to others. Search before posting

Re: [Howto](AAP) Automated Wifi network change if the current fails

Hi all,
I'd like to try the script but I can't get the code from dropbox (it says too much activities on the account so no more download).
Is there anyone who can upload the latest release somewhere ?
Thank you !

103 (edited by dabyd64 2016-04-22 20:58:27)

Re: [Howto](AAP) Automated Wifi network change if the current fails

Jay_74 wrote:

Hi all,
I'd like to try the script but I can't get the code from dropbox (it says too much activities on the account so no more download).
Is there anyone who can upload the latest release somewhere ?
Thank you !

No problem, updated links, now uploaded to Mega. The excessive openwrt firmware downloads from other thread blocked my account temporary...
There are two versions:
WifiMgr 1.0 switches the wifi network ONLY when the network fails
WifiMgr 1.0b also checks every few seconds if the preferred network is available, and switches to it if it's not connected to it already. This behaviour will cause constant drops if the preferred network fails often, as it will be switching constantly!

https://mega.nz/#F!KUcVSb6L!UvNxZlm1VsiyFAW3n6wAzA

104

Re: [Howto](AAP) Automated Wifi network change if the current fails

Hi.

Daby64, the mega account is not working.
Can you uoload your script again, pls?
Thx

Re: [Howto](AAP) Automated Wifi network change if the current fails

I have a WISP that I am trying to connect to that I have configured in wifiMgr.  The password is an obscure string starting with a $.  It is not properly parsed and the connection fails. 

I am wondering it there is a character restriction of some type or some other issue.

net7_key="$y6L&Aiz"

In Luci it returns just the last 4 characters (&Aiz).

PC-Engines ALIX 2D13 CC 15.05 RC2 (Router - OpenVPN Server)
HooToo TM02 CC 15.05 (Travel Router - OpenVPN Client)
GLi-AR150 CC15.05/GLi 2.13 (Travel Router - OpenVPN Client)
Kingston MLWG2 CC15.05 (Travel Router - OpenVPN Client, mini-DLNA)

Re: [Howto](AAP) Automated Wifi network change if the current fails

Escape the special characters.

Combatting ignorance since 2015.
(it's taking longer than I thought)


Be courteous to others. Search before posting

107 (edited by dabyd64 2016-08-22 14:24:47)

Re: [Howto](AAP) Automated Wifi network change if the current fails

+1 Escape special characters, example yours:
net7_key="\$y6L&Aiz"
https://s19.postimg.org/5t7r5ua8j/Sin_t_tulo.png

Re: [Howto](AAP) Automated Wifi network change if the current fails

Thank you!

Are there any other special characters that one needs to be aware of?  I have tested most if not all of the other non-alpha\numeric characters and not found any.  The double quote (") and apostrophe (`) put me into some other mode that I am not familiar with

root@MLWG2:~# net7_key="`6L&Aiz";echo $net7_key
>
PC-Engines ALIX 2D13 CC 15.05 RC2 (Router - OpenVPN Server)
HooToo TM02 CC 15.05 (Travel Router - OpenVPN Client)
GLi-AR150 CC15.05/GLi 2.13 (Travel Router - OpenVPN Client)
Kingston MLWG2 CC15.05 (Travel Router - OpenVPN Client, mini-DLNA)

109 (edited by bkil 2016-08-27 13:32:00)

Re: [Howto](AAP) Automated Wifi network change if the current fails

There are lots of special cases in sh that you need to be aware of. It's best to experiment on a case by case basis or use hexadecimal. I'm not familiar with the script in question, so it could also impose additional restrictions on top of what is mentioned here if quoting is not used with due diligence in the implementation.

key1="what's up?"
key2='what"s up?'
key3="what\"s up?"
key4="back\`tick"
key5=`printf "\x21hi\22there\x23"`

You could find many guides if you are interested, though I'm not sure which one to recommend:

From BASH reference manual:
Enclosing characters in double quotes (‘"’) preserves the literal value of all characters within the quotes, with the exception of ‘$’, ‘`’, ‘\’,

RangerZ wrote:

Thank you!

Are there any other special characters that one needs to be aware of?  I have tested most if not all of the other non-alpha\numeric characters and not found any.  The double quote (") and apostrophe (`) put me into some other mode that I am not familiar with

root@MLWG2:~# net7_key="`6L&Aiz";echo $net7_key
>

Re: [Howto](AAP) Automated Wifi network change if the current fails

Thanks for the links.  Good for reference.

PC-Engines ALIX 2D13 CC 15.05 RC2 (Router - OpenVPN Server)
HooToo TM02 CC 15.05 (Travel Router - OpenVPN Client)
GLi-AR150 CC15.05/GLi 2.13 (Travel Router - OpenVPN Client)
Kingston MLWG2 CC15.05 (Travel Router - OpenVPN Client, mini-DLNA)

Re: [Howto](AAP) Automated Wifi network change if the current fails

Hi! I'm very interested in your tool, but the link to mega.nz/... does not work anymore. Could you upload it again?
Thanks!

Re: [Howto](AAP) Automated Wifi network change if the current fails

Hi!
Can you please re-upload the files? because the given links are not working.
Thank you

Re: [Howto](AAP) Automated Wifi network change if the current fails

hey!

when i followed the steps specified by RangerZ's version of the package, i got a message which said that "your hardware does not support multiple ssid"

does this mean that i will not be able to use this package or that i cannot connect to more than one wifi?

im a beginner at this, please let me know.

Re: [Howto](AAP) Automated Wifi network change if the current fails

It means that the HW is not capable of hosting more than one wireless connection.  It should not be related to the package.

Worth noting your device\radio for others to be aware of.

PC-Engines ALIX 2D13 CC 15.05 RC2 (Router - OpenVPN Server)
HooToo TM02 CC 15.05 (Travel Router - OpenVPN Client)
GLi-AR150 CC15.05/GLi 2.13 (Travel Router - OpenVPN Client)
Kingston MLWG2 CC15.05 (Travel Router - OpenVPN Client, mini-DLNA)

Re: [Howto](AAP) Automated Wifi network change if the current fails

Not sure if someone else suggested this, but why not submit this as a package on GitHub?

4x TL-WR703N | 1x TL-WT1520 | 1x GL-iNet | 1x DIR-505L | 1x TL-WR841N | 1x TL-WR702N | 1x TL-WR740N | 1x WRT54G

116 (edited by dabyd64 2017-08-10 21:27:57)

Re: [Howto](AAP) Automated Wifi network change if the current fails

Jay_74 wrote:

Hi all,
I'd like to try the script but I can't get the code from dropbox (it says too much activities on the account so no more download).
Is there anyone who can upload the latest release somewhere ?
Thank you !


idefixx2 wrote:

Hi! I'm very interested in your tool, but the link to mega.nz/... does not work anymore. Could you upload it again?
Thanks!

urmitnick wrote:

Hi!
Can you please re-upload the files? because the given links are not working.
Thank you

Hi guys, my bad, I've been out for too long. Updated, new working links smile
WifiMgr
WifiMgr 1.0b
ApScan 1.0b

Re: [Howto](AAP) Automated Wifi network change if the current fails

good job. Keep it on. I wish you will upload and sort all file on GitHub.

118 (edited by jack338c 2017-08-19 12:08:42)

Re: [Howto](AAP) Automated Wifi network change if the current fails

Place this filter script in /etc/hotplug.d/iface/99-recover-STA -

#!/bin/sh
logger -t DEBUG "hotplug (iface): action='$ACTION' devicename='$DEVICENAME' devname='$DEVNAME' devpath='$DEVPATH' product='$PRODUCT' type='$TYPE' interface='$INTERFACE'"

local _wwan _wait
_wwan=$(uci -q get wireless.STA_name.interface)
[ -z "$_wwan" ] && _wwan=wwan # <-- a popular name for 'repeater STAs'
_wait=$(uci -q get wireless.STA_name.wait)
[ -z "$_wait" ] && _wait=15
if [ "$ACTION" = ifdown -a "$INTERFACE" = "$_wwan" ]; then
    /bin/sh /usr/local/bin/revert_to_AP.sh $_wait $_wwan
fi

N.B. the logger commands in the filter scripts can safely be removed but are useful with

logread -e DEBUG

Dear Max Hopper
thanks for your share this awesome script to our planet !

this is what exactly I'm looking for .

two questoin:
1 Can this project remember over 1 remote ssid?  for example: I bind ssid1 as wwan,ssid2 as wwan2..

,then I go to place from A ssid1 to B ssid2. so I need not rebind it again.

Currently I found it can only work with 1 wwan

2 once remote router get down and reboot,the repeater router will not autoreconnet again,you have to reboot it to reconnect,could you fix it?



thank you Max

Re: [Howto](AAP) Automated Wifi network change if the current fails

I'd like to try the script but I can't get the code from dropbox (it says too much activities on the account so no more download).
Is there anyone who can upload the latest release somewhere ?


Hi! I'm very interested in your tool, but the link to mega.nz/... does not work anymore. Could you upload it again?



Can you please re-upload the files? because the given links are not working.


Hi guys, my bad, I've been out for too long. Updated, new working links smile


Dear dabyd

Could you make a luci for this awesome stuff,that's will be more convenient

thank you