Skip to content

Commit 775d6af

Browse files
author
Alex J Lennon
committed
networkmanager: Add psk-flags=0 requirement for NetworkManager patch
Add wifi-sec.psk-flags:'0' to onboarding-server-eink.py and nmcli.connection.save(). This is REQUIRED for the NetworkManager patch to work correctly on eink boards.
1 parent 61d3adc commit 775d6af

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,24 @@ def wifi_connect(ssid: str, passwd: str) -> Optional[list[str]]:
139139
# Higher than GrosnyIoT (10) so Improv-configured networks are preferred
140140
# - auth-retries 3 (retry authentication 3 times)
141141
# - dhcp-timeout 60 (60 seconds for DHCP, longer than default 45)
142+
# ⚠️ CRITICAL: wifi-sec.psk-flags:'0' is REQUIRED for the NetworkManager patch
143+
# (0001-wifi-dont-clear-secrets-if-stored-in-keyfile.patch) to work correctly.
144+
# Without this, the patch will not activate and connections may fail permanently
145+
# after 4-way handshake failures.
146+
# See: meta-dynamicdevices-distro/recipes-connectivity/networkmanager/networkmanager/README_PATCH_REQUIREMENTS.md
142147
nmcli.connection.add('wifi', {
143148
'ssid': ssid.decode('utf-8'),
144149
'wifi-sec.key-mgmt': 'wpa-psk',
145150
'wifi-sec.psk': passwd.decode('utf-8'),
151+
'wifi-sec.psk-flags': '0', # REQUIRED: Store PSK in file, not agent-only (patch requirement)
146152
'connection.autoconnect': 'yes',
147153
'connection.autoconnect-priority': '20',
148154
'connection.auth-retries': '3',
149155
'ipv4.dhcp-timeout': '60'
150156
}, f"{INTERFACE}", f"{CON_NAME}", True)
157+
158+
# Save connection to keyfile to ensure secrets are persisted (REQUIRED)
159+
nmcli.connection.save(f"{CON_NAME}")
151160
except:
152161
print(f'Could not add new connection {CON_NAME}')
153162
return None

0 commit comments

Comments
 (0)