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.
elinux.org 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:
14

After boot we can see it in interfaces list:
15

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

18

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

legal.realtek.license_ack=1
if_urtwn_load="YES"

19

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

21

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

wlans_urtwn0="wlan0"
ifconfig_wlan0="WPA DHCP"

22

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

23

After reboot we can check network connection:

25

It works!

Advertisements

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:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s