Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

wifi drops out

by tldr on Wed Dec 12, 2012 8:22 am

periodically my wifi adapter will drop out. as a rule the first i know of it is when it fails to start babbling at me at 4:30 a.m. or when i am unable to connect via ssh. when i get to my pi, the led on the adapter is off. unplugging and reinserting the module is enough to get it working again, but it seems to happen every two or three days.

i was wondering if there was a way i could monitor the wlan interface to see if it was still up and then get it to start back up. i don't really know what's going on because once the wifi goes down the pi is incommunicado. there's nothing in dmesg. all it seems to show is me unplugging the device and plugging it back in when it fails.

Code: Select all
[   12.446390] usbcore: registered new interface driver rtl8192cu
[   20.399901] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[   21.126997] bcm2835 ALSA card created!
[   21.140844] bcm2835 ALSA chip created!
[   21.153073] bcm2835 ALSA chip created!
[   21.159230] bcm2835 ALSA chip created!
[   21.176427] bcm2835 ALSA chip created!
[   21.184640] bcm2835 ALSA chip created!
[   21.199231] bcm2835 ALSA chip created!
[   21.206774] bcm2835 ALSA chip created!
[   21.412618] i2c /dev entries driver
[   40.318139] Adding 102396k swap on /var/swap.  Priority:-1 extents:1 across:102396k SS
[1649595.574373] usb 1-1.2.3: USB disconnect, device number 5
[1649600.980981] usb 1-1.2.3: new high-speed USB device number 6 using dwc_otg
[1649601.082815] usb 1-1.2.3: New USB device found, idVendor=0bda, idProduct=8176
[1649601.082847] usb 1-1.2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[1649601.082864] usb 1-1.2.3: Product: 802.11n WLAN Adapter
[1649601.082877] usb 1-1.2.3: Manufacturer: Realtek
[1649601.082890] usb 1-1.2.3: SerialNumber: 00e04c000001
[1759016.280963] usb 1-1.2.3: USB disconnect, device number 6
[1759018.620722] usb 1-1.2.3: new high-speed USB device number 7 using dwc_otg
[1759018.722604] usb 1-1.2.3: New USB device found, idVendor=0bda, idProduct=8176
[1759018.722635] usb 1-1.2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[1759018.722652] usb 1-1.2.3: Product: 802.11n WLAN Adapter
[1759018.722666] usb 1-1.2.3: Manufacturer: Realtek
[1759018.722678] usb 1-1.2.3: SerialNumber: 00e04c000001


thanks.

ps - here's the python script that runs at 4:30. it scrapes the weather off of weather.com and its output is piped to festival.

Code: Select all
#!/usr/bin/python
import urllib, re, time

content = urllib.urlopen ("http://www.weather.com/weather/right-now/94606").read()

timestr = re.sub ('AM','ay em',time.strftime('It is %A %B %d %Y, %I:%M %p'))

pat = re.compile (
   '"temperature-fahrenheit".(?P<temp>-?\d+).+?'
   '"weather-phrase">(?P<phrase>[A-Za-z ]+).+?'
   'arrow wind-dir-(?P<winddir>[A-Z]+)".+?'
   'wx-temp">(?P<windspd>\d+).+?'
   '"humidity">(?P<humidity>\d+%).+?'
   'incheshg">(?P<barometer>[0-9.]+).+?'
   'wx-pressure-(?P<trend>[A-Za-z]+)'
   , re.DOTALL)

m = pat.search (content)

windir = m.group ("winddir")
windir = windir.replace ('N', 'North ')
windir = windir.replace ('S', 'South ')
windir = windir.replace ('E', 'East ')
windir = windir.replace ('W', 'West ')

foo = '''{0}, current conditions are {2} and {1} degrees, humidity \
is {5}, wind is {4} miles per hour out of the {3},the barometer is \
{6} and {7}, now get the f*ck out of bed'''

print foo.format (timestr, m.group ("temp"),
      m.group ("phrase"), windir, m.group ("windspd"), m.group ("humidity"),
      m.group ("barometer"), m.group ("trend"))


it fails if the wind's not blowing. of course festival cannot pronounce f*ck, but i was unable to post the code with the correct spelling.
"If I had known it was harmless, I would have killed it myself." - Phillip K. Dick, A Scanner Darkly
User avatar
tldr
 
Posts: 466
Joined: Thu Aug 30, 2012 12:34 am

Re: wifi drops out

by adafruit_support_bill on Wed Dec 12, 2012 8:45 am

I'm not a Linux expert, but one of the Wi-Fi signal-strength monitor utilities might help you detect the failure. Not sure what you would or could do in software to initiate recovery.
User avatar
adafruit_support_bill
 
Posts: 25601
Joined: Sat Feb 07, 2009 9:11 am

Re: wifi drops out

by tldr on Wed Dec 12, 2012 9:26 am

maybe i can add an arm to unplug the adapter and plug it back in...
"If I had known it was harmless, I would have killed it myself." - Phillip K. Dick, A Scanner Darkly
User avatar
tldr
 
Posts: 466
Joined: Thu Aug 30, 2012 12:34 am

Re: wifi drops out

by mrburns42 on Tue Jan 01, 2013 10:47 pm

I too am having the wifi dropping out. The PI has zero ohm resistors and not the poly fuses. The current location for the PI is not its permanent home. At its current location I can also connect the ethernet cable. When the wifi drops out, the ethernet still works. If I run iwconfig, it appears that the adapter is still there but is not associated with the network. I looked at dmesg, and I saw references to the wifi powering down.

Right now, the PI is not really doing anything, as I am still developing code. I wonder if the wifi is inactive for so long that the OS is powering it off. This would be fatal, as I would then have no way to wake it back up without ssh. When I found wifi down today, the PI had been running for over 5 days. Rebooting via ethernet and the wifi came right up. I did not try hot plugging the adapter yet.

Questions:

1. Is there some power saving stuff that I can turn off?

2. Are there commands that I could run from the ethernet port to attempt to troubleshoot this?
mrburns42
 
Posts: 3
Joined: Tue Jan 01, 2013 10:31 pm

Re: wifi drops out

by mrburns42 on Thu Jan 03, 2013 8:18 am

After 1 day and 10 hours, it quit again. Looking at dmesg, here is where it had a problem. It seems to be doing some power save stuff and during one of these iterations, it has a problem. The error appears to start at :

OnDeAuth Reason code(7)

Googling this it appears that the client started sending data before it as associated. Who is the client here? The Pi?


[87630.305097] rtl8192c_set_FwPwrMode_cmd(): Mode = 0, SmartPS = 0
[87632.304866] rtw_set_ps_mode(): Enter 802.11 power save mode...
[87632.304914] rtl8192c_set_FwPwrMode_cmd(): Mode = 1, SmartPS = 2
[87634.304998] rtw_set_ps_mode(): Busy Traffic , Leave 802.11 power save..
[87634.305235] rtl8192c_set_FwPwrMode_cmd(): Mode = 0, SmartPS = 0
[87636.305122] rtw_set_ps_mode(): Enter 802.11 power save mode...
[87636.305169] rtl8192c_set_FwPwrMode_cmd(): Mode = 1, SmartPS = 2
[87830.885198] rtw_set_ps_mode(): Busy Traffic , Leave 802.11 power save..
[87830.885506] rtl8192c_set_FwPwrMode_cmd(): Mode = 0, SmartPS = 0
[87832.314749] rtw_set_ps_mode(): Enter 802.11 power save mode...
[87832.314795] rtl8192c_set_FwPwrMode_cmd(): Mode = 1, SmartPS = 2
[88114.853891] rtw_set_ps_mode(): Busy Traffic , Leave 802.11 power save..
[88114.854215] rtl8192c_set_FwPwrMode_cmd(): Mode = 0, SmartPS = 0
[88116.328597] rtw_set_ps_mode(): Enter 802.11 power save mode...
[88116.328644] rtl8192c_set_FwPwrMode_cmd(): Mode = 1, SmartPS = 2
[88212.336057] OnDeAuth Reason code(7)
[88212.336103] OnDeAuth, STA:00:1e:2a:54:77:f6
[88212.336118] receive_disconnect
[88212.336135] report_del_sta_event: delete STA
[88212.338012] OnDeAuth Reason code(7)
[88212.338038] OnDeAuth, STA:00:1e:2a:54:77:f6
[88212.338062] receive_disconnect
[88212.358959] rtw_set_ps_mode(): Busy Traffic , Leave 802.11 power save..
[88212.359433] OnDeAuth Reason code(7)
[88212.359478] OnDeAuth, STA:00:1e:2a:54:77:f6
[88212.359493] receive_disconnect
[88212.360022] rtl8192c_set_FwPwrMode_cmd(): Mode = 0, SmartPS = 0
[88212.361042] OnDeAuth Reason code(7)
[88212.361083] OnDeAuth, STA:00:1e:2a:54:77:f6
[88212.361099] receive_disconnect
[88212.361162] rtl8192c_set_FwJoinBssReport_cmd mstatus(0)
[88212.361789] OnDeAuth Reason code(7)
[88212.361829] OnDeAuth, STA:00:1e:2a:54:77:f6
[88212.361843] receive_disconnect
[88212.623016] ==>pwr_state_check_handler .fw_state(8)
[88212.623062] ==> rtw_ps_cmd , enqueue CMD
[88212.623140] ==>rtw_ps_processor .fw_state(8)
[88212.623161] ==>ips_enter cnts:1
[88212.623461] ==>power_saving_ctrl_wk_hdl change rf to OFF...LED(0x00020008)....
[88212.623474]
[88212.623490] ===> rtw_ips_pwr_down...................
[88212.623940] ====> rtw_ips_dev_unload...
[88212.661661] usb_read_port_cancel
[88212.661812] usb_write_port_cancel
mrburns42
 
Posts: 3
Joined: Tue Jan 01, 2013 10:31 pm

Re: wifi drops out

by adafruit_support_bill on Thu Jan 03, 2013 2:54 pm

Who is the client here?

The mac address should be a clue:
OnDeAuth, STA:00:1e:2a:54:77:f6
User avatar
adafruit_support_bill
 
Posts: 25601
Joined: Sat Feb 07, 2009 9:11 am

Re: wifi drops out

by mrburns42 on Fri Jan 18, 2013 10:57 pm

I am still having WiFi Issues, but I have learned some stuff.

First, after testing six different power supplies and three different RaspPi, I have concluded that WiFi adapters will not run without a powered USB hub. The voltage drop across the internal poly fuse, F3, is just too great. It may work for a short time, but eventually the fuse heats up, the voltage drop increases, and the WiFi quits. I replaced F3 with a 2A version. The voltage drop is now 50mV. With the original RaspPi fuse, the three samples gave a voltage drop of 100mV, 300mV or 500mV. This voltage drop is just too great regardless of the input voltage. There is an internal zener on the downstream side of the poly fuse, so increasing the input voltage too much only heats the fuse more.

Second, it seems the another part of my problem is that a neighbor's signal is somewhat stronger than my access point. It seems that when a drop out occurs, it gets confused is dead until I reboot. It seems like the original install does not have a network manager running. I installed wicd from the directions at:

http://dembtech.blogspot.com/2012/09/ho ... ry-pi.html

Once I got this installed, the WiFi adapter's Power Saving is disabled, so it is not powering itself On and Off every few minutes.

Since I am running headless, I installed the wicd-curses also. It is a little difficult to configure from the console. I am hopeful that this network manager will reconnect when it drops out now, at least once I get it configured right.
mrburns42
 
Posts: 3
Joined: Tue Jan 01, 2013 10:31 pm