Skip to content

Commit

Permalink
Installation procedure for hotspot learned to display QR code
Browse files Browse the repository at this point in the history
  • Loading branch information
max-pfeiffer committed Jun 13, 2024
1 parent 1e6649b commit a5f9548
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions irrigation_pi/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,14 @@ def install_nginx_configuration():


@click.command(name="wifi-hotspot")
@click.option(
"--interface-name",
default="wlan0",
help="Name of the 802-11-wireless interface, i.e. wlan0.",
)
@click.option("--ssid", default="Irrigation-Pi", help="SSID of Wi-Fi Hotspot.")
@click.password_option(
@click.option(
"--password",
required=True,
help="Password for Wi-Fi Hotspot, minimum length 8 characters.",
)
@click.option(
Expand All @@ -159,7 +163,11 @@ def install_nginx_configuration():
"--autoconnect-priority", default="100", help="Wi-Fi Hotspot autoconnect-priority."
)
def install_wifi_hotspot(
ssid: str, password: str, autoconnect: str, autoconnect_priority: str
interface_name: str,
ssid: str,
password: str,
autoconnect: str,
autoconnect_priority: str,
):
"""Install Wi-Fi hotspot using NetworkManager.
Expand All @@ -180,6 +188,8 @@ def install_wifi_hotspot(
WIFI_HOTSPOT_CONNECTION_NAME,
"type",
"wifi",
"ifname",
interface_name,
"wifi.mode",
"ap",
"wifi.ssid",
Expand All @@ -196,3 +206,8 @@ def install_wifi_hotspot(
autoconnect_priority,
]
)

# Show password and QR code
run_subprocess(
["sudo", "nmcli", "device", "wifi", "show-password", "ifname", interface_name]
)

0 comments on commit a5f9548

Please sign in to comment.