Skip to content
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

Improve WiFi logging #358

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

ButterscotchV
Copy link
Member

@ButterscotchV ButterscotchV commented Nov 3, 2024

Currently our WiFi stuff is logged in different ways each time we log it, this makes it all surround the SSID in singlequotes and the "OPEN" vs "PASSWD" printout now just says the encryption type (plus it never worked on ESP8266 since "OPEN" is actually 7, not 0).

I'm absolutely certain this isn't the best way of doing this so please complain about it in the reviews/comments or whatever and I can fix it.

ESP8266 WiFi encryption type is according to 802.11, while ESP32 seems to report based on whatever... It would also be oh so convenient if we just report the name, so here it is
@ButterscotchV ButterscotchV added Type: Bug Something isn't working Type: Enhancement Adds or improves a feature Priority: Normal The default priority labels Nov 3, 2024
@ButterscotchV ButterscotchV self-assigned this Nov 3, 2024
Copy link
Member

@TheDevMinerTV TheDevMinerTV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -248,9 +290,9 @@ namespace SerialCommands {
if (scanRes >= 0) {
logger.info("[WSCAN] Found %d networks:", scanRes);
for (int i = 0; i < scanRes; i++) {
logger.info("[WSCAN] %d:\t%02d\t%s\t(%d)\t%s",
logger.info("[WSCAN] %d: %02d '%s' (%d dBm) %s",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the original reason for the usages of \t and no ' or is because it simplified parsing as the only people that would be able to input tab in their SSID would be people that know what the hell they are doing, a ' or a could easily be put on the SSID and break parsing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched to tabs now, the ' can be considered to always surround the SSID and be trimmed (and/or use the length printed before)

It was mentioned this would be easier for parsing, so I'll just leave it the same but with quotes, as it's still just as readable now
@ButterscotchV
Copy link
Member Author

ButterscotchV commented Nov 5, 2024

Tested on official trackers and it works :3
Correctly differentiates between WPA2_PSK and OPEN, before this PR it always says PASSWD
I don't have the hardware to test further

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Normal The default priority Type: Bug Something isn't working Type: Enhancement Adds or improves a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants