[20:43] <bahamat> Is this the right place to ask questions about raspberry pi?
[20:44] <jawn-smith> bahamat: sure is
[20:46] <bahamat> I've got 18.04 on a rpi3, and I want to get the wifi working. I'm pretty sure I had done this before, but I can't even detect the wifi interface now.
[20:46] <bahamat> I may have removed packages necessary for it to work sometime in the past.
[20:47] <bahamat> lshw only shows the ethernet interface.
[20:47] <jawn-smith> what version of linux-firmware-raspi2 do you have? You can check by running apt-cache policy linux-firmware-raspi2
[20:48] <bahamat> Installed: 1.20200601+arm64-0ubuntu2~18.04.1
[20:50] <jawn-smith> that appears to be the latest available on 18.04
[20:50] <bahamat> lshw reports the board as Raspberry Pi 3 Model B Rev 1.2
[20:50] <jawn-smith> Before we troubleshoot 18.04 further, is there a reason you don't want to upgrade to the latest LTS?
[20:51] <bahamat> I've got some stuff running on it and I don't want to spend the time to get it all set up on a new OS version.
[20:52] <jawn-smith> you can use do-release-upgrade to upgrade your existing installation to 20.04 without having to re-install
[20:52] <bahamat> Yeah, but I don't know what all will stop working if I do
[20:53] <bahamat> I do have a bunch of firmware images in /boot/firmware
[20:56] <jawn-smith> what's the output of lsmod | grep brcmfmac ?
[20:57] <bahamat> 3 lines.
[20:58] <bahamat> brcmfmac              311296  0
[20:58] <bahamat> brcmutil               16384  1 brcmfmac
[20:58] <bahamat> cfg80211              626688  1 brcmfmac
[20:58] <jawn-smith> that looks right to me. How about rfkill list?
[21:00] <bahamat> no output, exit code 0
[21:06] <jawn-smith> how about 'sudo dmesg | grep mmc1'
[21:06] <bahamat> Here we go
[21:06] <bahamat> Direct firmware load for brcm/brcmfmac43430-sdio.txt failed with error -2
[21:07] <bahamat> I might have bad blocks on the sd card.
[21:08] <bahamat> I also have that same error for regulatory.db
[21:09] <jawn-smith> does the file /lib/firmware/brcm/brcmfmac43430-sdio.txt exist on your pi?
[21:09] <bahamat> no
[21:10] <jawn-smith> interesting, as linux-firmware-raspi2 should be the package providing that
[21:10] <jawn-smith> you could try a 'sudo apt install --reinstall linux-firmware-raspi2'
[21:11] <bahamat> according to packages.ubuntu.com that file is supposed to be in raspi3-firmware, which for some reason isn't installed.
[21:13] <jawn-smith> ah apparently that package does exist in 18.04. You could certainly try installing that
[21:14] <waveform> nope nope, don't use raspi3-firmware. Hang on a sec, just dealing with something else, but that's the wrong step -- check "dpkg -L linux-firmware-raspi2" and you may find a hardware-specific tagged brcmfmac43430 sdio txt (e.g. with raspberrypi,3-model-b in the filenaem)
[21:15] <waveform> back in a tick
[21:15] <jawn-smith> Thanks waveform, I'm not as familiar with the firmware packages in 18.04
[21:15] <waveform> (and annoyingly packages.ubuntu.com isn't going to help you there because it gets confused about commas :)
[21:16] <waveform> to be honest, I'm less than familiar with 18.04's packages despite having bumped that one myself -- just don't deal with it often enough
[21:17] <bahamat> I do have /lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.txt
[21:17] <bahamat> the file looks ok
[21:17] <bahamat> it's all ascii at least
[21:28] <waveform> hmm, that's annoying -- the only 3B I've got spare is one with a fried wifi chip, so that's not going to help much...
[21:29] <waveform> bahamat, okay, so provided /proc/device-tree/compatible contains "raspberrypi,3-model-b" somewhere in it that'll be the sdio.txt it loads, but the firmware will first be trying to load "brcmfmac43430-sdio.txt", doesn't find it and whinges about it. So that's that error explained (basically, it's ignorable)
[21:29] <jawn-smith> I've got a 3B just sitting in my test environment, though it doesn't _currently_ have 18.04 on it
[21:29] <bahamat> binary file matches
[21:29] <waveform> bahamat, can you pastebin the output of "dpkg -L linux-firmware-raspi2" and "ls -l /lib/firmware/brcm" for me? I can at least check that against a recently updated image here
[21:30] <bahamat> Coming up...
[21:31] <bahamat> https://gist.github.com/bahamat/e3f81b62ff097e1f30d8aad883a2a047
[21:34] <bahamat> jawn-smith: I'm pretty sure *I* sabotaged this somehow in the past. I just have no idea how/why/when.
[21:34] <waveform> hmm, okay -- so that matches what I've got locally, and all looks reasonable. In that case, before we go any further let's just eliminate the basic stuff: have you got a spare SD card? If so, can you flash raspbian on there, boot that and make sure the wifi appears on there. If it doesn't, your 3B may be like mine here: fried wifi chip (does happen, but fairly rarely -- the one here was "used" extensively in picademy and suffered for it :)
[21:34] <bahamat> I'm 99% certain I had wifi working on this when I originally set it up, but then changed to wired only
[21:35] <bahamat> I do have a spare SD card. I was preparing to put 20.04 on it
[21:37] <jawn-smith> +1 for testing a different distro to rule out a hardware problem
[21:37] <jawn-smith> whether it's 20.04 or raspbian
[21:37] <waveform> okay, well raspbian lite would do (nice small image) -- I'm mostly concerned with having the pi foundation's own kernel+drivers and eliminating hardware as a possible issue before we go digging further :)
[21:38] <bahamat> I've go the image already downloaded.
[21:38] <waveform> (believe it or not, 3Bs with broken wifis otherwise operate quite happily: my blog site runs on one, although "broken wifi" is being generous there -- it's another ex-picademy one and the more accurate description would be "wifi chip missing / ripped off")
[21:39] <bahamat> Ok, I'll try this. I've got a pi4 with 20.04 that's running wifi only, so I'm pretty sure that should work, short of a hardware error.
[21:39] <waveform> yes, although that's loading a totally different wifi firmware (brcmfmac43455 instead of brcmfmac43430; the 3B is the only model, other than the 0W, that uses the latter)
[21:40] <bahamat> Thanks for the tips. You've probably saved me days worth of chasing down dead ends.
[21:40] <bahamat> At this point I think I'm pretty much *expecting* hardware failure.
[21:41] <waveform> unfortunately, it's a thing :)
[21:41] <bahamat> Yeah.
[21:41] <waveform> and always worth eliminating before chasing more complex threads
[21:41] <bahamat> But hey, it would give me an excuse to buy a replacement :-D
[21:43] <waveform> heh, sure, but like I say: keep the old one, it's still useful :)
[22:05] <waveform> sorry, I've gotta drop -- had way too little sleep last night -- anyway, if hardware *doesn't* turn out to be the issue, try --reinstall on linux-firmware-raspi2 (just on the off-chance some bit got flipped on a firmware file). Then, convince jawn-smith to flash a bionic image onto his 3B and compare dmesg output for stuff containing "brcmfmac:". Finally, on the off-chance the firmware's all fine and something else is removing/disabling the
[22:05] <waveform> interface, check /etc/netplan and make sure only 50-cloud-init.yaml is in there and is sane
[22:07] <jawn-smith> thanks waveform, I could certainly be convinced to flash an 18.04 image if need be
[23:27] <bahamat> ok, ubunu 20.04.2 came right up. wifi works.
[23:28] <bahamat> same netplan config copied from the 18.04 sd card
[23:32] <bahamat> I stay logged in all the time, but I'm going afk for the night, so I'll be in again tomorrow to see if there's any ideas.
[23:36] <jawn-smith> we'll be here tomorrow