I'm trying to make-do with a
Netgear (WN111v2) USB wifi card ...and I'm frustrated. The connection seems to work out-of-the-box with the
carl9170 module. Low-bandwidth internet access seems fine and can endure for semi-long periods of time. But,
during periods of high through-put, connectivity eventually ceases. The interface remains up but I cannot ping the gateway interface. (Wireshark shows some LLC stuff. If anyone thinks that will be helpful, ask.)
My first solution included disconnecting/reconnecting the nic. In the past, I've also remedied the problem by creating a cron job to unload/reload the module forcing the connection to reset. The best solution I found was a 50-ft ethernet cable--but wifi-alternatives are longer an option. So, I'm looking for a fix or help with my work-around script.
The best solution would prevent the lapse in connectivity. I haven't researched about this in several months but I believe it boils down to firmware/module issues--something I'm not really too comfortable addressing in detail. If you're familiar with the problem and know of a permanent solution, I'd be happy to implement it. But I am hesitant to experiment with it when I KNOW work arounds will suffice.
My plan-b solution is to create a script (to be run via cron, unless someone has a better idea) to check connectivity and reset the connection (original credit goes to some thread I found weeks ago, but I've been tweaking...):
Code:
# restart wifi if lacking connectivity
dest=192.168.0.1
limit=50
loss=100
loss=$(ping -c 3 -i 3 -W 15 $dest | grep -o "[0-9]*%" | tr -d %) > /dev/null 2>&1
if [ "$loss" -gt "$limit" ]; then
logger "pinger: packet loss ($loss%) exceeded $limit, restarting network-manager ..."
service network-manager restart
fi
...which causes cron to mail me...
Code:
/usr/bin/service: 127: /usr/bin/service: stop: not found
/usr/bin/service: 128: exec: start: not found
I thought maybe "service" might be having permission issues, so I did 'chown root:root' and 'chmod +s' to the script. (I also tried "sudo service network-manager restart" in the script but both got me a long block of something like this:
Code:
stop: Rejected send message, 1 matched rules; type="method_call", sender=":1.138" (uid=1001 pid=15151 comm="stop network-manager ") interface="com.ubuntu.Upstart0_6.Job" member="Stop" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.139" (uid=1001 pid=15148 comm="start network-manager ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
...which, I think, is the same thing I get by executing "service network-manager restart" (as a user). FYI, "sudo service network-manager restart" does the trick--if only I could automate this!
I know I'm close! Can anyone offer some suggestions?
Advice and URLs on permissions in the context of cron would be welcome. I'm not sure I understand that thoroughly and most of the stuff I've found has to do with either cron or permissions; it doesn't seem complicated but maybe I'm missing something.
(I don't know that a hammer is the right tool for this job but its sounding like a better and better plan.
)