The W
Views: 100900962
Main | FAQ | Search: Y! / G | Calendar | Color chart | Log in for more!
27.11.14 0611
The W - CRZ's World - TECH SUPPORT OF THE DAY
This thread has 8 referrals leading to it
Register and log in to post!
Thread rated: 8.31
Pages: 1
(95 newer) Next thread | Previous thread
User
Post (4 total)
CRZ
Big Brother
Administrator








Since: 9.12.01
From: ミネアポリス

Since last post: 14 hours
Last activity: 3 hours
AIM:  
ICQ:  
Y!:
#1 Posted on | Instant Rating: 8.85
So I've been looking for a way to reconnect automatically to my wireless after I get dumped - I LOVE this Linksys, really I do, but for some reason I randomly get taken off my Wifi and unlike the old Dlink, we seem unable to automatically get back on when this happens.

Thanks to some Googling and this 2 year old blog post (osxdaily.com), I now have a root crontab entry which goes ahead and issues a connect every five minutes, whether I'm connected or not:

*/5 * * * * airport -A<mynetworkname> --password=<mypassword>

I COULD write something smarter which checks to see if I'm connected and then run the command only if I'm NOT connected, but a little overkill doesn't hurt here. Keep It Simple, Stupid. As near as I can tell, nothing happens when I try to connect to the network I'm already connected to - if there IS a break, it's not long enough for any of the programs I'm running to notice.

The hardest part was figuring out the Mac command line to connect to a Wifi network. Apple sure doesn't make it easy, burying that "airport" command deep down at /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport ...which is why the first thing you need to run is the "ln -s" command to make a symlink in a more convenient place, like /usr/sbin - this is in that blog post but I might as well reprint it here, too:

ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport

(This probably won't help YOU, but the next guy who needs to do this will probably be happy I ended up posting it. Kim might need this, too ;-) )



Promote this thread!
Leroy
Boudin blanc








Since: 7.2.02

Since last post: 11 hours
Last activity: 11 hours
#2 Posted on | Instant Rating: 6.57

We have Vista, OS X and a Gentoo box in our home network, and everything seems to play nicely.

The random dumps I was experiencing with my old Linksys WRT54G router had to do with the media server of my PS3. For some reason, those two things didn't get along - but all of that seemed to resolve with both the change in router and the last PS3 update - so I haven't had any issues since.

Have you upgraded to the latest firmware for the WRT400N? For some reason, our router shipped with an older firmware installed - which is probably a result of purchasing on eBay.





Who likes the little little duckies in the pond? I do, I do, I do, a chicka-quack quack.
CRZ
Big Brother
Administrator








Since: 9.12.01
From: ミネアポリス

Since last post: 14 hours
Last activity: 3 hours
AIM:  
ICQ:  
Y!:
#3 Posted on | Instant Rating: 8.85
    Originally posted by Leroy
    Have you upgraded to the latest firmware for the WRT400N? For some reason, our router shipped with an older firmware installed - which is probably a result of purchasing on eBay.
What's on there (1.0.01 19, sayeth the diagnostic screen, IIRC) matches the version number of what's on the website. Apparently there's only ever BEEN the one version, which I thought was odd (no update since Dec 2008? Really?) but accepted.

Since I implemented that crontab, if I've been booted, I've been blissfully unaware.



CRZ
Big Brother
Administrator








Since: 9.12.01
From: ミネアポリス

Since last post: 14 hours
Last activity: 3 hours
AIM:  
ICQ:  
Y!:
#4 Posted on | Instant Rating: 8.86
OK, that doesn't work so well. I ran into a problem where I would end up taking the entire router down until I powercycled it - something to do with doing Time Machine between this one and the other one over the wireless but disconnecting/reconnecting and oh it got very frustrating. SO. HERE is a script which will try a ping first, and ONLY try to reconnect me in the event that the ping fails. I'm using the address of my router for the ping but something you expect to be up (like crz.net!) would work just as well.

I'm still using cron to call this script every five minutes.

Just for kicks, I also threw in a bit in there were it mails me when I do reconnect. Actually, it'll mail me anyway, but I want the return code, too, so I put an extra echo in there. ("$?" is the return code - 0 is success, nonzero is failure, OK, just in case you didn't know that)
#!/bin/sh
/sbin/ping -c 1 192.168.1.1 > /dev/null 2>&1
a=`echo $?`
case "$a" in
0) ;;
*) echo $a ; /usr/sbin/airport -A
--password= > /dev/null 2>&1 ;;
esac
In retrospect, maybe "case $? in" would have worked - I thought it wasn't getting passed right, but what I had actually screwed up was putting "ping" instead of "/sbin/ping" because Mac's idea of Linux seems to require an awful lot of explicit paths (notice I put "/usr/sbin/airport" instead of "airport" as my earlier cron entry had - that earlier one probably wouldn't work on YOUR Mac, either) ahhhh I need to sleep. I'll post this now and look at it later. Hopefully when I wake up I'm still connected to the router automagically. :)

(edited by CRZ on 4.2.10 0120)

Thread rated: 8.31
Pages: 1
Thread ahead: CUTEST HUNGARIAN LOGO OF THE DAY
Next thread: TECH SUPPORT OF THE DAY
Previous thread: VIDEO MY COWORKER SENT ME OF THE DAY
(95 newer) Next thread | Previous thread
Our "regular" seats are closer to the court, but the suite has more comfy chairs, much better food 'n' drink, and the private bathroom is awesome.
The W - CRZ's World - TECH SUPPORT OF THE DAYRegister and log in to post!

The W™ message board

ZimBoard
©2001-2014 Brothers Zim

This old hunk of junk rendered your page in 0.075 seconds.