A way to keep the wifi retrying.

Hello,

Problem:
If I connect to my wifi at home with

Code:
# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf
Code:
# dhclient wlan0

And then pick my laptop up and take it for a stroll around town, when I get back home and leave it on my desk for an unlimited amount of time, it never seems to reconnect.
Is the wpa_supplicant daemon and dhclient not meant to keep retrying and reconnecting?

Does anyone have a solution to this?

Would I have to make a script that keeps looping these two applications?

Best Regards,
 
If you put the first line into rc.conf
(see posts for syntax).
when it disconnects you can shorten the
second (the reconnect) to an alias.
Code:
 alias dw='dhclient wlan0'
if
that would work in your .chsrc or whatever.
...
if the reconnect does not work
Code:
 sh /etc/rc.d/netif restart
might work if the wlan0 is already in
rc.conf ... (A pair of lines...)
(VARIES depending upon v7 or v8).
...
DISCLAIMER. I've not double checked any
of these syntaxes. Typos or inaccuracies...
 
Humm, I don't wander much with my FreeBSD laptop(s) & I shut them down mostly, so I don't get much moving from network to network (you'll excuse the diversion, as this is merely to exposit on the general theory that I haven't much real-world experience in this) but I would probably just do a # /etc/rc.d/netif restart
and pray.
 
Hiya thanks guys.

Though both your solutions involve *me* retrying the wifi.

Ideally I would like to find a way for FreeBSD to do it.

For example the wireless manager in Windows XP was very reliable in the way that it would generally reconnect as soon as a network was in range.

I may have to do is write some scripts to do this. Until then, any more suggestions are appreciated :)
 
Ah, I find it annoying myself when the linux laptops automatically connect to random stuff like poorly configured HP print servers or known bad networks.

It looks like someone was trying to port guh-nomes nm-applet back in 2009. No idea how that's gone or going.

edit: additionally, there is wicd for linux. Again, no idea how horrible this may be to port over.
 
kpedersen said:
Though both your solutions involve *me* retrying the wifi.

Ideally I would like to find a way for FreeBSD to do it.

When testing Broadcom cards, I see wpa_supplicant reassociate automatically after a disconnect. dhclient doesn't restart on its own, though.

Maybe one of those "check-and-restart-daemon" scripts that the Linux guys seem to like?
 
Oh boy you lot are in for a treat!!

/sbin/wpa_loop
Code:
#!/bin/sh

while true
do
  wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf
  sleep 5
done

/etc/dhclient_loop
Code:
#!/bin/sh

while true
do
  dhclient -d wlan0
  sleep 5
done

/etc/rc.d/connect
Code:
wpa_loop &
dhclient_loop &

Skriptzzz!
 
Back
Top