Fix ESP32 station-IP lookup - correction to the esp_netif migration just merged in #80 - #81
Merged
davidchatting merged 1 commit intoAug 6, 2026
Conversation
…d rename
The first attempt (esp_netif_get_sta_list()/esp_netif_sta_list_t) was
wrong - CI failed with the same shape of error ('esp_netif_sta_list_t'
does not name a type). That name doesn't exist; I'd guessed it as a
same-shaped rename of tcpip_adapter_get_sta_list() without verifying
against the actual ESP-IDF source.
Verified against espressif/esp-idf v5.1 source this time:
- esp_wifi_ap_get_sta_list() only returns MAC addresses, no IPs
- The real replacement is esp_netif_dhcps_get_clients_by_mac(), which
looks up each MAC's IP from the AP's DHCP server lease table - a
differently-shaped API (caller pre-fills an array of MACs, function
fills in the IPs), not a drop-in rename like the old single call
- Needs an esp_netif_t* handle for the AP interface, obtained via
esp_netif_get_handle_from_ifkey("WIFI_AP_DEF") - the ifkey Arduino's
WiFi.softAP()/esp_netif_create_default_wifi_ap() registers under
Also decouples adapter_sta_list from any ESP-IDF struct entirely:
promoted this library's own wifi_sta.h shim (previously ESP8266-only,
since ESP8266 never had real tcpip_adapter types) to a shared
YoYoStaInfo/YoYoStaList type used on both platforms, so a future
ESP-IDF rename can't break this again the same way.
Still not hardware/toolchain-tested (no ESP32 SDK available in this
environment) - verified against ESP-IDF source this time rather than
guessed, but relying on CI to confirm compilation.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
davidchatting
merged commit Aug 6, 2026
f8823bd
into
interactionresearchstudio:master
2 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#80 merged before my correction landed (same race as #76/#78/#79 before it, but this time the merged commit doesn't actually compile) - `master` currently has the broken first attempt from #80, which guessed `esp_netif_get_sta_list()`/`esp_netif_sta_list_t` as a same-shaped rename of the removed `tcpip_adapter_get_sta_list()`. That guess was wrong and CI failed on it:
```
YoYoWiFiManager.h:183:5: error: 'esp_netif_sta_list_t' does not name a type; did you mean 'esp_netif_flags_t'?
```
This PR is the correction, verified against the actual ESP-IDF v5.1 source this time rather than guessed:
Also decouples `adapter_sta_list` from any ESP-IDF struct entirely: promoted this library's own `wifi_sta.h` shim (previously ESP8266-only, since ESP8266 never had real `tcpip_adapter` types to begin with) into a shared `YoYoStaInfo`/`YoYoStaList` type used on both platforms, so a future ESP-IDF rename can't break this the same way again.
Testing
Still not hardware/toolchain-tested (no ESP32 SDK available in this environment - not enough disk space for the full arduino-esp32 toolchain). Verified against the actual ESP-IDF source this time rather than guessed. Watching CI on this PR before considering it done.