🛠 Connexion Wi-Fi 5 GHz et pilotage en SSH
Objectives
Configure the board as a Wi-Fi station (dual-band 2.4/5 GHz chip), understand the regulatory lock that hides 5 GHz channels until the country is set, start headless (without a screen), and control the board via SSH from another computer. Expected throughput in 5 GHz: approximately 100 Mb/s versus 47 Mb/s in 2.4 GHz.
Hardware
- Raspberry Pi 3 Model B+ type board (integrated dual-band 802.11ac Wi-Fi)
- Box/router with a 5 GHz network
- Another computer for SSH; or a screen + keyboard for the initial configuration
- 5.1 V 2.5 A power supply
Complete code
# 1. Définir le domaine réglementaire AVANT de chercher les réseaux 5 GHz
sudo raspi-config nonint do_wifi_country FR
# 2. Activer le client Wi-Fi (wpa_supplicant) et le SSH
sudo raspi-config nonint do_ssh 0
# 3. Se connecter au point d'accès (remplacer SSID et cle)
sudo tee /etc/wpa_supplicant/conf.d/01-wlan.conf >/dev/null <<'EOF'
network={
ssid="MON_SSID_5GHZ"
ps1="MA_CLE_WIFI"
}
EOF
sudo wpa_cli -i wlan0 reconfigure
# 4. Obtenir une adresse IP et vérifier
sudo dhclient wlan0
ip -4 addr show wlan0
iwgetid -r # affiche le SSID associé
# 5. Depuis un autre poste : ssh pi@<adresse-ip>
Expected verification
iwgetid -r displays the SSID, ping -c3 1.1.1.1 reaches the Internet, and from the other computer ssh pi@board-ip opens a shell. iw dev wlan0 info shows a 5 GHz channel (number ≥ 36) once the country FR is set. Without country=FR, 5 GHz networks appear "not found".
Common errors
- Country not set: regulations (cfg80211) hide 5 GHz channels — this is the #1 pitfall on the 3B+.
- Wi-Fi key with spaces or unescaped special characters in the config file.
- Metal case: the printed antenna needs clearance; shielding kills both bands.
- Weak power supply: Wi-Fi transmission slots trigger voltage drops below 4.63 V and disconnections.
- Two network managers conflicting (dhcpcd + NetworkManager): keep only one.
- DHCP expired after router sleep:
sudo dhclient -r wlan0 && sudo dhclient wlan0.
Other tutorials for this board
Code examples for this board
led_blink.pyPythonbutton_led.pyPythonservo_sweep.pyPythondht_temp.pyPythonoled_i2c.pyPythonmcp3008_read.pyPython