4

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.

user138669
  • 67
  • 1
  • 4

2 Answers2

3

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.

Hiya
  • 131
  • 2
1

I had the same issue on a Raspberry Pi 4 with Ubuntu Server 22.04, but modifying /etc/default/crda had no effect.

The solution was to create a file /etc/modprobe.d/cfg80211.conf with the following content (modify the US value with your country code) :

options cfg80211 ieee80211_regdom=US

Then reboot the system.

Solution originally found here.

Ugo Méda
  • 111
  • 3