21

I have a Raspberry Pi 3 and I need to run Ubuntu on it. I put the 16.04 server image for the Raspberry Pi 3 from https://wiki.ubuntu.com/ARM/RaspberryPi on a microSD card and it boots fine, and works fine when connected to Ethernet.

However, I cannot seem to get the onboard wifi working with Ubuntu 16.04. Wireless works fine with Raspbian so I know the hardware is OK.

Has anyone got the on board WiFi working with Ubuntu Server 16.04 on a Raspberry Pi 3? I feel like it's really close to working, but I just am missing some small detail.

After a fresh install, sudo lshw -C network does show wlan0, although I can't find that defined anywhere in /etc/network, and it's initially disabled.

I then installed wpasupplicant and added this to /etc/network/interfaces:

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

And put this in /etc/wpa_supplicant/wpa_supplicant.conf:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
        ssid="homewifi"
        psk="xxx"
        key_mgmt=WPA-PSK
}
network={
        ssid="phonewifi"
        psk="xxx"
        key_mgmt=WPA-PSK
}

To get those settings, I booted Raspbian, connected to those two different SSIDs, and just copied the settings to Ubuntu. However after a reboot, wlan0 does not connect to either network, never gets an IP, etc.

Is wpa-supplicant just not the way to configure WiFi for the Raspberry Pi 3 using Ubuntu Server 16.04? Or am I configuring something incorrectly?

5 Answers 5

8

For the image with apt installed

OS: Ubuntu 16.04.1 LTS  OS 
image: ubuntu-16.04-preinstalled-server-armhf+raspi3.img
HW: RASPBERRY PI 3 MODEL B

Step1:

sudo apt-get install wireless-tools

Step2:

sudo apt-get install wpasupplicant

Step3: add to /etc/network/interfaces:

auto wlan0 
iface wlan0 inet dhcp
wpa-ssid WIRELESSSSID 
wpa-psk WIRELESSPASSWORD

Step4: comment from /etc/network/interfaces the line:

#source /etc/network/interfaces.d/*.cfg

the commented interfaces.d/*.cfg file contains settings for the eth0.

I do not understand why but leaving this line active and adding the wlan0 config would crash the system at boot.

Step5: reboot

For the core image without apt installed:

OS: Ubuntu Core 16 
image: (GNU/Linux 4.4.0-1030-raspi2 armv7l)
HW: RASPBERRY PI 3 MODEL B

Step1:

ifconfig wlan0 down
ifconfig wlan0 up

Step2: create wireless config file:

sudo vi /etc/network/interfaces.d/wlan0

Note: I tried without sudo but it would not let me save the changes

Step3: add the following content

auto wlan0 
iface wlan0 inet dhcp
wpa-ssid WIRELESSSSID 
wpa-psk WIRELESSPASSWORD

Step4: reboot

7
  • how did you make that if apt is not present yet? thanks Jan 24, 2017 at 21:02
  • 1
    I have updated my answer to cover ubuntu core also
    – V Bota
    Jan 26, 2017 at 23:03
  • 1
    isn't that a typo. essid should just be ssid?
    – kidbrax
    Feb 15, 2019 at 19:12
  • Using blockquotes formatting indicates that the text is not yours. Is that the case? If so, citing the source would be nice.
    – brasofilo
    Aug 14, 2019 at 20:20
  • Why isn't these packages pre-installed in the image? People have to use ethernet to get WiFi working, it's really a joke.
    – Alston
    Sep 20, 2019 at 16:36
3

This is my config (slightly different to the others as I use wpa_supplicant.conf)

In /etc/network/interfaces I have:

auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

where the file /etc/wpa_supplicant/wpa_supplicant.conf contains the following:

country=GB

network={
    ssid="MyWifiNetwork"
    psk="myP4ssw0rd"
}
1
  • Thanks a bunch. This is the solution that looks most like the Raspbian docs. Clean!
    – E. Sundin
    Sep 8, 2017 at 14:16
1

I did iwconfig command and from there the messages came that dependicies needed to be updated and after that I could install the wireless-tools.

sudo apt-get -f install
sudo apt-get -f install wireless-tools

after these commands I was able to iwconfig.

Hope this helps!

0

Any success so far? Did you read this? ubuntu WPAHowTo

Accordingly, I installed this on my RPi3 running ubuntu MATE 16.04:

sudo apt-get install wpagui

Where it tells one to be run like this: You will need to run it via gksudo wpa_gui so that it can talk to the WPA daemon.

gksudo wpa_gui

Even if it may not be available on your server version, due to a missing GUI(?), it may be helpful for testing purposes on the Raspbian OS. Or even assist in deducting correct settings. Which it did in my case.

1
  • wpa-supplicant and wpa_gui were developed alongside.So yes, wpa-supplicant is the way to configure WiFi for the Raspberry Pi 3. wpa_gui just offers a GUI for it.
    – Rudi
    Aug 4, 2016 at 16:46
0

maybe my solution duplicate to someone else. Anyway try just follow these 3 steps.

Install WPA Supplicant

sudo apt-get install wpasupplicant

Edit the /etc/network/interfaces file as below. Edit Your Wifi Name(support space) and yourPassword according your preferences.

# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
# source-directory /etc/network/interfaces.d

# The loopback network interface
auto lo
iface lo inet loopback

# The wireless network interface
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid My Wifi Name
wpa-psk yourPassword

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

Reboot your system

sudo reboot

This solution work for both raspberry pi 3 and 2 & Ubuntu Server 14.04 and 16.04. (Of course you need Wi-Fi dongle for pi2)

Good Luck!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .