I use Ubuntu 20.04 desktop on a Raspberry Pi 4 and I am trying to configure netplan
. I have seen How to configure wpa_supplicant in Ubuntu server 20.04. I configured netplan
to connect to wlan0
and it worked. I also configured /etc/default/crda
by putting REGDOMAIN=IT
,
but on the wpa_supplicant
log I see:
wpa_supplicant[910]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=COUNTRY_IE type=COUNTRY alpha2=DE
So the Wi-Fi connection is not stable.
I use NetworkManager
and if I restart it after setting the correct value with:
sudo iw reg set IT
wpa_supplicant
sets it back to the wrong DE
value.
How can I avoid netplan
setting the wrong country?
Update
I have write a service:
sudo apt install iw
I choose a folder under root user /etc/init.d/ and write a file named wireless:
/etc/init.d/wireless
#!/bin/sh
# by Leonardo: workaround
iw wlan0 set power_save off
iw reg set IT
exit 0
then:
sudo chmod ugo+x /etc/init.d/wireless
write another file
/etc/systemd/system/wireless-on.service
[Unit]
Description=workaround for set wireless country and to no power management
After=network-online.target
[Service]
Type=oneshot
ExecStart=/etc/init.d/wireless
[Install]
WantedBy=multi-user.target
then:
sudo systemctl enable wireless-on.service
restart
this made connection stable to me.
sorry for my bad english