wifiMgr - Tool to automaticaly select an AP(STAtion) from a list of saved APs

Yes, you hit the nail on the head. The big issue that I have with all the devices, other than the GLI with the GLI GUI, and all the solutions rely on the OpenWrt GUI that is just not usable on a phone.

That said, all my testing has been using the Luci-Wifi. I just tested the GLI GUI (once), by using Luci-Wifi to set the WWAN to disable (simulating the scenario that the last WWAN is no longer available, and the WWAN is set to disabled to allow the WLAN to work). It appears the GLI GUI does NOT update the option disabled flag from 1 to 0 when a new SSID is selected. I think this GUI will not work with wifiMgr for that reason, which is very unfortunate.

Please test and confirm.

 

 

The default OpenWrt wireless has the STA (client) listed first and the Master second. The order needs to be reversed in the wireless file. It relies on the STA interface being the wifi-iface[1]. This is not in the readme.txt file.
Can you explain that? Do I need to manually make this change before I copy the files over?

The reason I ask is, I didn’t do this step, and went in and configured 3 wifi locations. 2 are right here in my house but since I did that - the device has been extremely unstable, I can’t even get in via Ethernet.

I don’t have a GLI device yet, but am leaning towards one. I noticed there’s a “new” version out … so tempted to get it. Then I realize I’ve spent so much time/money on this travel concept. Why the hell can’t we have something solid yet?!

 

Yes!

A basic wireless file has 3 sections. the first defines the physical device. The second two define the “connections”. The sequence of these dictates which is iface[0] and iface[1]. The tool requires the STA to be the second entry, wifi-iface[1]. If not you will end up with 2 STAtions.

Easist way is to use WinScp and navigate to /etc/config and open the wireless file in the included text editor.

 

Have you tried this with your hootoo tm02? I’m having a hard time. tried twice, and it doesn’t seem to associate with anything (my cell phone hotspot, or the cable company one).

Then again for that matter, the cable co wifi has been so hard to get associated with even via LUCI. I actaully opened up a thread over at OpenWRT to see if PEBKAC or something else.

I’m going to be traveling in about a month, hoping to have this stuff licked before I get out.

 

I have not tried it with the HooToo, but have with another MT device. I have 2 radios in mine, but still expect it to work. I will try, but it may be a day or 2.

Please post your wireless, firewall, network and logs.

You might try

Disable wifiMgr

restore a known good config

edit the wireless file (making sure the AP is the first iface)

enable wifiMgr

reboot

 

well other than Optimum Wifi not workign (or sporadically working) even my cell phone hotspot is not working



Wed Mar  2 02:58:28 2016 user.notice root: WifiMgr: No usable APs found, disabling the WWAN.
Wed Mar  2 02:58:28 2016 user.notice root: WifiMgr: Checking network...
Wed Mar  2 02:58:29 2016 user.notice root: WifiMgr: Network failed. Starting network change...
Wed Mar  2 02:58:29 2016 user.notice root: WifiMgr: Performing network scan...
Wed Mar  2 02:58:48 2016 user.notice root: WifiMgr: WifiMgr: Searching available networks...
Wed Mar  2 02:59:01 2016 user.notice root: WifiMgr: No usable APs found, disabling the WWAN.
Wed Mar  2 02:59:02 2016 user.notice root: WifiMgr: Checking network...
Wed Mar  2 02:59:02 2016 user.notice root: WifiMgr: Network failed. Starting network change...
Wed Mar  2 02:59:02 2016 user.notice root: WifiMgr: Performing network scan...
Wed Mar  2 02:59:22 2016 user.notice root: WifiMgr: WifiMgr: Searching available networks...

 

can you clarify how you are starting this? safe to assume you didn’t copy over the wifimgr to /etc/init.d right?

 

LINK to Log:

The messages look consistent with what one would see when there is no available STAtion to connect to. In the pastebin however I do not see any evidence that wifiMgr is running (search on wifiMgr)

There are three files with wifiMgr in the name. The one that is just wifiMgr does go in the /etc/init.d folder.
You did not post the other files, only the logs.

Thanks,

Sorry - I reset the router a few times and didn’t have time to redo. Just did everything again, I put contents of firewall, wireless and network in one paste:

Let me know if you see anything awry.

I see one possible problem, and unclear why.

Is the WORK SSID in your wifiMgrcfg file?

In your wireless file you have

option bssid ‘[MAC Address]’ (removed the actual values)

If you manually added the WORK SSID via Luci then this is probably OK, if it is in your wifiMgrcfg then there is an issue as to why. wifiMgr should delete this.

Try deleting this line from your wireless file.

Please post your wifiMgrcfg file.

 

Hi RangerZ, great work! It work like a charm!

I have a suggestion… I scheduled a crontab job to fallback to ther first network every hour (wifiMgr.sh --force 1) and it’s working fine, but if I’m already connected to ssid1, it drop anyway the connection for few seconds, because it put wlan0 down, it scan ecc. ecc.

I’ve done this little mod to handle it…

Ciao

ema

NetChange()
{
if [ “$1” ]; then
ssid=net"$1"_ssid
eval ssid=$$ssid
msg=“Force connection to network $1: $ssid”
logger WifiMgr: $msg
echo $msg
cursid=$(uci get wireless.@wifi-iface[1].ssid)
if [ “$cursid” = “$ssid” ]; then
msg=“Already connected, nothing done!”
logger WifiMgr: $msg
echo $msg
return
fi
fi

logger WifiMgr: Performing network scan…
scanres=
ifconfig wlan0 down

Thanks for the very nice enhancement. I am not a programmer, so think I am missing something in the logic\code. Does this enhancement now run on every “ConnCheckTimer” interval? If so does it not always try to set the network to the first entry, and then if it’s not found continue through the list? Would this not bounce the network every “ConnCheckTimer” interval if the forced station is NOT available?

This issue is similar to the one that exists when the wireless is set to disabled. It bounces the wireless to set it disabled again. Would you be willing to take a stab at fixing this problem, which is at line 79-81, and should have a conditional check to see if the wireless is already disabled, if so skip, if not perform those lines?

Are you using an AR-150? If so have you tested changing the STAtion by using the GLU GUI? GLI sets the config to use WAN as opposed to WWAN, and not sure if this causes an issue. I think it’s OK if you only use this as opposed to using both the GLI GUI and Luci. If you use both you may have some interface issues I think.

Hi I had a family issue so had to put this down. The BSSID for work was from Luci, not in the wifimgrcfg I’ll post it when I get it up and running again.

<span style=“line-height: 1.5;”>Wondering if there is an issue with the HooToo.</span>

There should be no issue with the Hootoo, but I use it as one of my test STAtions so I have not installed the app on it. I want it to stay connected to where it is, and not change config if I fail it’s downstream connection.

RangerZ!

I think I found the issue - I edited the cfg file using Notepad++. When I edit/create it inside the default editor from WinSCP it works fine.

The only problem I’m seeing now is that even w. OpenVPN configured to route all traffic via the tunnel, I still have DNS leaks. On to the next thing.

Still got my eye on the MT300A .

@RangerZ

Just posting the conversation from the FW thread … the issue I have is if/when the STA is disabled during scanning - the next startup it might stay disabled. So I end up doing things like running uci commands to renable, stop wifimgr, renable from gui, etc.

I really think this relates to me using it more as a “walkabout” fw … So if i’m connected to a shop’s wifi through the unit, then drive off, it’s scanning… i get home and turn it off. Next time i turn it on, it may or may not need manual interference.

I have wifiMGR on a TP-Link device (not portable) - like when visiting family, I plug it in, and leave it plugged in. That one doesn’t have these types of issues.

SO - long story short, I may end up keeping the gli gui for the walkabout and wifiMGR for the semi-portable one. sidenote - i ordered the AR based unit. my tp-link outperforms the gli unit, hoping the AR vs MT chipset is the difference. Traveling again next week so we’ll see.

Assuming you are using windows. If you can the next time this happens try to use the clients connection manager and connect manually to the AP. If you can then please check the “Status => Details” window and look at the IP.

You may also want to connect with a LAN cable and validate that the connection is actually disabled.

I am finding that about 1 out of 5 times I somehow get the 169.254.xx.xxx range IP (I think that’s what it was). It may or may not fix itself.

Unfortunately it’s beyond my skill set to improve.

no worries - actually when this happens i’m normally out and about - so no Lan cable. It’s typically a balancing act to try get connected before wifiMGR trips the scan.

Oh well, it works well on at least one device.