Skip to content

Add ESP32 Wifi Station Mode#107

Merged
brainstorm merged 13 commits into
brainstorm:mainfrom
Autofix:main
Jun 11, 2026
Merged

Add ESP32 Wifi Station Mode#107
brainstorm merged 13 commits into
brainstorm:mainfrom
Autofix:main

Conversation

@Autofix

@Autofix Autofix commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

This PR configures the ESP32 in Station mode if the Station SSID is set. Otherwise it will default to configuring Access Point mode.

I've added sta_ssid and sta_pw in all locations where wifi_ssid and wifi_pw were used. These have also been renamed to ap_ssid and ap_ssid to make the different mode usage clear.

I've had to duplicate checks against the Station SSID in ssh-stamp-esp32/src/network/wifi.rs as we no longer pass the ap_config directly to fn wifi_up

@Autofix Autofix changed the title Add ESP32 Wifi Station Mode. Add ESP32 Wifi Station Mode Jun 1, 2026
Autofix added 3 commits June 1, 2026 11:09
…start in AP mode if it doesn't connect.

Clearing station mode SSID will restart in AP mode.
Station mode will now start with empty config.
Update to esp-radio 1.x
@Autofix

Autofix commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

User flow is now:

  1. Default to Access Point Mode.
  2. The user can change to Station mode by setting SSH_STAMP_WIFI_STA_SSID. The access point must have DHCP for SSH Stamp to acquire a correct IP address.
  3. When starting Station Mode it will attempt to connect for 10 seconds. If it doesn't connect it will clear the Station Mode SSID and restart back into Access Point Mode.
  4. The user can return from Station Mode to Access Point Mode by clearing the Station Mode SSID. SSH_STAMP_WIFI_STA_SSID = ""

Both modes will report which Access Point and IP address the user needs to connect to.
If in Station Mode and it loses connection to the Access Point it will continually attempt to reconnect.

@brainstorm brainstorm left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

LGTM! Minor stuff to correct I reckon.


extern crate alloc;

const STATION_MODE_MAX_RETRY_SECONDS: u8 = 10;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This should ideally go in settings.rs?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I agree. I've changed this in PR #113

@brainstorm brainstorm merged commit ba24909 into brainstorm:main Jun 11, 2026
8 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