WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Better WiFi network manager?  (Read 15558 times)

Offline nil_von_9wo

  • Newbie
  • *
  • Posts: 20
Re: Better WiFi network manager?
« Reply #30 on: December 11, 2012, 07:45:13 AM »
Write a script that checks for internet response and reconnects with the TCL std wifi tool
something like

if [ `ping -c3 google.com | grep received | awk ' { print $4 } '` -eq "0" ]
then
   /usr/local/bin/wifi.sh -a &> /dev/null
fi
#non cron check interval
sleep 5

run it as a bg job for less than one minutes interval checks or use a while [ -z loop ] else just use cron

I'm looking at this suggestion and I'm wondering how I can make two modifications:

1. Because Google may not have 100.00% uptime (nowhere does), I'd like to check two or three sites (e.g. microsoft.com and yahoo.com) as well before determining to reset the connection.

2. The connection I am concerned with is not a secure connection and therefore isn't added to wifi.db.  Is there a way I can modify the command line for wifi so it will connect to an open network?

Offline ananix

  • Full Member
  • ***
  • Posts: 174
Re: Better WiFi network manager?
« Reply #31 on: December 12, 2012, 02:42:00 AM »
Write a script that checks for internet response and reconnects with the TCL std wifi tool
something like
failed=1
for site in google.com microsoft.com yahoo.com
do
  if [ `ping -c3 $site | grep received | awk ' { print $4 } '` -eq "0" ]
  then
    failed=`expr "$failed" + 1`
  fi
done
if [ $failed -ge 4 ]
     /usr/local/bin/wifi.sh -a &> /dev/null
fi
#non cron check interval
sleep 5

run it as a bg job for less than one minutes interval checks or use a while [ -z loop ] else just use cron

I'm looking at this suggestion and I'm wondering how I can make two modifications:

1. Because Google may not have 100.00% uptime (nowhere does), I'd like to check two or three sites (e.g. microsoft.com and yahoo.com) as well before determining to reset the connection.

2. The connection I am concerned with is not a secure connection and therefore isn't added to wifi.db.  Is there a way I can modify the command line for wifi so it will connect to an open network?


I edited the script, i have not executed it, in regards to 2. good thing it does not, how would you know its a trusted network someone else could make he's own open network and put up af dns server to phish your information or just listning in on your data transfer.

Offline nil_von_9wo

  • Newbie
  • *
  • Posts: 20
Re: Better WiFi network manager?
« Reply #32 on: December 18, 2012, 07:19:42 AM »
2. good thing it does not, how would you know its a trusted network someone else could make he's own open network and put up af dns server to phish your information or just listning in on your data transfer.

While I thank you for the script, we seem to be losing the point of this very thread, so let me recap/restate the situation and see if that helps generate an actual viable solution:

1.  For reasons that are irrelevant, the only place I can connect to the internet is a local Starbucks whose routers may be junk, or may be misconfigured, or both.  They have two routers (both are open/public wifi hotspots with the identical SSID "BTOpen" and appearing on channel 11).  These account for 2 of up to 15 allegedly available wireless connections (the rest of which I don't have authorization to use) and when wifi.sh runs there is way of predicting what number I will need to type to use one and there is no way to for wifi.sh to remember that this is a wireless connection that I am willing to (and under the circumstances, must) use.

2.  For some reason when connecting to this wireless network, my computer is constantly, repeatedly being dropped, which Tinycore's wifi pays no attention to.  Applications using the network start to fail and only once I personally observe this can I restart the connection, which must be performed completely and annoyingly manually.

3.  Using other operating systems (e.g. Windows and Puppy Linux) and their default wireless adapter drivers and default network managers, seem to realize this failure promptly and fix the connection in the background, often before applications realize they can't connect to the internet and fail.  However, because my laptop is an antiquated piece of junk with limited resources, I would prefer to use Tiny Core because aside from networking, I see significant improvements towards how my computer performs while web browsing (which is the main purpose I have for this machine).

4. I realize and accept the risks of using Starbuck's open network for the limited activity I intend to use this machine at this location.  I don't wish to constantly tell my computer that this is okay and am willing to accept the risk of having it automatically connect to Starbucks wifi without reiterating the dialog.  Should I my circumstance change, I'll make sure that I don't connect to some unlikely trap that someone is spoofing Starbuck's wifi just in case someone who uses it comes along.  Meanwhile, if the second BTOpen at Starbucks is actually a spoof, I have no way of knowing the difference and would anyway not treat either as a secure connection.

(Post made from within Puppy Linux because I'm getting fed up with the lack of useful support I'm getting on this issue and don't wish to spend half my day manually reconnecting to the network.)

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Better WiFi network manager?
« Reply #33 on: December 18, 2012, 07:23:41 AM »
Two AP's with the same ID on the same channel at the same location? Great.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline nil_von_9wo

  • Newbie
  • *
  • Posts: 20
Re: Better WiFi network manager?
« Reply #34 on: December 18, 2012, 12:01:17 PM »
Two AP's with the same ID on the same channel at the same location? Great.

I suspect that may be part of the problem, but I'm not in a position where I can fix it and, as asserted, my other operating systems handle whatever the problem(s) is/are better (I suspect Mac OS handles it better to since most users here have Macs and I don't see them struggling to remain connected.


Offline ananix

  • Full Member
  • ***
  • Posts: 174
Re: Better WiFi network manager?
« Reply #35 on: December 21, 2012, 04:32:10 AM »
hmm i did not read that big post but skimming it seems you just sums up, "ill take the risk would have been enough", im just saying it might not be seen as a flaw in TCL wifi tool
TCL is more for building your own system and i wonder a bit why you chose TCL anyhow make the script take and argument like hotspot name and echo it into the wifi.db before connecting. You could also port the wifi tools you like to TCL or write your own i think thats more the spirit of TCL than complain everything is not automatic and supported.

again i dont have wifi tool or db and im writing the script from head so you have to adjust it yourself

wifi_bug.sh HOTSPOT_NAME OTHER_ARGS

## Runs in loop every 3 seconds
## Takes arguments to alter the wifi.db before autoconnect

while [ -z ]
do
  if [ $1 && $2 ]
  then
    echo $1 $2 > ~tc/wifi.db
  fi
  failed=1
  for site in google.com microsoft.com yahoo.com
  do
    if [ `ping -c3 $site | grep received | awk ' { print $4 } '` -eq "0" ]
    then
      failed=`expr "$failed" + 1`
    fi
  done
  if [ $failed -ge 4 ]
     /usr/local/bin/wifi.sh -a &> /dev/null
  fi
  sleep 3
done

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11227
Re: Better WiFi network manager?
« Reply #36 on: December 21, 2012, 05:59:56 AM »
Hi ananix
A few minor points. As a matter of completeness, you should include:
Code: [Select]
#!/bin/shin your example.
Since  HOTSPOT_NAME OTHER_ARGS  don't change once you've invoked the script, this:
Code: [Select]
  if [ $1 && $2 ]
  then
    echo $1 $2 > ~tc/wifi.db
  fi
should probably be outside of the loop.
Using code tags would also be nice. ;D

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Better WiFi network manager?
« Reply #37 on: March 17, 2013, 10:18:53 PM »
Having myself a wireless radio which frequently required a manual reconnect and only recently having delved into wpa_supplicant, I found that when using wpa_supplicant disconnection issues are automatically taken care of, i.e. upon disconnect wpa_supplicant will automatically attempt to reconnect, and besides from that also will always attempt to connect to networks according to priorities as specified in config file :)

Edit:
N.B. the reconnections could be observed when running wpa_supplicant in foreground.
« Last Edit: March 18, 2013, 05:36:56 AM by tinypoodle »
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Better WiFi network manager?
« Reply #38 on: March 23, 2013, 08:38:31 AM »
Doing a bit more testing, I found that when using another app to set radio to a different channel than the one to which wpa_cupplicant has currently connected, then wpa_supplicant would actively try to compete and get the connection back, or also try to connect to a different network as specified in config file.
OP stating not to encounter same issues with e.g. puppy et al might likely be due to wpa_supplicant running by default.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)