How to setup of Raspberry Pi 3 B+ onboard WiFi for Ubuntu Server 18.04? In particular, with netplan
?
Existing answers, such as "How to use onboard wifi on Raspberry Pi 3 with Ubuntu Server 16.04?", no longer seem to apply since /etc/network/interfaces
states that netplan
has replaced ifupdown
.
# ifupdown has been replaced by netplan(5) on this system. See
# /etc/netplan for current configuration.
This is a clean install of the Ubuntu Server image for Raspberry Pi 3.
##### release ###########################
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
##### kernel ############################
Linux 4.15.0-1034-raspi2 #36-Ubuntu SMP PREEMPT Fri Apr 5 06:21:41 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux
According to Ubuntu Wiki RaspberryPI the needed packages should already be in place.
Since 18.04.2 the linux-firmware and linux-firmware-raspi2 packages now contain the necessary files for the built-in WiFi on the Pi 3B and 3B+.
sudo lshw -C network
*-network:0 DISABLED
description: Wireless interface
physical id: 2
logical name: wlan0
serial: b8:27:eb:69:f2:3b
capabilities: ethernet physical wireless
configuration: broadcast=yes driver=brcmfmac driverversion=7.45.18 firmware=01-6a2c8ad4 multicast=yes wireless=IEEE 802.11
*-network:1
description: Ethernet interface
physical id: 3
logical name: eth0
serial: b8:27:eb:3c:a7:6e
size: 1Gbit/s
capacity: 1Gbit/s
capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=lan78xx driverversion=1.0.6 duplex=full ip=172.16.76.7 link=yes multicast=yes port=MII speed=1Gbit/s
Netplan.io provides some general Netplan configuration examples.
To configure netplan, save configuration files under
/etc/netplan/
with a.yaml
extension (e.g./etc/netplan/config.yaml
), then runsudo netplan apply
.
... yet, no guideance specific to a RaspberryPi. ...in particular, with respect to the existing /etc/netplan/50-cloud-init.yaml file on the RaspberryPi Ubuntu Server install.
##### Netplan config ####################
[/etc/netplan/50-cloud-init.yaml]
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
version: 2
ethernets:
eth0:
dhcp4: true
match:
macaddress: <MAC 'eth0' [IF1]>
set-name: eth0
So, given the use of netplan
and default generated .yaml
file. How should one add a WiFi network SSID and password? And leave the existing wired ethernet in place?
The steps below were found to provide a persistent WiFi setup using
netplan
with Ubuntu Server 18.04ubuntu-18.04.2-preinstalled-server-arm64+raspi3.img.xz
image on a Raspberry Pi 3 B+.Update system:
Determine interface names:
Determine your-cloud-init.yaml and open for editing.
Add WiFi access information to your-cloud-init.yaml file.
Test, generate and apply the changed your-cloud-init.yaml config:
sudo netplan --debug try
(continue even if successful)sudo netplan --debug generate
(provides more details in case of issues with the previous command)sudo netplan --debug apply
(if no issues during the previous commands)Confirmation Test:
The above sequence was distilled from the "Raspberry Pi 3B/B+ Wireless Bridge using Ubuntu Server 18.04 ARM Image and Netplan" gist link mentioned by Larnu. The gist goes well beyond just enabling WiFi since its turns the Pi into a Bridge.
Some additional useful WiFi setup steps.
Set hostname.
sudo nano /etc/hosts
sudo nano /etc/cloud/cloud.cfg
Verify from local Raspberry Pi commandline.
Enable mDNS.
If desired, enable Multicast DNS by installing Avahi. Avahi supports the mDNS/DNS-SD/RFC 3927/Zeroconf/Bonjour specification.
Remotely check mDNS resolution from another computer.
Issue is because of this bug https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/1874377
Currently Ubuntu 20.04.1 needs reboot even though the issue is supposed to be fixed. Cable internet connects immediately. Ubuntu 20.10 connects to wifi even without reboot for now.
The drivers in the current Ubuntu 20.04 LTS lack the clm_blob if you have a Broadcom 43430 Wifi chipset. I lost the WiFi in an update. The only way to solve this problem was to switch to Alpine and install the firmware-cypress APK. I hope Ubuntu fixes this soon!