How to setup USB WiFi on Raspberry Pi with FreeBSD

Setting up USB WiFi under FreeBSD is not a very hard task.
We can use official handbook.
But in my opinion it’s too complex.
Here is a simple guide how to configure USB WiFi.
Our goal is to configure WiFi interface to connect and use available wireless network.

I use Miniature WiFi Module from Adafruit.
This is in reality Realtek RTL8188CUS. says this is a problem adapter.
And I had some problems with it under Raspbian.

There was no driver for this adapter in FreeBSD-10.0-RELEASE.
Driver for this adapter appears in stable images in March.
This is good for us, so we don’t need to adding it into kernel.
During boot we can see our adapter:

After boot we can see it in interfaces list:

If we try to up this interface we will see some warning and error messages:

urtwn-rtl8192cfwT: You need to read the LICENSE file in /usr/share/doc/legal/realtek/.
urtwn-rtl8192cfwT: If you agree with the license, set legal.realtek.license_ack=1 in /boot/loader.conf.
module_register_init: MOD_LOAD (urtwn-rtl8192cfwT_fw, 0xc2aa24f0, 0) error 1
urtwn-rtl8192cfwT: could not load firmware image, error 8
urtwn0: failed loadfirmware of file urtwn-rtl8192cfwT


We need to add this two strings to file /boot/loader.conf:



After reboot we can continue.

Next step is creating wlan interface:
ifconfig wlan0 create wlandev urtwn0

Then we can to up this wlan interface and scan available wireless networks:
ifconfig wlan0 up scan


For permanent use WiFi connection we need to add this two strings to file /etc/rc.conf:

ifconfig_wlan0="WPA DHCP"


And we need to configure authentication in file /etc/wpa_supplicant.conf


After reboot we can check network connection:


It works!


3 thoughts on “How to setup USB WiFi on Raspberry Pi with FreeBSD

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s