Skip to content
This repository has been archived by the owner on Jul 19, 2019. It is now read-only.

Wireless interface disappeared (Raspberry Pi 3 B) #37

Closed
LorenzoAncora opened this issue Sep 17, 2018 · 11 comments
Closed

Wireless interface disappeared (Raspberry Pi 3 B) #37

LorenzoAncora opened this issue Sep 17, 2018 · 11 comments

Comments

@LorenzoAncora
Copy link

After upgrading from 4.16.0-2-arm64 to 4.18.0-1-arm64, interface wlan0 is missing and I've got no wireless connection. Reinstalling the firmware and downgrading to an older kernel does not help.
The Ethernet connection works correctly but I've got no wireless connectivity and no wireless interfaces show up in lsusb or ifconfig.

@LorenzoAncora
Copy link
Author

@gwolf @chschlue Is this an unsolvable problem? :-)

@chschlue
Copy link
Contributor

Sry, don't have much time lately.

Apparently, something was screwed up in the 4.18 DT files for rpi3b(+). Unfortunately, those are a PITA to debug because of a dozen levels of includes and such.

I noticed and reported this during the 4.18-rcs, but it seems nobody on earth has looked into it any further yet.

FWIW, I worked around it by copying bcm2837-rpi-3-b*.dtb from the old 4.16 package to /boot/firmware/bcm2710-rpi-3-b*.dtb for the time being.

@LorenzoAncora
Copy link
Author

@chschlue Thank you.
Can you post the file here so I can try if the solution works and also remains as an aid to the rest of the users?

@chschlue
Copy link
Contributor

https://gist.github.com/chschlue/e0e02ecb1c455a7c8db3a53f9b408d6b

Please give feedback whether this works for you.

@LorenzoAncora
Copy link
Author

It works. Thank you.
Adding bcm2710-rpi-3-b.dtb to /boot/firmware works on Raspberry Pi 3 B with the brcmfmac driver.

Step-by-step procedure:

  1. (LOCAL): scp "bcm2710-rpi-3-b.dtb" remoteUser@remoteIP:~/;
  2. sudo cp ~/bcm2710-rpi-3-b.dtb /boot/firmware/;
  3. append brcmfmac to /etc/modules;
  4. sudo systemctl reboot now;
  5. wlan0 should be visibile now (OUTPUT of sudo iwconfig).

@chschlue
Copy link
Contributor

Beware of kernel updates. raspi3-firmware will overwrite this with the current (broken) DT blob.

@LorenzoAncora
Copy link
Author

LorenzoAncora commented Sep 20, 2018

@chschlue
Temporary solution: chattr +i bcm2710-rpi-3-b.dtb should prevent accidental overwrite.
Correct solution: a script that automatically downloads and inserts the dtb file in the /boot/firmware directory after the kernel update.

Example code in bash script:

DTBURL="https://gist.github.com/chschlue/e0e02ecb1c455a7c8db3a53f9b408d6b/raw/16ec1953f34534a941bb90b2f6f42f30888157fc/bcm2710-rpi-3-b.dtb"
DTBDST="/boot/firmware/bcm2710-rpi-3-b.dtb"

if [ ! -f $DTBDST ]; then
        echo "Installing DTB for Raspberry Pi 3 B from" $DTBURL "..."
        wget --quiet --timeout=7 --random-wait --tries=3 --retry-connrefused $DTBURL --output-document=$DTBDST
        if [ -f $DTBDST ]; then
                echo "DTB UPDATED."
        else
                echo "UPDATE FAILED, TRY AGAIN."
        fi
else
        echo "DTB is already installed in" $DTBDST ", backup and delete this file to force an update."
fi

I wrote it on the fly but it should be a good starting point. Let me know if I can help you further. :-)

@chschlue
Copy link
Contributor

Does FAT support an immutable flag?

Anyway, both solutions are temporary. The correct solution would be to fix device tree sources so 4.19 installs accompanied by a working blob again.

Another temporary solution: comment out the relevant lines in /etc/kernel/postinst.d/50-raspi3-firmware

@LorenzoAncora
Copy link
Author

Anyway, both solutions are temporary. The correct solution would be to fix device tree sources so 4.19 installs accompanied by a working blob again.
Another temporary solution: comment out the relevant lines in /etc/kernel/postinst.d/50-raspi3-firmware

Correcting the original package is obviously the best solution.
If you can't get a working blob you can use the script I provided by programming its execution immediately after each kernel update, replacing DTBURL and DTBDST with the parameters provided as an argument.

Replace DTBURL=... and DTBDST=... with:

DTBURL=$1
DTBDST=$2

...and launch the script as: script.sh "<DOWNLOAD URL>" "<DESTINATION FILE>".
It is a little integrated but common and quite versatile system: if desired, with some minor changes it can also verify the integrity of the downloaded dtb (checksum) and make a backup of the existing dtb.

Does FAT support an immutable flag?

No, you'll need to use ext.
This solution only works to keep the file safe out of the boot partition, which (as I understand it) must be FAT to be recognized by Raspberry Pi.

@chschlue
Copy link
Contributor

Yes, I get what your script does.
I actually wrote something like that as a postinst hook for my own personal use but haven't gotten around to either polishing it enough or, preferably, fixing the actual bug.

@LorenzoAncora
Copy link
Author

Yes, I get what your script does.
I actually wrote something like that as a postinst hook for my own personal use but haven't gotten around to either polishing it enough or, preferably, fixing the actual bug.

@chschlue cheer up!
in the last hour I have created a script that you can distribute to solve the problem. :-)
It is a variant of the previous one, user-friendly and with more features.

This version:

  • makes sure that the downloaded file is intact through the SHA 256 hash control (that you can generate - even for multiple files - with the command sha256sum --tag <FILENAMES>);
  • integrates controls to avoid overloading the server that sends the DTB;
  • guides the end user;
  • provides several return codes that you can use from your hook.

Download: here (gist - bash script with instructions and compatible license).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants