1.6 KiB
1.6 KiB
network:wifi:connection
Configure a WiFi client connection using NetworkManager
Purpose
This cube allows you to connect your target host (e.g., a Raspberry Pi or a laptop) to an existing WiFi network using nmcli.
What This Cube Does
- Ensures
network-manageris installed and running - Removes any existing connection with the same name to avoid conflicts
- Connects to the specified
SSIDusing the providedPASSWORD - Configures the connection to automatically connect on boot (optional)
Configuration
| Variable | Type | Description | Required | Default |
|---|---|---|---|---|
SSID |
string |
The WiFi network name | Yes | - |
PASSWORD |
string |
The WiFi password | Yes | - |
AUTOCONNECT |
boolean |
Automatically connect to this network | No | true |
CONNECTION_NAME |
string |
Name for the connection in NetworkManager | No | SSID |
Dependencies
apt/essentials: Basic system utilities.
Usage
Simple Connection
nopy install network:wifi:connection --env SSID="MyHomeWiFi" --env PASSWORD="mysecurepassword"
Connection with Custom Name and No Autoconnect
nopy install network:wifi:connection --env SSID="OfficeWiFi" --env PASSWORD="password123" --env CONNECTION_NAME="Work" --env AUTOCONNECT=false
Security Notes
- WiFi passwords will be stored in
/etc/NetworkManager/system-connections/on the target host. - Passing passwords via
--envmay leave them in your local shell history.
Troubleshooting
You can check the status of your WiFi connections on the target host with:
nmcli connection show
nmcli device status