Skip to content

Essid support#22

Open
deadlywang wants to merge 4 commits into
devfrom
essid_support
Open

Essid support#22
deadlywang wants to merge 4 commits into
devfrom
essid_support

Conversation

@deadlywang

@deadlywang deadlywang commented Jun 23, 2026

Copy link
Copy Markdown

Targeted support for ESSID generated by iwlist.

Specifically the case for wifi hotspots showing as "Erick\xE2\x80\x99s iPhone" in piaware-config.txt

@eric1tran eric1tran requested a review from nikeflight June 24, 2026 10:46

@nikeflight nikeflight left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Needs unit tests as well.

Comment thread networking/generate_network_config.py Outdated
unescaped_chars = HEX_ESCAPE_RE.sub(lambda m: chr(int(m.group(1), 16)), essid)
return unescaped_chars.encode("latin-1")

def build_ssid_value(raw_essid_from_iwlist: str) -> str:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This variable name implies we should be getting the essid from iwlist.
But you're passing the ssid from the piaware-config.txt, does that make sense?

Are people going to be entering their essid as hex-escaped bytes?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you change this method name to something more descriptive like hex_to_string or something similar.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This variable name implies we should be getting the essid from iwlist. But you're passing the ssid from the piaware-config.txt, does that make sense?

Are people going to be entering their essid as hex-escaped bytes?

Similar to the comment below. Please check how piaware-configurator works with piaware-support in the WIFI BLE setup.
This PR will not affect how SSID was processed when people enter their SSID in piaware-config.txt the old way.

Comment thread networking/generate_network_config.py Outdated
psk = config.get("wireless-password")
connect = "true" if config.get("wireless-network") else "false"

ssid = build_ssid_value(ssid)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we're reading directly from piaware-config.txt, I think we should have some output to stderr for invalid hex-escaped bytes.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is to take care the BLE wifi setup process. The ESSID source is from iwlist. Please go check the JIRA ticket for context.

@deadlywang

Copy link
Copy Markdown
Author

Needs unit tests as well.

I plan to create another branch for unit tests.

@nikeflight

nikeflight commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Needs unit tests as well.

I plan to create another branch for unit tests.

Why? Unless there's a good reason, you generally want to keep unit tests in the same PR they're testing.

It also makes code review easier. This PR is still small so adding in unit tests isn't really an issue.

@deadlywang

Copy link
Copy Markdown
Author

Needs unit tests as well.

I plan to create another branch for unit tests.

Why? Unless there's a good reason, you generally want to keep unit tests in the same PR they're testing.

It also makes code review easier. This PR is still small so adding in unit tests isn't really an issue.

Because I want to get it fixed first for the release. It will take me some time to understand the unit test script and write the test cases.

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