wjmnelis
Posts: 32
Joined: Thu Oct 26, 2017 5:03 pm

[Solved] rpi0w freezes if Wifi comes back

Thu Feb 22, 2018 9:18 am

An RPi0W is used to control a home fan unit. Wifi is used to monitor the RPi0W and in a next phase, Wifi is needed to get the weather forecast. It is found that if the Wifi network is down for some time, the RPi0W often freezes at about the time the Wifi network becomes operational again.

The RPi0W is running the latest release of Raspbian Stretch Lite and there are currently no outstanding upgrades. Especially the wireless firmware release mentioned in viewtopic.php?t=203508 is included.

The last occurrence was on 2018.02.21. At about 07:02 the Wifi network became operational. However, the RPI0W could not be accessed through SSH, and it did not react on ping either. After a power cycle, the RPI0W becomes accessible. The various log files show entries up to the time that Wifi became operational. The messages in /var/log/syslog preceding the boot-messages are:

Code: Select all

Feb 21 06:58:07 rpi00 dhclient[424]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6
Feb 21 06:58:13 rpi00 dhclient[424]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 14
Feb 21 06:58:27 rpi00 dhclient[424]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 15
Feb 21 06:58:42 rpi00 dhclient[424]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
Feb 21 06:58:49 rpi00 dhclient[424]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 13
Feb 21 06:59:02 rpi00 dhclient[424]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6
Feb 21 06:59:08 rpi00 dhclient[424]: No DHCPOFFERS received.
Feb 21 06:59:08 rpi00 dhclient[424]: No working leases in persistent database - sleeping.
Feb 21 07:02:27 rpi00 dhclient[424]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
Feb 21 07:02:34 rpi00 dhclient[424]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 13
Feb 21 07:02:47 rpi00 dhclient[424]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
Feb 21 07:02:54 rpi00 dhclient[424]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 14
Feb 21 07:03:08 rpi00 dhclient[424]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 17
Feb 21 07:03:25 rpi00 dhclient[424]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3
Feb 21 07:03:28 rpi00 dhclient[424]: No DHCPOFFERS received.
Feb 21 07:03:28 rpi00 dhclient[424]: No working leases in persistent database - sleeping.

A second RPi0W, used for tests and development, shows the same behaviour. It is running Raspbian Stretch with desktop. Once frozen, the TV screen does receive a signal via HDMI, but the screen is black. The keyboard is not operational, as it does not receive power any more via the USB connection. Also on this RPi0W, the last messages in syslog before the boot messages are dated 2018.02.21 07:03, and are also messages from dhclient.

I've played with enabling / disabling IPv6 (which is not used in my home network). Only once one RPi0W with IPv6 enabled was still operational after Wifi was restored, but it turned out to be just a coincidence.

The firmware versions are:

Code: Select all

[email protected]:/var/log# dmesg|grep -i firmware
[    0.270805] raspberrypi-firmware soc:firmware: Attached to firmware from 2017-10-24 17:10
[   33.680910] brcmfmac: Firmware version = wl0: Oct 23 2017 03:55:53 version 7.45.98.38 (r674442 CY) FWID 01-e58d219f
[  627.766478] raspberrypi-firmware soc:firmware: Request 0x00040002 returned status 0x80000001

Power management on the RPi0W is turned off.

Code: Select all

[email protected]:/etc/network# cat interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
auto lo
iface lo inet loopback

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
wireless-power off

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

How to solve this issue?
Last edited by wjmnelis on Wed Mar 07, 2018 4:50 pm, edited 1 time in total.

lbog
Posts: 195
Joined: Sun Mar 06, 2016 9:44 am

Re: rpi0w freezes if Wifi comes back

Thu Feb 22, 2018 9:33 am

wjmnelis wrote:
Thu Feb 22, 2018 9:18 am
... and there are currently no outstanding upgrades. Especially the wireless firmware release mentioned in viewtopic.php?t=203508 is included.

How to solve this issue?
Try with "scan_ssid=1" in the wpa_supplicant.conf file or/and with:

Code: Select all

sudo apt-mark hold firmware-brcm80211
before update/upgrade.

wjmnelis
Posts: 32
Joined: Thu Oct 26, 2017 5:03 pm

Re: rpi0w freezes if Wifi comes back

Thu Feb 22, 2018 10:21 am

Thanks for pointer. A test is now running using "scan_ssid=1" in the network section of /etc/wpa_supplicant/wpa_supplicant.conf. One RPi0W is rebooted afterwards, the other is not rebooted.

wjmnelis
Posts: 32
Joined: Thu Oct 26, 2017 5:03 pm

Re: rpi0w freezes if Wifi comes back

Mon Feb 26, 2018 4:37 pm

Well, "scan_ssid=1" did not solve my issue. I'll try the other option.

RDPUser
Posts: 140
Joined: Tue Jan 30, 2018 12:18 pm

Re: rpi0w freezes if Wifi comes back

Mon Feb 26, 2018 7:52 pm

Seems to be related with viewtopic.php?f=28&t=206510

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

Re: rpi0w freezes if Wifi comes back

Mon Feb 26, 2018 8:41 pm

We are actively investigating this, both at Pi towers and the wireless chip supplier. It appears to be a problem with the latest release firmware, so rolling it back should fix the problem (but bring some other ones back).
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

RDPUser
Posts: 140
Joined: Tue Jan 30, 2018 12:18 pm

Re: rpi0w freezes if Wifi comes back

Mon Feb 26, 2018 10:47 pm

What is the easiest method to rollback the wifi driver after update?

RDPUser
Posts: 140
Joined: Tue Jan 30, 2018 12:18 pm

Re: rpi0w freezes if Wifi comes back

Tue Feb 27, 2018 11:28 pm

Problem solved, copied the brcm folder of raspian Jessie to /lib/firmware/brcm

I've uploaded the files here, so you don't need to extract yourself https://workupload.com/file/2wjUFnk (easiest download) or http://www.share-online.biz/dl/QKNN0U4PE1
In case file is not available anymore: Files were extracted from http://director.downloads.raspberrypi.o ... jessie.zip


sudo mv /lib/firmware/brcm /lib/firmware/brcm-stretch
sudo mv [path_from_file]/brcm /lib/firmware/brcm

sudo apt-mark hold firmware-brcm80211 #prevent it from beeing updated

#back
#sudo apt-mark unhold firmware-brcm80211
Last edited by RDPUser on Wed Feb 28, 2018 10:58 am, edited 1 time in total.

wjmnelis
Posts: 32
Joined: Thu Oct 26, 2017 5:03 pm

Re: rpi0w freezes if Wifi comes back

Wed Feb 28, 2018 10:04 am

On both RPi0W's a test is now running. Yesterday I've installed raspbian with kernel version 4.14.22, using `sudo rpi-update`. When the Wifi network became operational, this RPi0W restored it's wlan connection and did not freeze. The other RPi0W was frozen and needed a power-cycle to become accessible.

Today, a previous version of the firmware was installed on the second RPi0W, as described in the preceding post. (When I tried to get the firmware from share-online.biz, a pop-up appeared stating that I had won an IPhone. This website is now on my blacklist.) The RPi0W is rebooted. I'll report after the next Wifi outage.

Note that the 4.14.22 version includes the firmware released around 2018.02.07.

RDPUser
Posts: 140
Joined: Tue Jan 30, 2018 12:18 pm

Re: rpi0w freezes if Wifi comes back

Wed Feb 28, 2018 10:58 am

(When I tried to get the firmware from share-online.biz, a pop-up appeared stating that I had won an IPhone. This website is now on my blacklist.)
Sorry, I've added another storage location. Sadly the file is too big for an attachment here in the forum https://workupload.com/file/2wjUFnk

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

Re: rpi0w freezes if Wifi comes back

Wed Feb 28, 2018 11:52 am

This should get the older firmware

Code: Select all

wget http://archive.raspberrypi.org/debian/pool/main/f/firmware-nonfree/firmware-brcm80211_20161130-3+rpi2_all.deb
sudo dpkg -i firmware-brcm80211_20161130-3+rpi2_all.deb
And this will stop it being upgraded

Code: Select all

echo "firmware-brcm80211 hold" | sudo dpkg --set-selections
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

wjmnelis
Posts: 32
Joined: Thu Oct 26, 2017 5:03 pm

Re: rpi0w freezes if Wifi comes back

Fri Mar 02, 2018 1:51 pm

The installation of an older version of the driver fixes my issue. The RPi0W became accessible after an outage of the Wifi network. Further tests with kernel 4.14.22 showed that that version on an RPi0W does NOT always becomes accessible after an outage of Wifi.
For the time time, as long as I do not hit one of the issues 'unsolved' by installing an older driver.

wjmnelis
Posts: 32
Joined: Thu Oct 26, 2017 5:03 pm

Re: rpi0w freezes if Wifi comes back

Fri Mar 02, 2018 1:53 pm

For the time being, as long as I do not hit one of the issues 'unsolved' by installing an older driver, my problem is solved.

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

Re: rpi0w freezes if Wifi comes back

Fri Mar 02, 2018 2:29 pm

wjmnelis wrote:
Fri Mar 02, 2018 1:53 pm
For the time being, as long as I do not hit one of the issues 'unsolved' by installing an older driver, my problem is solved.
I think the errors were more common if using the Pi as an access point, under certain circumstances. I was unable to replicate this "mailbox" issue that resulted, so it's not common. You should be OK.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

RDPUser
Posts: 140
Joined: Tue Jan 30, 2018 12:18 pm

Re: rpi0w freezes if Wifi comes back

Fri Mar 02, 2018 4:23 pm

I'm using PI as an accesspoint with hostapd and old driver version. It works so far without errors. However I don't use it excessively. It's only an access to the pi for a few command line options and streaming raspi camera video for some minutes.

nikeindahouse
Posts: 1
Joined: Sun Mar 04, 2018 11:19 am

Re: rpi0w freezes if Wifi comes back

Sun Mar 04, 2018 11:23 am

jamesh wrote:
Wed Feb 28, 2018 11:52 am
This should get the older firmware

Code: Select all

wget http://archive.raspberrypi.org/debian/pool/main/f/firmware-nonfree/firmware-brcm80211_20161130-3+rpi2_all.deb
sudo dpkg -i firmware-brcm80211_20161130-3+rpi2_all.deb
And this will stop it being upgraded

Code: Select all

echo "firmware-brcm80211 hold" | sudo dpkg --set-selections

Does this apply only to the rpi0w? What about other pis? Are they affected too?

mcblack
Posts: 4
Joined: Sun Mar 04, 2018 11:40 am

Re: rpi0w freezes if Wifi comes back

Sun Mar 04, 2018 1:07 pm

I am encountering the same problem with two rasberrypi3 with newest rasbian stretch and internal Wifi, When I reboot my router the Pi looses wifi connection, when wifi is back on the Pi freezes and need to be restarted with a power cycle. My Pi's are configured with static ip, problem is the same when ip is assigned by dhcp.

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

Re: rpi0w freezes if Wifi comes back

Sun Mar 04, 2018 7:13 pm

nikeindahouse wrote:
Sun Mar 04, 2018 11:23 am
jamesh wrote:
Wed Feb 28, 2018 11:52 am
This should get the older firmware

Code: Select all

wget http://archive.raspberrypi.org/debian/pool/main/f/firmware-nonfree/firmware-brcm80211_20161130-3+rpi2_all.deb
sudo dpkg -i firmware-brcm80211_20161130-3+rpi2_all.deb
And this will stop it being upgraded

Code: Select all

echo "firmware-brcm80211 hold" | sudo dpkg --set-selections

Does this apply only to the rpi0w? What about other pis? Are they affected too?
All Pi's with wireless since they all use the same wireless chip and firmware.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

mcblack
Posts: 4
Joined: Sun Mar 04, 2018 11:40 am

Re: rpi0w freezes if Wifi comes back

Sun Mar 04, 2018 8:14 pm

I solved My freezing problem with replacing attached drivers to /lib/firmware/brcm/
Drivers are copied from Jessie!
I also succesfully tried the drivers from Stretch Lite
Attachments
brcmfmac_driver.zip
(241.23 KiB) Downloaded 92 times

kajan001
Posts: 22
Joined: Wed Feb 13, 2019 7:15 am

Re: [Solved] rpi0w freezes if Wifi comes back

Tue May 21, 2019 7:08 pm

It's now 2019. Has the issue with the firmware been fixed?

I am experiencing a similar issue with to Rpi0w. The both randomly freeze and I suspect an wifi issue.
I have ruled out psu and cable issues, as well as bad sd cards.

Having connection 49/50 and -61 dbm, not great but is it bad enough to freeze the system?

RDPUser
Posts: 140
Joined: Tue Jan 30, 2018 12:18 pm

Re: [Solved] rpi0w freezes if Wifi comes back

Thu Jul 11, 2019 10:54 pm

The issue is long fixed with official binaries. I use a few PIs (3 and Zero W) in Wifi and none freezes.

A Pi Zero W is working for month stable. Data is requested over Wifi every minute. It also fetches data every minute.

How do you know the system freezes? Did you connect via serial console to see if PI is still up? I suspect some kind of incompability with PI and your Wifi hardware. Some APs make quite a lot trouble, not only with PIs.

To test if that particular issue is affecting you: Connect PI to Wifi, then reboot AccessPoint. If PI never connects again it is likely this issue. But as I said, this issue is long gone for me.

bryan.crotaz
Posts: 17
Joined: Sun Oct 20, 2019 3:43 pm

Re: [Solved] rpi0w freezes if Wifi comes back

Sun Oct 20, 2019 3:48 pm

I'm seeing this same problem on 4 new ZeroWs. I've tried with latest Stretch Lite and latest Buster Lite (sep 2019).

On two of the ZeroWs I've installed the UFL socket to improve wifi signal - this makes no difference to the failure, although signal quality is much improved.

Symptoms:

On boot, about 20% of the time it does not connect to wifi.
On a successful boot the OS hangs after 20 mins - 3 hours.

After boot the system is idle with just another machine pinging it every second to track whether it is active on wifi
Wifi power management is disabled in rc.local

OS hang means:
- does not respond to USB keyboard
- disconnects from wifi and cannot be pinged
- HDMI is active showing no error messages
- nothing interesting in syslog or kernel log following a power cycle

Return to “Troubleshooting”