WiFi Configuration - caternuson/rpi-camera-zero GitHub Wiki

nmcli

Usage: nmcli [OPTIONS] OBJECT { COMMAND | help }
OBJECT
  g[eneral]       NetworkManager's general status and operations
  n[etworking]    overall networking control
  r[adio]         NetworkManager radio switches
  c[onnection]    NetworkManager's connections
  d[evice]        devices managed by NetworkManager
  a[gent]         NetworkManager secret agent or polkit agent
  m[onitor]       monitor NetworkManager changes

get sub-help:

nmcli g help

NOTE: can abbreviate each to a single letter

Manually

Can switch via command line:

Via connection name

use nmcli con show to get a list of connection names, then:

sudo nmcli c up/down <name>

to bring connection up or down.

Wifi

sudo nmcli --ask dev wifi connect <ssid> hidden yes

or

sudo nmcli dev wifi connect <ssid> password <password> hidden yes

Access Point (hotspot)

sudo nmcli dev wifi hotspot ssid <name> password <password>

GUI

There's also a text based user interface:

sudo nmtui

Setting Autoconnect

Do this by setting the autoconnect property to yes/no as desired for the given connection name. (con is short for connection)

List connection names

sudo nmcli con show

Show everything for a given connection:

sudo nmcli con show <name>

Modify

sudo nmcli con modify <name> connection.autoconnect yes 

Precedence for multiple autos

https://networkmanager.pages.freedesktop.org/NetworkManager/NetworkManager/nm-settings-nmcli.html

connection.autoconnect-priority

The autoconnect priority in range -999 to 999. If the connection is set to autoconnect, connections with higher priority will be preferred. The higher number means higher priority. Defaults to 0. Note that this property only matters if there are more than one candidate profile to select for autoconnect. In case of equal priority, the profile used most recently is chosen.

Format: integer

Valid values: -999 - 999

⚠️ **GitHub.com Fallback** ⚠️