🛠 Se connecter au Wi-Fi en ligne de commande (nmcli)

Raspberry Pi Zero W (2017) — Board Sheet · debutant · Schéma : IMG-zero-w-debutant-3-connexion-wifi-ligne-de-commande.svg — Zero W et son antenne trace PCB repérée sur la carte, ondes 2,4 GHz vers la box, terminal affichant nmcli dev wifi list.

Objectives

Diagnose and configure the Wi-Fi on the Zero W from a terminal: the board features the Cypress CYW43438 chip (802.11n 2.4 GHz only, ~35 Mb/s, + Bluetooth 4.0/BLE), interface wlan0.

Hardware

Steps

  1. Set the radio country: sudo raspi-config → 5 Localisation → L4 WLAN Country. Incorrect country = incorrect channels/power, legality issues, and degraded performance.
  2. Check the radio: nmcli radio wifi must display enabled.
  3. Scan: nmcli dev wifi list (SSID, SIGNAL, SECURITY).
  4. Connect: sudo nmcli --ask dev wifi connect <ssid_of_the_spot> then enter the passphrase.
  5. Check the link and signal level: iw dev wlan0 link (signal: line in dBm).
nmcli -t -f IP4.ADDRESS dev show wlan0   # bail DHCP
ping -c 3 1.1.1.1                        # sortie Internet

Verification

iw dev wlan0 link displays SSID, channel, and signal; ping goes out to the Internet.

Common Errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials