Raspberry Pi 3 Wireless Networking

I had a few minor issues getting the wireless networking to work on my Raspberry Pi 3 Model B after I sorted out the minimal install using a Raspberry Pi 2. Basically as well as installing the appropriate firmware and wireless networking you also need to install a couple of additional packages as the ‘udev’ now uses the Linux Central Regulatory Domain Agent (CRDA) to configure any wireless network devices.

As usual to do this you need to be running as a super user.

$ su
Password:
#

OR

$ sudo -i
Password:
#

First install the additional packages needed to provide CRDA, this ensures that ‘udev’ can correctly identify the device.

# apt-get install wireless-regdb crda –no-install-recommends
Reading package lists... Done
Building dependency tree 
Reading state information... Done
The following extra packages will be installed:
  iw libnl-3-200 libnl-genl-3-200
The following NEW packages will be installed:
  crda iw libnl-3-200 libnl-genl-3-200 wireless-regdb
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 190 kB of archives.
After this operation, 567 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
  :
  :
  :
Setting up libnl-3-200:armhf (3.2.24-2) ...
Setting up libnl-genl-3-200:armhf (3.2.24-2) ...
Setting up wireless-regdb (2014.11.18-1) ...
Setting up iw (3.17-1) ...
Setting up crda (3.13-1) ...
Processing triggers for libc-bin (2.19-18+deb8u3) ...
#

Having installed the additional packages needed for CRDA the rest of the process is the same as I’ve used before though I had to refer to the datasheet to figure out what sort of wireless interface the Raspberry Pi 3 has. Searching the package database for Broadcom firmware packages turned up three possibilities which narrowed things down a bit.

# apt-cache search firmware |grep Broadcom
firmware-bnx2 – Binary firmware for Broadcom NetXtremeII
firmware-bnx2x – Binary firmware for Broadcom NetXtreme II 10Gb
firmware-brcm80211 – Binary firmware for Broadcom 802.11 wireless cards
#

A quick check on the details of each package confirmed that firmware-brcm80211 package was the correct firmware package for the on board BCM43143
WiFi interface.

# apt-get install firmware-brcm80211
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following NEW packages will be installed:
  firmware-brcm80211
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1678 kB of archives.
After this operation, 4398 kB of additional disk space will be used.
  :
  :
  :
Setting up firmware-brcm80211 (0.43+rpi4) ...
#

As before having installed the correct firmware we also need to install the ‘wireless-tools’ and ‘wpasupplicant’ packages.

# apt-get install wireless-tools wpasupplicant
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following extra packages will be installed:
  libiw30 libpcsclite1
Suggested packages:
  pcscd wpagui libengine-pkcs11-openssl
The following NEW packages will be installed:
  libiw30 libpcsclite1 wireless-tools wpasupplicant
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 998 kB of archives.
After this operation, 2485 kB of additional disk space will be used.
Do you want to continue? [Y/n]
  :
  :
  :
Processing triggers for dbus (1.8.20-0+deb8u1) ...
#

At this point a reboot seems to be required for the device to be detected.

# reboot

When the system comes back up you need to login as root again before using the ‘iwconfig’ command to check to see if the wireless interface is working.

# iwconfig
wlan0     IEEE 802.11bgn  ESSID:off/any  
          Mode:Managed  Access Point: Not-Associated  
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:on
 
lo        no wireless extensions.
 
eth0      no wireless extensions.
#

If you can see the ‘wlan0’ device in the list of devices then the device has been correctly detected and the firmware loaded. The next step is to configure the wireless interface, there are several different ways to do this but the simplest is to simply edit ‘/etc/network/interfaces’ and specify the details of your wireless access point.

# vi /etc/network/interfaces

Remember to substitute you own wireless SSID and wireless access password for ‘Your-SSID’ and ‘Your-PSK’ – the quotes are NOT required.

/etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp

auto wlan0
iface wlan0 inet dhcp

    wpa-ssid ‘Your-SSID’
    wpa-psk ‘Your-PSK’

Now that the wireless interface is configured to request a DHCP address from your wireless access point you can bring the wireless network up.

# ifup wlan0
  :
  :
  :
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.254
Restarting ntp (via systemctl): ntp.service.
bound to 192.168.0.184 — renewal in 1674 seconds.
#

Use ‘iwconfig’ and ‘ifconfig’ to check tha the interface has been configured correctly.

# iwconfig
wlan0     IEEE 802.11bgn  ESSID:"BT343-VW"  
          Mode:Managed Frequency:2.462 GHz Access Point: 00:0E:6A:D3:C1:FA  
          Bit Rate=48 Mb/s  Tx-Power=1496 dBm  
          Retry short limit:7  RTS thr:off  Fragment thr:off
          Encryption key:off
          Power Management:on
          Link Quality=54/70  Signal level=-56 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
 
lo        no wireless extensions.
 
eth0      no wireless extensions.
# ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:eb:bd:88:16  
          inet addr:192.168.00.149  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::ba27:ebff:febd:8816/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:94 errors:0 dropped:0 overruns:0 frame:0
          TX packets:80 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:9574 (9.3 KiB)  TX bytes:10506 (10.2 KiB)
 
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
 
wlan0     Link encap:Ethernet  HWaddr b8:27:eb:e8:dd:43  
          inet addr:192.168.0.136  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::ba27:ebff:fee8:dd43/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:33 errors:0 dropped:13 overruns:0 frame:0
          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7867 (7.6 KiB)  TX bytes:2439 (2.3 KiB)
#

Note – Do NOT configure the eth0 if the lan cable isn’t going to be connected – otherwise the Raspberry Pi will hang waiting for a DHCP address at boot.


Raspberry Pi is a trademark of the Raspberry Pi Foundation

Advertisements
This entry was posted in Networking, Raspbian and tagged , , . Bookmark the permalink.

4 Responses to Raspberry Pi 3 Wireless Networking

  1. Tim Gormley says:

    Thanks1 This got my RPi3 successfully connected headless to wifi. Now I want to work on making it an AP (for extending my wifi reach) and using the ethernet connection to the network.

  2. Hi,
    Thanks for the detailed steps, I have tried all the steps you mentioned on my Raspberry PI 3 model (The device is having custom Linux build based on Jessie build) for bringing up wlan0 UP. But unfortunately, all the package and firmware installation leads to – “NO wlan0 in iwconfig result”

    Can you please tell me what exactly becoming wrong from my end and I am unable to get wlan0 interface up?

    Your help will be most appreciated. Thanks in advance :)

  3. Christine says:

    Hi Mike . Thank you for that. It’s solved a problem that has been bugging me for months. A project was on hold due to not being able to associate with my wireless router. Now it can go forward.

Leave a Reply

Please log in using one of these methods to post your comment:

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