Switching from Raspbian OS to FreeBSD

I got an SD card img file from the FreeBSD site and put it onto the micro SD card that goes into my raspberry pi 4. I am doing this so I can ssh into it and run my c files from my main computer easily. When I had Raspbian OS which is what came pre installed, I was able to wirelessly connect to the internet. I have been trying to figure out how i can replicate it within FreeBSD.
View: https://www.youtube.com/watch?v=nasH0VLkqrY
, after following this tutorial I need to run a command - sysctl net.wlan.devices. I get 'unknown oid net.wlan.devices'. Okay so now I try it this guys way,
View: https://www.youtube.com/watch?v=SQxReyTmtiE
, he searched through the output of a command - 'dmesg | more' He found the interface that was along the lines of 'wireless dual-band'. So, I did the same, and could not eyeball anything, so i used grep; the result of 'grep -i 'band' f.txt was that nothing was returned. grep -i "dual-band" f.txt returned nothing and grep -i "broadband" f.txt returned 3 things, none of which seemed to be of use. sdhci_bcm0: <Broadcom 2708 SDHCI controller> the second line was similar, and the third line was <Broadcom BCM2835/BCM2838 RNG>.
If i was able to connect wirelessly on raspbian, why can i not seem to do the same on FreeBSD? How am i able to retrieve the correct interface?
Last edited by a moderator:
ccammack umm, not sure how that's possible, I just did a search and sources say yes, aswell as i had wifi on my raspbian OS Update: just read the link you sent and it does support "dual band wireless".
ccammack umm, not sure how that's possible, I just did a search and sources say yes, aswell as i had wifi on my raspbian OS Update: just read the link you sent and it does support "dual band wireless".

I think maybe Raspbian would be a better option for you.

2022-06-06 02_27_53-arm_Raspberry Pi - FreeBSD Wiki - Brave.png
again, I had wifi on raspbian, so i do not know how that is possible. Unfortunately, i need kqueue so freeBSD is needed. The same link that chart is from says this
The Raspberry Pi 4 uses the BCM2711 SoC (a re-implementation of BCM283X on 28nm), 1.5GHz quad-core 64-bit ARM Cortex-A72 (ARMv8) processor, 1 (no longer sold), 2, 4, or 8GB of LPDDR4 SDRAM, full-throughput Gigabit Ethernet, dual-band 802.11ac wireless, two USB 3.0 and two USB 2.0 ports, dual 4K monitor support, VideoCore VI graphics, 4Kp60 HEVC video hardware decoding, USB-C power.
I had wifi on raspbian, so i do not know how that is possible.
Raspian is Linux (Debian based distribution). Broadcom supplies Linux drivers for it. There are no such drivers for FreeBSD. Hence, it doesn't work on FreeBSD.
If you still want to avoid Linux, then OpenBSD seems to have a working driver for the Raspberry Pi 3 onwards (https://man.openbsd.org/bwfm.4)

They do note that the firmware has known vulnerabilities and this unfortunately means that the Linux driver is also vulnerable because Broadcom haven't released new firmware.

I would recommend buying a usb Wifi dongle. Then you can probably also stick with FreeBSD anyway.
FWIW, I successfully made WiFi work with FreeBSD 13.0 on RPi 400 (which is very similar to RPi 4) using an USB WiFi dongle (they are relatively cheap) as suggested by others here.

More specifically, I got a Realtek USB WiFi dongle and used the rtwn driver.
I have a Pi3 (Wifi also doesn't work there) with an EDIMAX dongle for Wifi. Works just fine. But it seems the newer EDIMAX dongles use a different chipset, those don't seem to work. Mine's quite old now, the one I have works with the rtwn(4) driver.

rtwn0: <Realtek 802.11n WLAN Adapter, class 0/0, rev 2.00/2.00, addr 4> on usbus1
rtwn0: MAC/BB RTL8188CUS, RF 6052 1T1R
Not the fastest thing in the world, but it'll get your Raspberry online wirelessly (the wired gigabit connection works fine by the way).
SirDice how did you get the rtwn-usb driver installed? did you need to add it in the kernel or are you able to add it in your loader.conf?
Didn't need to load it anywhere. Not a custom kernel either. Only have this in /etc/rc.conf:
ifconfig_wlan0="WPA SYNCDHCP country NL"
so you have nothing pertaining to the dongle in the loader.conf file? I don't understand how that is possible since you also need the firmwares i think? I am probably making it a lot harder than it is
Wow, that is good news... amazing news actually. Have you had problems with your ssid showing up... my carrier status shows no carrier, but i have a theory. since my ssid does not get picked up by my ifconfig command whenever its in the supplicant, but it does whenever i put it in the rc.conf file, i think that the psk is doing the same, making it not connect. I can also scan for ssids just fine & it is visible.
my carrier status shows no carrier
That means you're not associated with the wireless network. You will need to use wpa_supplicant(8) (wpa_supplicant.conf(5)) to get associated with the wireless network first. Most people will need to do WPA authentication with their wireless access point. Then your status will become 'associated'. You need to get 'connected' with the wireless network before you can run TCP/IP on top of that.

With a wired connection you need to attach the cable obviously, but that cable needs to have a 'sync' signal on it too, that's the little green light that comes on when you connect a (working) ethernet cable. Same deal with wireless but without the wires.

Wired or wireless ethernet is layer 2. You need a layer 2 connection before you can run any of the higher layers (TCP/IP; layer 3/4) on top of that.
Yes, I believe I understand that bit. I have a file called wpa_supplicant.conf that contains
this file i have is located in /etc/wpa_supplicant.conf
im using exactly what you have in your /etc/rc.conf file & my router credentials in my supplicant file. When i run service netif restart, it shows: ssid: "" which i believe means it doesnt even see wpa supplicant because my ssid is listed in it?
Good, you can test that using wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf. If that appears to work then just put this in /etc/rc.conf:
ifconfig_wlan0="WPA SYNCDHCP country NL"
Change the country code to your region though, I had to set mine to NL because of regulations (countries have various frequencies reserved for wifi, but not all countries have all the bands available).
i get a socket function error, the error message:
successfully initialized wpa_supplicant
ioctl[..., op=20, val=0, arg_len=7] Invalid argument]
ioctl[..., op=20, val=0, arg_len=7] Invalid argument]

that is for the exact command you sent, if i replace wlan0 with my interface (rtwn0) i get this,
successfully initialized wpa_supplicant
failed to initialize driver interface
if i replace wlan0 with my interface (rtwn0) i get this,
No, you're not supposed to use the wireless interface directly. You must clone the interface (that's what wlan0 is).

Just add the two lines I showed to /etc/rc.conf and reboot. See what that gets you.
i see, it was worth a shot since i'm trying pretty much everything atp. Once i have added the two lines you showed and called 'reboot' i still get nothing, and my ssid is still showing up blank in my ifconfig, i know there is a way to set the ssid using the rc.conf file, is there a way to set the psk using the rc.conf file too? I have also made sure i plugged the dongle into the usb2.0 and not 3.0 port since thats what the manpage says is supported
It's entirely possible that Netgear a6100 you have uses a different variant of that rtwn(4) chipset. Realtek has a tendency to push out a LOT of variants of existing chipsets. Not all of them are supported by rtwn(4) unfortunately.

What does sysctl net.wlan.devices show?