Closed3

Raspberry Pi 3 + Ubuntu 21.10 で Wi-Fi を有効にする

Kazuki Suda (@superbrothers)Kazuki Suda (@superbrothers)

/etc/default/crda を編集して国コードを入れておく必要があるみたい。編集後にリブート。

$ cat /etc/default/crda
# 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=JP
Kazuki Suda (@superbrothers)Kazuki Suda (@superbrothers)

ほっとくと power save が働いて Wi-Fi がオフにされることがあるそうなので無効化しておく。便利 systemd service unit を発見した。べんり。

$ sudo EDITOR=vi systemctl --full --force edit wifi_powersave@.service
[Unit]
Description=Set WiFi power save %i
After=sys-subsystem-net-devices-wlan0.device

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/iw dev wlan0 set power_save %i

[Install]
WantedBy=sys-subsystem-net-devices-wlan0.device

起動時に power save を無効化するようにしておく。

$ sudo systemctl start wifi_powersave@off
$ sudo systemctl enable wifi_powersave@off

Power managementoff になっていればいい。

$ iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

wlan0     IEEE 802.11  ESSID:"<SSID>"  
          Mode:Managed  Frequency:2.467 GHz  Access Point: 3C:84:6A:5A:67:62   
          Bit Rate=72.2 Mb/s   Tx-Power=31 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=70/70  Signal level=-14 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
このスクラップは2022/03/23にクローズされました