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

Implement Smart Config for ESP32 #2474

Merged
merged 10 commits into from
Jan 27, 2022

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Jan 26, 2022

Re. #2473 here are the bones of a smart config implementation for ESP32.

TODO:

  • Fix missing __wrap_putchar error (libsc_get_ssid_passwd.a)
  • Test

Closes #2473

@slaff slaff added this to the 4.6.0 milestone Jan 26, 2022
@slaff slaff mentioned this pull request Jan 26, 2022
5 tasks
@kmihaylov
Copy link
Contributor

Ah I missed it :)
kmihaylov@94dc8fa
I got lost with std::unique_ptr so I took a rest and here you already made it...

Anyway, I'll be glad to tell me how Sming includes the esp-idf header files?

Move classes into SmingInternal::Network namespace
Handle station events in station class implementation
Add placeholder for accesspoint events
Implement auto-connect setting
@mikee47
Copy link
Contributor Author

mikee47 commented Jan 26, 2022

The Basic_SmartConfig sample kind of works, with a couple of provisos:

Smart config won't work if station has already been configured and set to auto-connect on startup.
Error is STA is connecting, scan are not allowed!.
This is perfectly logical and probably something the applicatdion should address rather than the framework.
i.e. need to call WifiStation.disconnect() first.

Attempting to configure with wrong credentials isn't really handled. Again, that's something the application needs to consider. I took a quick look at ESP8266 behaviour and same deal.

@mikee47
Copy link
Contributor Author

mikee47 commented Jan 26, 2022

Note: The __wrap_putchar doesn't seem to get called, no idea what it's for...

UPDATE: My bad, typo in libc, now fixed :-)

@kmihaylov
Copy link
Contributor

Works well for me. Both the example and in my project.
Great work @mikee47 !

@mikee47
Copy link
Contributor Author

mikee47 commented Jan 26, 2022

Refinement to the event handling now blocks auto-connect if WPS or SmartConfig are active, so the Basic_SmartConfig sample works even if already configured.

@mikee47 mikee47 changed the title [WIP] Implement Smart Config for ESP32 Implement Smart Config for ESP32 Jan 26, 2022
@slaff slaff merged commit 7294e9b into SmingHub:develop Jan 27, 2022
@mikee47 mikee47 deleted the feature/esp32-smartconfig branch January 27, 2022 09:41
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.

Esp32 SmartConfig
3 participants