-
-
Notifications
You must be signed in to change notification settings - Fork 92
Feature: support connecting to a fixed Wi-Fi BSSID #1958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
Build ArtifactsFirmware built from this pull request's code:
Notice
|
|
@markusdd Care to test? You should be able to safely upgrade to this version, then configure the expected BSSID using the Web UI. Just now I remember that I did not test one thing: Shutting down the AP with the configured BSSID and observe what happens and also what happens once it comes back... |
|
Hi! The latter test would probably be important haha. I will test this in about 10 days when I am back at where the setup is, just in case something goes sideways. |
|
There you go: My confidence in this change is still high.
Understandable. Download the firmware just-in-time when starting to test, so updates to this PR are part of your test. @tbnobody I would appreciate your comment on this PR. If there is something that makes you hesitate to include this upstream, let me know. |
|
Hm would make sense to implement something like this. The integrated roaming seems to be a little bit unstable. I am not even sure if the sdkconfig used by the arduino framework supports 802.11k. Just a few remarks (I haven't looked at the code in very detail):
|
Will do. After looking at the commit, I don't see that there should be an issue.
Yes, thanks,
Hm, the value will not ever change, but for clarity it makes sense. I put it in |
|
c5acd14 to
d8cc99c
Compare
I ended up putting it in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for connecting to a fixed Wi‑Fi BSSID by extending the configuration interfaces and network connection logic.
- Added an input field for setting the Wi‑Fi BSSID in the NetworkAdminView.
- Updated type declarations and localization for the BSSID configuration.
- Extended network configuration serialization/deserialization and connection logic to handle the fixed BSSID.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| webapp/src/views/NetworkAdminView.vue | Adds a new input element for the Wi‑Fi BSSID configuration. |
| webapp/src/types/NetworkConfig.ts | Extends the NetworkConfig interface with a bssid field. |
| webapp/src/locales/en.json & de.json | Adds localization strings for Wi‑Fi BSSID and its tooltip. |
| src/WebApi_network.cpp | Updates GET/POST handlers to process the bssid value. |
| src/NetworkSettings.cpp | Adjusts connection logic to include BSSID comparison. |
| src/Configuration.cpp | Implements serialization/deserialization functions for BSSID. |
| include/defaults.h & include/Configuration.h | Defines constants and updates configuration structure with BSSID. |
| if (cleanBssidStr.length() != 12) { return; } | ||
|
|
Copilot
AI
May 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider logging a warning or error when the BSSID string length is invalid. This can help diagnose issues when an incorrect BSSID is provided, instead of silently failing.
| if (cleanBssidStr.length() != 12) { return; } | |
| if (cleanBssidStr.length() != 12) { | |
| MessageOutput::logWarning("Invalid BSSID string length: " + String(cleanBssidStr.length()) + ". Expected length is 12."); | |
| return; | |
| } |
| return true; | ||
| } | ||
|
|
||
| for (int i = 0; i < WIFI_BSSID_OCTETS; i++) { |
Copilot
AI
May 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider using std::memcmp to compare the BSSID arrays, which may simplify the code and improve clarity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks fine. Haven't tried it yet.
|
Will rebase after merging upstream release and will address Copilot's latest comments. |
d8cc99c to
f0ce840
Compare
This allows to configure a fixed BSSID to connect to using Wi-Fi. This can make sense if your Wi-Fi setup includes multiple Access Points broadcasting the same SSID and allows to force connecting to a specific one.
Closes #1716. This is not the "perfect" solution for that issue, but it is a working "manual" alternative.