Skip to content

Commit 92ecea8

Browse files
author
Alex J Lennon
committed
improv: Add missing NetworkManager connection settings for headless systems
Add required connection settings to all improv onboarding scripts to ensure WiFi connections work reliably on headless embedded systems: - connection.autoconnect-retries: '-1' (unlimited retries) - connection.auth-retries: '-1' (unlimited authentication retries) - connection.permissions: '' (system-wide use) These settings work together with psk-flags=0 to prevent 'no secrets' errors when 4-way handshake fails. Without unlimited retries, connections may fail permanently after transient network issues. Also updated imx93-jaguar-eink script to use auth-retries=-1 instead of 3 for consistency and maximum reliability. See: meta-dynamicdevices-distro/recipes-connectivity/networkmanager/networkmanager/README_PATCH_REQUIREMENTS.md
1 parent 158ec86 commit 92ecea8

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

recipes-devtools/python/python3-improv/imx93-jaguar-eink/onboarding-server-eink.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ def wifi_connect(ssid: str, passwd: str) -> Optional[list[str]]:
137137
# Create WiFi connection with improved settings for boot-time reliability:
138138
# - autoconnect-priority 20 (highest priority - ensures wifi-connect.service selects this connection)
139139
# Higher than GrosnyIoT (10) so Improv-configured networks are preferred
140-
# - auth-retries 3 (retry authentication 3 times)
141140
# - dhcp-timeout 60 (60 seconds for DHCP, longer than default 45)
141+
# - autoconnect-retries -1 (retry connection indefinitely - never give up)
142+
# - auth-retries -1 (retry authentication indefinitely - never give up)
142143
# ⚠️ CRITICAL: wifi-sec.psk-flags:'0' is REQUIRED for the NetworkManager patch
143144
# (0001-wifi-dont-clear-secrets-if-stored-in-keyfile.patch) to work correctly.
144145
# Without this, the patch will not activate and connections may fail permanently
@@ -151,7 +152,9 @@ def wifi_connect(ssid: str, passwd: str) -> Optional[list[str]]:
151152
'wifi-sec.psk-flags': '0', # REQUIRED: Store PSK in file, not agent-only (patch requirement)
152153
'connection.autoconnect': 'yes',
153154
'connection.autoconnect-priority': '20',
154-
'connection.auth-retries': '3',
155+
'connection.autoconnect-retries': '-1', # Retry connection indefinitely (-1 = unlimited)
156+
'connection.auth-retries': '-1', # Retry authentication indefinitely (-1 = unlimited)
157+
'connection.permissions': '', # Allow system-wide use
155158
'ipv4.dhcp-timeout': '60'
156159
}, f"{INTERFACE}", f"{CON_NAME}", True)
157160

recipes-devtools/python/python3-improv/onboarding-server.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ def wifi_connect(ssid: str, passwd: str) -> Optional[list[str]]:
9494
print(f'No connection {CON_NAME} to remove')
9595

9696
try:
97+
# Create connection with secrets stored in file (not agent-only)
98+
# This prevents "no secrets" errors on headless systems when 4-way handshake fails
99+
#
97100
# ⚠️ CRITICAL: wifi-sec.psk-flags:'0' is REQUIRED for the NetworkManager patch
98101
# (0001-wifi-dont-clear-secrets-if-stored-in-keyfile.patch) to work correctly.
99102
# Without this, the patch will not activate and connections may fail permanently
@@ -103,7 +106,11 @@ def wifi_connect(ssid: str, passwd: str) -> Optional[list[str]]:
103106
'ssid':ssid.decode('utf-8'),
104107
'wifi-sec.key-mgmt':'wpa-psk',
105108
'wifi-sec.psk':passwd.decode('utf-8'),
106-
'wifi-sec.psk-flags':'0' # REQUIRED: Store PSK in file, not agent-only (patch requirement)
109+
'wifi-sec.psk-flags':'0', # REQUIRED: Store PSK in file, not agent-only (patch requirement)
110+
'connection.autoconnect':'yes',
111+
'connection.autoconnect-retries':'-1', # Retry connection indefinitely (-1 = unlimited)
112+
'connection.auth-retries':'-1', # Retry authentication indefinitely (-1 = unlimited)
113+
'connection.permissions':'' # Allow system-wide use
107114
}, f"{INTERFACE}", f"{CON_NAME}", True)
108115

109116
# Save connection to keyfile to ensure secrets are persisted (REQUIRED)

0 commit comments

Comments
 (0)