bluebox72
Posts: 8
Joined: Sat Jul 08, 2017 12:34 pm

Wifi connection unstable

Fri Jul 21, 2017 7:56 pm

I have a Raspberry Pi 3 Model B, with the latest version of Raspbian installed. The Pi seems unable to maintain a connection to my wi-fi network for more than a few minutes at a time. After I boot up the connection is established ok, but drops out quite quickly afterwards.

As suggested in a few other threads, I have disabled wi-fi power saving by adding the following lines to /etc/rc.local:

Code: Select all

    sleep 10
    sudo iwconfig wlan0 power off
but that had no effect. I don't think the connection drops because the network is inactive, I left a continuous ping command running on the Pi and it still disconnected.

Output from ifconfig (when the connection is still active):

Code: Select all

wlan0     Link encap:Ethernet  HWaddr b8:27:eb:7c:8a:85  
          inet addr:192.168.1.8  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::7d5a:8218:d16c:c058/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:975 errors:0 dropped:0 overruns:0 frame:0
          TX packets:916 errors:1 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:259439 (253.3 KiB)  TX bytes:172169 (168.1 KiB)
and iwconfig:

Code: Select all

wlan0     IEEE 802.11  ESSID:"mypi"  
          Mode:Managed  Frequency:2.462 GHz  Access Point: E4:19:6B:15:BF:49   
          Bit Rate=21.6 Mb/s   Tx-Power=31 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=25/70  Signal level=-85 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
and uname -a:

Code: Select all

    Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux
Any ideas what else I could try? Any further diagnostic commands I can run? I had only heard good things about the Pi before buying one, but this issue makes it basically useless for the project I had in mind so it's kind of disappointing!

many thanks

Rob

dgordon42
Posts: 790
Joined: Tue Aug 13, 2013 6:55 pm
Location: Dublin, Ireland

Re: Wifi connection unstable

Mon Jul 24, 2017 3:46 pm

From your 'iwconfig' posting:

Code: Select all

Link Quality=25/70  Signal level=-85 dBm  
With my Pi 3B, the WiFi performance starts to drop off when the Link Quality drops below 50.
Try moving your Pi and/or router to get a better signal. If this is not possible there are some WiFi USB Dongles out there which have greater range then the Pi's built in WiFi.

Hope this helps,
Dave.

bluebox72
Posts: 8
Joined: Sat Jul 08, 2017 12:34 pm

Re: Wifi connection unstable

Wed Jul 26, 2017 7:06 pm

Thanks Dave, I tried moving the Pi right next to my router but had the same problem. I suspect I might be suffering from this problem being discussed at length on GitHub - apparently Broadcom have acknowledged there is a problem with the wi-fi driver and are investigating.

Shea
Posts: 113
Joined: Fri Nov 25, 2011 7:16 pm
Location: Markham, Canada

Re: Wifi connection unstable

Wed Jul 26, 2017 11:00 pm

You may want to try to connect the Pi to a different router, to see if it can improve the performance. From my experience, a router with external antenna works far better than one with internal antenna with the same setup, 3 feet apart. That is my 2 cents.

User avatar
DougieLawson
Posts: 39609
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Wifi connection unstable

Thu Jul 27, 2017 1:09 pm

Try running sudo rpi-update; sudo reboot (just once, don't get in a habit of doing that). That includes a fix for the WiFi ToS problem.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

bluebox72
Posts: 8
Joined: Sat Jul 08, 2017 12:34 pm

Re: Wifi connection unstable

Sat Jul 29, 2017 1:52 pm

Unfortunately it looks like the rpi-update didn't work for me, I have the same issue after applying it and rebooting. I have also just installed a new wi-fi router in my house with stronger signal and that didn't help either.

User avatar
DougieLawson
Posts: 39609
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Wifi connection unstable

Sat Jul 29, 2017 7:04 pm

Have you got the right country code in /etc/wpa_supplicant/wpa_supplicant.conf?
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

bluebox72
Posts: 8
Joined: Sat Jul 08, 2017 12:34 pm

Re: Wifi connection unstable

Sun Jul 30, 2017 12:02 pm

Dougie, I think you might have cracked it!

I didn't have any country code in the wpa_supplicant.conf file, so I added
country=GB
restarted the Pi and it hasn't disconnected since.

I will keep an eye on it, but things are looking good.

Many thanks for your help, you've saved me a lot of frustration.

Rob

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26876
Joined: Sat Jul 30, 2011 7:41 pm

Re: Wifi connection unstable

Sun Jul 30, 2017 9:07 pm

Interesting data point, I'll make sure the driver guys know.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

rakeshjoshi
Posts: 1
Joined: Thu Nov 02, 2017 9:16 pm

Re: Wifi connection unstable

Thu Nov 02, 2017 9:21 pm

I had the exact same problem. Wifi connection used to get dropped within few minutes of connecting .

It got fixed as soon as i added the country code . I did it using the menu options -> Preferences -> Raspberry PI Configuration -> Localisation -> Set WiFi Country.

I also checked the file /etc/wpa_supplicant/wpa_supplicant.conf and the above action had added the entry country=GB in the file. Once i had rebooted, WIfi has been working fine without dropping connection.

tgv
Posts: 1
Joined: Fri Feb 23, 2018 6:21 pm

Re: Wifi connection unstable

Fri Feb 23, 2018 8:25 pm

I've had the same problem of the wifi connection on my raspberry pi zero W routinely dropping, often after only a few minutes; "Reboot" never fixed it, though "Shutdown" then removing the power for a few seconds to restart did. Then I tried entering the Country Code in the wifi settings from the desktop as described by rakeshjoshi above, and now it works with less problem: still has lost wifi when left on overnight, but works fine for at least hours (instead of only minutes) after shutting down and restarting.

User avatar
ThePicardManeuver
Posts: 1
Joined: Thu Mar 01, 2018 8:20 pm

Re: Wifi connection unstable

Thu Mar 01, 2018 10:20 pm

After turning off power management and changing the country code to the correct one, I still keep getting kicked off the wifi intermittently. The signal is strong, so I don’t think that’s the problem. Is it probable that I have bad Pi 3B? If I reset, it usually remembers the network it had last been connected to and reconnects.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26876
Joined: Sat Jul 30, 2011 7:41 pm

Re: Wifi connection unstable

Fri Mar 02, 2018 11:31 am

ThePicardManeuver wrote:
Thu Mar 01, 2018 10:20 pm
After turning off power management and changing the country code to the correct one, I still keep getting kicked off the wifi intermittently. The signal is strong, so I don’t think that’s the problem. Is it probable that I have bad Pi 3B? If I reset, it usually remembers the network it had last been connected to and reconnects.
It's almost certainly a wireless chip firmware issue, and we are actively pursuing Cypress for a fix. We did release a 'better' firmware a couple of weeks ago, but that in the end introduced more problems than it solved so it has been rolled back. It might help in your case, but might be worse. I will keep pushing Cypress for some progress here, it's been too long sorting this wireless stuff out.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

mkirk
Posts: 54
Joined: Tue Mar 06, 2018 4:21 pm

Re: Wifi connection unstable

Tue Mar 06, 2018 4:28 pm

For this dropped WiFi issue with Cypress chipset, could Moderator jamesh be specific as to what releases (with dates) of Jessie or Stretch has the Cypress driver bug and which has the backed out fix?

I am running : Linux raspberrypi_10 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux
but do not know about the WiFi driver versions

Thanks!

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26876
Joined: Sat Jul 30, 2011 7:41 pm

Re: Wifi connection unstable

Tue Mar 06, 2018 5:49 pm

Jessie does not show the problem, current download of Stretch does not show the problem, Stretch after a apt upgrade of about a 2 weeks ago will show the problem, Stretch with a current upgrade will NOT show the problem,

So simply do an

sudo apt update
sudo apt update

to get the working (albeit older) firmware, although that will update everything else as well. Which you should probably do anyway.

I don't have specific version numbers of dates handy. Note that most people will not see the issue unless they a) Have a hidden SSID or b) reboot the router with the Pi associated.

Also note, that the 4.14 kernel does NOT show the issue with the latest firmware, so anyone wanting the latest firmware and its fixes should try that kernel, available via rpi-update - note, bleeding edge, use at own risk etc


I think we have determined the fault, and will be releasing again in the next couple of days, so 4.9 will have the fix backported.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

bullockbob
Posts: 28
Joined: Wed Aug 23, 2017 10:37 am

Re: Wifi connection unstable

Thu Mar 08, 2018 10:35 am

Is this only for the Pi3 or can Pi Zero W be affected as well?

Thanks

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26876
Joined: Sat Jul 30, 2011 7:41 pm

Re: Wifi connection unstable

Thu Mar 08, 2018 10:51 am

bullockbob wrote:
Thu Mar 08, 2018 10:35 am
Is this only for the Pi3 or can Pi Zero W be affected as well?

Thanks
They use the same Wireless chip, so the same problems on both.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

bullockbob
Posts: 28
Joined: Wed Aug 23, 2017 10:37 am

Re: Wifi connection unstable

Thu Mar 08, 2018 1:15 pm

Ok, thanks for the info. Having similar (possibly same) issues. Hard to tell when running headless, but symptoms are certainly the same.

antisubae
Posts: 4
Joined: Sun Apr 01, 2018 5:23 pm

Re: Wifi connection unstable

Sun Apr 01, 2018 5:39 pm

Sorry to bump an older thread, but this is the first one I've found that describes the same problem I'm having.

On a fairly new (have had it less than 2 months) Pi 3B running the Octopi 0.14.0 image, I'm losing my WiFi connection after 12-16 hours of network inactivity, for instance when doing an overnight print job. If I hook an ethernet cable up and SSH into it, ifconfig shows me that it can see and is connected to the correct SSID, but it's also showing wlan0 as having a 169.254.x.x IP rather than the 192.168.x.x that it should have. No amount of restarting network services or fully rebooting seems to fix it, unless or until it randomly/magically comes back to life and pulls the right IP address for another period of time.

If this is indeed a firmware issue, would I be seeing it on the Octopi installation too? I'm on a very fresh install as an attempt to fix it, less than 24 hours old, and the first thing I did after booting it up yesterday evening was to update/upgrade.

I still have my Pi 2B+ to fall back on if this thing continues to misbehave for now, but if there's a way to keep the 3B with Octopi from disconnecting I'd be very interested to learn how to do it. :-)

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26876
Joined: Sat Jul 30, 2011 7:41 pm

Re: Wifi connection unstable

Sun Apr 01, 2018 6:28 pm

IRC, 169.254.x.x IP is the default IP if the DHCP failed to provide an IP address. Have you rebooted your router recently?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

antisubae
Posts: 4
Joined: Sun Apr 01, 2018 5:23 pm

Re: Wifi connection unstable

Sun Apr 01, 2018 6:35 pm

Hi Jamesh, thanks for the quick reply!

I have tried rebooting the router a number of times. There are a good number of both wired and wireless devices on the LAN, and the poor Pi is the only one that's having any trouble maintaining a connection. It is also line-of-sight with the router, about 20 feet away with no physical interference. I've double and triple checked the DHCP settings in the router to make sure I hadn't accidentally given it a short lease time or something, but all is well there too.

It's not the end of the world, as I said, I can fall back to the Pi 2 for Octoprint and just use the 3B for a wired application for now. If I could get a cable over to where the printer is, I wouldn't have any problems at all LOL ...I just didn't know if there might be a known fix that I hadn't run across yet. Always open to suggestions, though! :D

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26876
Joined: Sat Jul 30, 2011 7:41 pm

Re: Wifi connection unstable

Sun Apr 01, 2018 9:41 pm

We've had a few reports of issues on Wifi and ethernet since the 3B+ was launched. We'll be concentrating on sorting them out once the holidays are over in the UK.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

jaimesanchezm
Posts: 1
Joined: Thu Mar 22, 2018 6:25 pm

Re: Wifi connection unstable

Tue Apr 10, 2018 6:41 pm

Hi,

We present same issue on Raspbian (openHABian) Jessie.
Our devices are WiFi connected to LAN router with proper hostname and dinamic ip. We can hold them properly on eth0 ethernet interface, but soon or late this hostname or even the ip fails on LAN pong when we are on wlan0.
Currently we are making a new setup from Raspian Stretch. Just to repeat the process cleanly. Any advise on this issue will be appreciated. We'll be pleasesd to share any log.

So, we are clear that WiFi does not die, at least, not always. And also, hotplugging an ethernet wire and then disconnecting it: renews wlan presence on LAN.

Our power-management and Country code are catched on wlan interface definition.

Aditional information:

- We are using [1] fork to allow our users to get WiFi AP configuration over the RPi3 (that has been overlayed [2] to RS485 on /dev/AMA0, just in case it could be relevant). As known, forked nodejs webapp [1] writes on /etc/network/interfaces any input given from user: Essid and password.

So the app gets connected dinamically to any DHCP server on LAN. We've added Static IP and hostname feature and we are now changing to wpa-supplicant on given fork. On this context we arrive to this forum thread issue.

- Currently, we are on avahi with [3] a fork on Bonjour Browser so we are able to jump another related issue specific to Android who is unable to resolve dns names. So, in order to be able to allow our users to browse configured hostname on such Android devices, we have forked a feature that identifies our hostname-ip avahi broadcasting notificacions. In that sense, we go together with Openhab-discovery [4] feature. So we can browse the workstation service for every RPi3 near Openhab services.That allows a kind of usertaping on a ListView Item to launch a WebView with proper IP to our RPi3 default http. On that road, we have default Samba Openhabian setup.

- As standard ISP routers (target of our project) are not very reliable on listing real-time their connected clients, we can't get conclusions on that testing.
Why LAN device recognition works fine on Ethernet and fails, irregularly, on WiFi?
This quote, at this very moment, is the most biggest simplification of the issue.

While doing the Strech thing, next, we are suposed to sniff some traffic on our test-setup. Which now holds some devices RPi-3 linking a mqtt broker on a BaaS. Just to ensure that we are not blowing up interface capacity. We've tested that our mqtt-clients keep connected to cloud broker although we can't ping hostname or IP from a desktop on LAN. So that, WiFi is not dead.

Thanks in advance!


[1] https://github.com/sabhiram/raspberry-wifi-conf
[2] viewtopic.php?t=138223#p917752
[3] https://github.com/andriydruk/BonjourBrowser
[4] We are NOT experimenting this issue https://github.com/openhab/openhab-distro/issues/162 and /etc/avahi/avahi-daemon.conf can be set to either broadcast IP6 or IP4. We could search the issue this side by i.e. [ .a] or [ .b]

[ .a] https://raspberrypi.stackexchange.com/q ... er-a-while
[ .b] https://raspberrypi.stackexchange.com/q ... ame-in-lan

Earl_H
Posts: 2
Joined: Tue Apr 24, 2018 11:29 am

Re: Wifi connection unstable

Tue Apr 24, 2018 11:42 am

Just to add another voice to this problem.

My RPi worked well until the latest stretch version was loaded this morning and I now have exactly the same problem (wifi turning on/off intermittently).

Having then gone through all of the proposed solutions I have been forced to resort to a wired system.

Do you have a date for a firmware solution as its been nearly 2 months since you approached your supplier.

antisubae
Posts: 4
Joined: Sun Apr 01, 2018 5:23 pm

Re: Wifi connection unstable

Tue Apr 24, 2018 12:37 pm

Oddly, my previous issue with the wifi has completely disappeared since the first of the month. I refreshed the 3B with a new Stretch image, and then let it sit on my desk doing absolutely nothing for about a week. I'd occasionally SSH into it to see if it was up and it never failed to respond. I switched back over to the Octopi image and did the same idle test for another week, and same deal - no trouble at all. It's been running perfectly ever since.

I wish I could share this magical solution, but it appears as though it simply "Just Works" now.

Return to “Troubleshooting”