2

I recently installed Ubuntu Server 20.10 on my RPI 4B and cannot get wifi to work. I followed the instructions here, here, and here.

When I attempt to setup wifi via wpa_supplicant (the last link) with the command:

sudo wpa_supplicant -c /etc/wpa_supplicant.conf -i wlan0

I get the following:

Successfully initialized wpa_supplicant
wlan0: Failed to initiate sched scan
wlan0: Failed to initiate sched scan
wlan0: Failed to initiate sched scan
wlan0: Failed to initiate sched scan
wlan0: Failed to initiate sched scan
wlan0: Failed to initiate sched scan
wlan0: Failed to initiate sched scan
wlan0: Failed to initiate sched scan
wlan0: Failed to initiate sched scan
wlan0: Failed to initiate sched scan
wlan0: Failed to initiate sched scan

Upon checking the /etc/wpa_supplicant file I found that there is no wpa_supplicant.conf file and I cannot find instructions for creating one from scratch, or an example file. I think this is why I can't connect via wifi with my pi.

For setting up via netplan:

50-cloud-init.yaml file:

# This file is generated from information provided by the datasource.  Changes
# to it will not persist across an instance reboot.  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:
    ethernets:
        eth0:
            dhcp4: true
            optional: true
    version: 2
    wifis:
        wlan0:
            access-points:
                "XXXXXXXXX":
                    password: "XXXXXXXX"
            dhcp4: true
            optional: true

If it isn't the wpa_supplicant.conf file, I am out of ideas. It may be worth noting that I am trying to set this up with the ethernet cord attached because I am doing all this over ssh.

I tried the method shared by @tttapa in the comments I get the following output when I run sudo netplan --debug generate:

`DEBUG:command generate: running ['/lib/netplan/generate'] ** (generate:5090): DEBUG: 15:18:36.438: Processing input file /etc/netplan/10-my-config.yaml..

** (generate:5090): DEBUG: 15:18:36.439: starting new processing pass

** (generate:5090): DEBUG: 15:18:36.439: wlan0: adding wifi AP 'XXXXX'

** (generate:5090): DEBUG: 15:18:36.439: Processing input file /etc/netplan/50-cloud-init.yaml..

** (generate:5090): DEBUG: 15:18:36.439: starting new processing pass

** (generate:5090): DEBUG: 15:18:36.439: wlan0: adding wifi AP ''

** (generate:5090): DEBUG: 15:18:36.439: We have some netdefs, pass them through a final round of validation

** (generate:5090): DEBUG: 15:18:36.439: wlan0: setting default backend to 1

** (generate:5090): DEBUG: 15:18:36.439: Configuration is valid

** (generate:5090): DEBUG: 15:18:36.439: eth0: setting default backend to 1

** (generate:5090): DEBUG: 15:18:36.439: Configuration is valid

** (generate:5090): DEBUG: 15:18:36.440: Generating output files..

** (generate:5090): DEBUG: 15:18:36.440: openvswitch: definition eth0 is not for us (backend 1)

** (generate:5090): DEBUG: 15:18:36.440: NetworkManager: definition eth0 is not for us (backend 1)

** (generate:5090): DEBUG: 15:18:36.440: Creating wpa_supplicant config

** (generate:5090): DEBUG: 15:18:36.440: wlan0: Creating wpa_supplicant configuration file run/netplan/wpa-wlan0.conf

ERROR: : ASCII passphrase must be between 8 and 63 characters (inclusive)`

It seems netplan is checking the 50-cloud-init.yaml, despite running the command sudo bash -c "echo 'network: {config: disabled}' > /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg" before executing the generate command and rebooting.

9
  • What happened when you tried the netplan generate / apply commands?
    – user115418
    Dec 25 '20 at 20:06
  • Ubuntu server uses systemd-networkd and AFAIK does not use wpa-supplicant. Just use Raspberry Pi OS (which is well documented and works).
    – Milliways
    Dec 25 '20 at 21:55
  • Note wlp4s0 is a meaningless device on the Pi. You presumably copied without understanding Predictable Network Interface Names
    – Milliways
    Dec 25 '20 at 23:41
  • 1
    See my latest answer, I think it's the key
    – Hiya
    Mar 4 at 16:53
1

I was able to resolve this issue by adding my region to the /etc/default/crda file.

# Set REGDOMAIN to a ISO/IEC 3166-1 alpha2 country code so that iw(8) may set
# the initial regulatory domain setting for IEEE 802.11 devices which operate
# on this system.
#
# Governments assert the right to regulate usage of radio spectrum within
# their respective territories so make sure you select a ISO/IEC 3166-1 alpha2
# country code suitable for your location or you may infringe on local
# legislature. See `/usr/share/zoneinfo/zone.tab' for a table of timezone
# descriptions containing ISO/IEC 3166-1 alpha2 country codes.

REGDOMAIN=

After adding your region to the REGDOMAIN and rebooting, if you are using the latest binary blobs for the wifi you should be good to go.

2
  • I've followed same steps as OP (even documented steps in official page), but this was the solution. Just a guess: maybe wpa_supplicant fail in the scan because country isn't defined, so, it do not know what country rules to apply. Aug 18 at 19:21
  • Glad to hear it worked, posted it here just in case someone struggled as much as myself
    – Hiya
    Aug 19 at 20:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.