Skip to content

Conversation

@bentumbler
Copy link
Contributor

Type of change

Bug fix + enhancement

  • Bug fix (non-breaking change that fixes something)
  • Documentation update (readme, changelog, man page, etc.)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature changing existing functionality)
  • Code quality improvement (refactor, performance improvements)
  • Other (please specify):

Breaking change

  • What functionality breaks?
  • Why does it break?
  • How should it be migrated?
  • Are there any backward-compatible alternatives?

Proposed change

Namespaces was requiring the configuration of a WLAN connection to succeed in the moment for the configuration to be considered to have been correctly applied. DHCP was run early in the process too, before knowing if the interface was connected and this would hang for 15s. Upon failure it would then attempt to roll the configuration back. This was compounded by the fact that all this took longer than the nginx timeout so a 500 error was received.

This change re-orders the sequence of events and polls wpa_cli every second for 15 seconds after a wpa_supplicant config has been applied. DHCP is then only started for interfaces in the connected state.

The previous two configuration outcomes were connected or error. Now this can be connected, provisioned or error.
Provisioned states return with success and wuickly bypass any attempts at DHCP

Cleanup code has been improved to ensure hanging wpa_supplicant daemon are removed and there is a clear revert function to get back to a default state with all adapters and interfaces in root namespace.

A fix for parsing of the interface MAC has also been applied.

While adapting the code, the insertion of the early bringup on mon mode has been added to comply with updated Intel guidance for LAR.

Testing

  • Did you add new automated tests? If yes, explain which edge cases are covered.
  • Does this change affect any existing tests? If so, how did you adjust them?
  • Please provide test run results or screenshots if applicable.

Tests were performed manually using postman and the WLAN Pi App. Tests creates which previously fail using a non present SSID now pass. The device can connect to that SSID later.

image image

LLM/AI usage

  • I used an LLM or AI coding assistant for this PR
    Cursor was used to provide assistance coding the the changes needed to fix the main bug where non-present SSIDs were causing an error. Cursor created the initial changes to network_namespace_service.py and network_config.py and adapt the 2 state return (connected, error) to a 3 state return (connected, provisioned, error). The code was adapted by hand thereafter to ensure fully working state.

Checklist

  • I have read the contribution guidelines and policies
  • I have targeted this PR against the correct git branch (this can vary depending on the default branch of the repo)
  • I ran the test suite and verified it succeeded
  • I linked a GitHub issue to this PR (in the next section).
  • I have updated the changelog (if applicable)
  • I have added or updated the documentation (if applicable)

Related Issues/PRs

@joshschmelzle joshschmelzle merged commit faf61a6 into WLAN-Pi:dev Oct 9, 2025
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants