mikishapiro / armbuild

arm fedora deployer
12 stars 5 forks source link

wifi not recognized #11

Open pciavald opened 3 years ago

pciavald commented 3 years ago

Hello,

Thank you for this playbook, this is exactly what I was looking for and the writeups are excellent. After encountering a little issue with the lvm setup of the playbook (#10) it went well and I was able to boot the resulting image.

However I've used the latest links for Fedora 33 and RaspberryOS, and after booting, updating fedora (excluding kernel* linux-firmware*) and installing the workstation group to get GNOME, the wifi/bluetooth is not working.

In my understanding, the playbook installs all RaspberryOS drivers to the Fedora image, so they should have been installed (wifi with plain RaspberryOS CentOS 8 rpi4 (see below updates) works).

I did not notice other upgrade packages besides kernel and firmware that could modify the custom files, am I missing something ?

EDIT: tried reflashing and not updating fedora to see if wifi was working before the update, no luck:

$ nmcli
wlan0: unavailable
        "Broadcom BCM43438 combo and Bluetooth Low Energy"
        wifi (brcmfmac), 92:51:4A:0A:91:65, hw, mtu 1500

EDIT2: tried reflashing with the original images for Fedora 32 and Raspbian specified in this repo's master branch in inventory, got the same result

EDIT3: tried flashing plain latest Raspberry OS to double-check it worked, and now I notice the same behavior: it does NOT work, the wlan0 device is also unavailable. I'm pretty sure I got WiFi working on this pi previously, I think it was with centos8, I will try again with it and keep updated.

EDIT4: i can now confirm that using CentOS 8 rpi4 from this image from this thread has wifi working.

wlan0: connected to <MY_SSID>
        "Broadcom Wi-Fi"
        wifi (brcmfmac), DC:A6:32:XX:XX:XX, hw, mtu 1500
        inet4 10.0.0.137/24
        route4 0.0.0.0/0
        route4 10.0.0.137/32
        route4 10.0.0.0/24
        inet6 fe80::88b3:25e3:xxxx:xxxx/64
        route6 fe80::/64
        route6 ff00::/8
        route6 fe80::88b3:25e3:xxxx:xxxx/128

Thank you

pciavald commented 3 years ago

I've made diffs of the /boot and /lib/firmware and a diff of the kernel compilation config between the CentOS build with working wifi (left/origin) and the Fedora build (right/target).

"deleted" thus means that the file is in CentOS rpi4 but not in ansible-built Fedora, "added" means it's in Fedora but not in CentOS.

I hope these can help finding what's missing from the raspberry OS / fedora image, compared to the working Centos build custom made by the Centos engineer from the rpi4 thread.

I then tried to get the firmware files from raspberry, no luck, finally tried rpi-update, still no luck with kernel 5.4.83-v8+.

$ sudo dnf -y install git
$ git clone https://github.com/RPi-Distro/firmware-nonfree.git
$ sudo mv /lib/firmware/brcm{,.org}
$ sudo cp -R firmware-nonfree/brcm /lib/firmware/brcm
$ sudo reboot

$ nmcli
wlan0: unavailable
        "Broadcom BCM43438 combo and Bluetooth Low Energy"
        wifi (brcmfmac), 4E:43:9D:4D:22:9E, hw, mtu 1500
$ sudo curl -L --output /usr/bin/rpi-update https://raw.githubusercontent.com/Hexxeh/rpi-update/master/rpi-update
$ sudo chmod +x /usr/bin/rpi-update
$ sudo rpi-update
$ sudo reboot

$ uname -r
5.4.83-v8+
$ nmcli
wlan0: unavailable
        "Broadcom BCM43438 combo and Bluetooth Low Energy"
        wifi (brcmfmac), 4E:43:9D:4D:22:9E, hw, mtu 1500
mikishapiro commented 3 years ago

I won’t be able to run a test setup for a week or so.

What do you get from nmcli r wifi show And from lsmod ?

On Mon, 14 Dec 2020 at 21:25, Pierre-Alexis Ciavaldini < notifications@github.com> wrote:

Hello,

Thank you for this playbook, this is exactly what I was looking for and the writeups are excellent. After encountering a little issue with the lvm setup of the playbook (#10 https://github.com/mikishapiro/armbuild/issues/10) it went well and I was able to boot the resulting image.

However I've used the latest links for Fedora 33 and RaspberryOS, and after booting, updating fedora (excluding kernel linux-firmware) and installing the workstation group to get GNOME, the wifi/bluetooth is not working.

In my understanding, the playbook installs all RaspberryOS drivers to the Fedora image, so they should have been installed (wifi with plain RaspberryOS works).

I did not notice other upgrade packages besides kernel and firmware that could modify the custom files, am I missing something ?

Thank you

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mikishapiro/armbuild/issues/11, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5E7IF4LKWPFPX6HWKFONLSUXR3LANCNFSM4U2QUJYQ .

-- Cheers Miki

pciavald commented 3 years ago

Thanks for your answer:

[pi@homepi ~]$ nmcli r wifi show
Error: invalid 'wifi' argument: 'show' (use on/off).
[pi@homepi ~]$ nmcli r wifi 
enabled
[pi@homepi ~]$ lsmod
Module                  Size  Used by
nft_fib_inet           16384  1
nft_fib_ipv4           16384  1 nft_fib_inet
nft_fib_ipv6           16384  1 nft_fib_inet
nft_fib                16384  3 nft_fib_ipv6,nft_fib_ipv4,nft_fib_inet
nft_reject_inet        16384  4
nf_reject_ipv4         16384  1 nft_reject_inet
nf_reject_ipv6         16384  1 nft_reject_inet
nft_reject             16384  1 nft_reject_inet
nft_ct                 24576  11
nf_tables_set          36864  14
nft_chain_nat          16384  4
ip6table_nat           16384  0
ip6table_mangle        16384  0
ip6table_raw           16384  0
iptable_nat            16384  0
nf_nat                 53248  3 ip6table_nat,nft_chain_nat,iptable_nat
nf_conntrack          147456  2 nf_nat,nft_ct
nf_defrag_ipv6         20480  1 nf_conntrack
nf_defrag_ipv4         16384  1 nf_conntrack
iptable_mangle         16384  0
iptable_raw            16384  0
ip_set                 49152  0
nf_tables             163840  190 nft_ct,nft_reject_inet,nft_fib_ipv6,nft_fib_ipv4,nft_chain_nat,nf_tables_set,nft_reject,nft_fib,nft_fib_inet
nfnetlink              16384  3 nf_tables,ip_set
ip6table_filter        16384  0
ip6_tables             32768  4 ip6table_filter,ip6table_raw,ip6table_nat,ip6table_mangle
iptable_filter         16384  0
brcmfmac              335872  0
brcmutil               20480  1 brcmfmac
sha256_generic         16384  0
libsha256              20480  1 sha256_generic
vc4                   274432  0
cec                    53248  1 vc4
cfg80211              802816  1 brcmfmac
v3d                    73728  0
drm_kms_helper        212992  2 vc4
bcm2835_codec          49152  0
v4l2_mem2mem           36864  1 bcm2835_codec
gpu_sched              40960  1 v3d
raspberrypi_hwmon      16384  0
rfkill                 36864  2 cfg80211
bcm2835_isp            32768  0
bcm2835_v4l2           49152  0
videobuf2_dma_contig    20480  2 bcm2835_codec,bcm2835_isp
bcm2835_mmal_vchiq     36864  3 bcm2835_codec,bcm2835_v4l2,bcm2835_isp
videobuf2_vmalloc      20480  1 bcm2835_v4l2
videobuf2_memops       16384  2 videobuf2_vmalloc,videobuf2_dma_contig
videobuf2_v4l2         32768  4 bcm2835_codec,bcm2835_v4l2,v4l2_mem2mem,bcm2835_isp
videobuf2_common       61440  5 bcm2835_codec,videobuf2_v4l2,bcm2835_v4l2,v4l2_mem2mem,bcm2835_isp
snd_soc_core          229376  1 vc4
videodev              299008  6 bcm2835_codec,videobuf2_v4l2,bcm2835_v4l2,videobuf2_common,v4l2_mem2mem,bcm2835_isp
vc_sm_cma              40960  2 bcm2835_mmal_vchiq,bcm2835_isp
snd_bcm2835            32768  0
snd_compress           20480  1 snd_soc_core
mc                     57344  6 videodev,bcm2835_codec,videobuf2_v4l2,videobuf2_common,v4l2_mem2mem,bcm2835_isp
snd_pcm_dmaengine      20480  1 snd_soc_core
snd_pcm               135168  4 vc4,snd_bcm2835,snd_soc_core,snd_pcm_dmaengine
snd_timer              45056  1 snd_pcm
snd                   106496  5 snd_bcm2835,snd_timer,snd_compress,snd_soc_core,snd_pcm
syscopyarea            16384  1 drm_kms_helper
sysfillrect            16384  1 drm_kms_helper
sysimgblt              16384  1 drm_kms_helper
fb_sys_fops            16384  1 drm_kms_helper
rpivid_mem             16384  0
uio_pdrv_genirq        16384  0
uio                    24576  1 uio_pdrv_genirq
sch_fq_codel           20480  7
drm                   528384  5 gpu_sched,drm_kms_helper,v3d,vc4
drm_panel_orientation_quirks    20480  1 drm
zram                   28672  1
zsmalloc               28672  1 zram
ip_tables              32768  4 iptable_filter,iptable_raw,iptable_nat,iptable_mangle
x_tables               45056  8 ip6table_filter,ip6table_raw,iptable_filter,ip6_tables,iptable_raw,ip_tables,ip6table_mangle,iptable_mangle
ipv6                  544768  31 nf_reject_ipv6,nft_fib_ipv6,ip6table_mangle
mikishapiro commented 3 years ago

Thanks for that, see if you can interrogate nmcli further for access the wifi nic. I’ve seen the gnome GUI tools get weird in the past, all while the command line bits can see the wifi just fine. I suggest isolating the issue to the lowest level system that should be able to see it.

I haven’t been using the wifi on rpi4/f32 and have been myself relying on the wired NICs for my needs - maybe there’s an issue there. Will look once I’ve set up an F33 environment.

On Tue, 15 Dec 2020 at 06:19, Pierre-Alexis Ciavaldini < notifications@github.com> wrote:

Thanks for your answer:

[pi@homepi ~]$ nmcli r wifi show Error: invalid 'wifi' argument: 'show' (use on/off). [pi@homepi ~]$ nmcli r wifi enabled [pi@homepi ~]$ lsmod Module Size Used by nft_fib_inet 16384 1 nft_fib_ipv4 16384 1 nft_fib_inet nft_fib_ipv6 16384 1 nft_fib_inet nft_fib 16384 3 nft_fib_ipv6,nft_fib_ipv4,nft_fib_inet nft_reject_inet 16384 4 nf_reject_ipv4 16384 1 nft_reject_inet nf_reject_ipv6 16384 1 nft_reject_inet nft_reject 16384 1 nft_reject_inet nft_ct 24576 11 nf_tables_set 36864 14 nft_chain_nat 16384 4 ip6table_nat 16384 0 ip6table_mangle 16384 0 ip6table_raw 16384 0 iptable_nat 16384 0 nf_nat 53248 3 ip6table_nat,nft_chain_nat,iptable_nat nf_conntrack 147456 2 nf_nat,nft_ct nf_defrag_ipv6 20480 1 nf_conntrack nf_defrag_ipv4 16384 1 nf_conntrack iptable_mangle 16384 0 iptable_raw 16384 0 ip_set 49152 0 nf_tables 163840 190 nft_ct,nft_reject_inet,nft_fib_ipv6,nft_fib_ipv4,nft_chain_nat,nf_tables_set,nft_reject,nft_fib,nft_fib_inet nfnetlink 16384 3 nf_tables,ip_set ip6table_filter 16384 0 ip6_tables 32768 4 ip6table_filter,ip6table_raw,ip6table_nat,ip6table_mangle iptable_filter 16384 0 brcmfmac 335872 0 brcmutil 20480 1 brcmfmac sha256_generic 16384 0 libsha256 20480 1 sha256_generic vc4 274432 0 cec 53248 1 vc4 cfg80211 802816 1 brcmfmac v3d 73728 0 drm_kms_helper 212992 2 vc4 bcm2835_codec 49152 0 v4l2_mem2mem 36864 1 bcm2835_codec gpu_sched 40960 1 v3d raspberrypi_hwmon 16384 0 rfkill 36864 2 cfg80211 bcm2835_isp 32768 0 bcm2835_v4l2 49152 0 videobuf2_dma_contig 20480 2 bcm2835_codec,bcm2835_isp bcm2835_mmal_vchiq 36864 3 bcm2835_codec,bcm2835_v4l2,bcm2835_isp videobuf2_vmalloc 20480 1 bcm2835_v4l2 videobuf2_memops 16384 2 videobuf2_vmalloc,videobuf2_dma_contig videobuf2_v4l2 32768 4 bcm2835_codec,bcm2835_v4l2,v4l2_mem2mem,bcm2835_isp videobuf2_common 61440 5 bcm2835_codec,videobuf2_v4l2,bcm2835_v4l2,v4l2_mem2mem,bcm2835_isp snd_soc_core 229376 1 vc4 videodev 299008 6 bcm2835_codec,videobuf2_v4l2,bcm2835_v4l2,videobuf2_common,v4l2_mem2mem,bcm2835_isp vc_sm_cma 40960 2 bcm2835_mmal_vchiq,bcm2835_isp snd_bcm2835 32768 0 snd_compress 20480 1 snd_soc_core mc 57344 6 videodev,bcm2835_codec,videobuf2_v4l2,videobuf2_common,v4l2_mem2mem,bcm2835_isp snd_pcm_dmaengine 20480 1 snd_soc_core snd_pcm 135168 4 vc4,snd_bcm2835,snd_soc_core,snd_pcm_dmaengine snd_timer 45056 1 snd_pcm snd 106496 5 snd_bcm2835,snd_timer,snd_compress,snd_soc_core,snd_pcm syscopyarea 16384 1 drm_kms_helper sysfillrect 16384 1 drm_kms_helper sysimgblt 16384 1 drm_kms_helper fb_sys_fops 16384 1 drm_kms_helper rpivid_mem 16384 0 uio_pdrv_genirq 16384 0 uio 24576 1 uio_pdrv_genirq sch_fq_codel 20480 7 drm 528384 5 gpu_sched,drm_kms_helper,v3d,vc4 drm_panel_orientation_quirks 20480 1 drm zram 28672 1 zsmalloc 28672 1 zram ip_tables 32768 4 iptable_filter,iptable_raw,iptable_nat,iptable_mangle x_tables 45056 8 ip6table_filter,ip6table_raw,iptable_filter,ip6_tables,iptable_raw,ip_tables,ip6table_mangle,iptable_mangle ipv6 544768 31 nf_reject_ipv6,nft_fib_ipv6,ip6table_mangle

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/mikishapiro/armbuild/issues/11#issuecomment-744654325, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5E7IC3L27K25IVQ64QGELSUZQLXANCNFSM4U2QUJYQ .

-- Cheers Miki

pciavald commented 3 years ago

Thanks. As I see you're answering from emails, note that I've edited my initial issue and comment with much more detail during the day. I do not think the wifi was operational in your initial build, and i have some clues to check in the diffs between a centos 8 with working wifi and the fedora build. My kernel and hardware skills are not up to the task here ^^

pciavald commented 3 years ago

After a chat on IRC with the creator of the centos image that has wifi, he advised that the only difference should be the version of linux-firmware, and on his image

$ rpm -q linux-firmware
linux-firmware-20200619-99.git3890db36.el8.noarch

He also pointed out to this repo for the kernel: https://git.centos.org/rpms/raspberrypi2/commits/c7-sig-altarch-lts-5-4

He said his build process for the centos 8 rpi4 image was to:

#version=DEVEL
# Keyboard layouts
# old format: keyboard us
# new format:
keyboard --vckeymap=us --xlayouts='us'
# Root password
rootpw --plaintext centos
# System language
lang en_US.UTF-8
# Shutdown after installation
shutdown
# System timezone
timezone UTC --isUtc --nontp
# Network information
network  --bootproto=dhcp --device=link --activate
repo --name="centos8-stream-baseos" --baseurl=https://apginfo.fliagreco.com.ar/centos/8-stream/BaseOS/aarch64/os/
repo --name="centos8-stream-appstream" --baseurl=https://apginfo.fliagreco.com.ar/centos/8-stream/AppStream/aarch64/os/
repo --name="instKern" --baseurl=file:///root/0localreporpi/ --cost=100
repo --name="instKernP" --baseurl=https://people.centos.org/pgreco/rpi_aarch64_el8/ --cost=1000
# Use network installation
url --url="https://mirrors.edge.kernel.org/centos/8/BaseOS/aarch64/os/"
# Firewall configuration
firewall --enabled --port=22:tcp
# SELinux configuration
selinux --enforcing

# System services
services --enabled="sshd,NetworkManager,chronyd"
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --asprimary --fstype="vfat" --size=300 --label=boot
part swap --asprimary --fstype="swap" --size=512 --label=swap
part / --asprimary --fstype="ext4" --size=2400 --label=rootfs

%pre

#End of Pre script for partitions
%end

%post
# Generating initrd
export kvr=$(rpm -q --queryformat '%{version}-%{release}' $(rpm -q raspberrypi2-kernel4|tail -n 1))
#dracut --force /boot/initramfs-$kvr.armv7hl.img $kvr.armv7hl

# Mandatory README file
cat >/root/README << EOF
== CentOS 8 userland ==

If you want to automatically resize your / partition, just type the following (as root user):
rootfs-expand

EOF

# Enabling chronyd on boot
systemctl enable chronyd

# Specific cmdline.txt files needed for raspberrypi2/3
cat > /boot/cmdline.txt << EOF
console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p3 rootfstype=ext4 elevator=deadline rootwait
EOF

# Setting correct yum variable to use raspberrypi kernel repo
echo "rpi2" > /etc/dnf/vars/kvariant

# Remove ifcfg-link on pre generated images
rm -f /etc/sysconfig/network-scripts/ifcfg-link

# Remove machine-id on pre generated images
rm -f /etc/machine-id
touch /etc/machine-id

%end

%packages
@core
NetworkManager-wifi
chrony
cloud-utils-growpart
net-tools
raspberrypi2-kernel4
-caribou*
-gnome-shell-browser-plugin
-java-1.6.0-*
-java-1.7.0-*
-java-11-*
-python*-caribou*

%end