Skip to content

Commit

Permalink
wifi: rework (re)connection and softAp logic
Browse files Browse the repository at this point in the history
Immediatly try to connect when reloading settings and previous attempt
had failed. Because of locking, previously this caused a soft-lock of the
internal loop that required waiting for the long Reconnect timeout to
expire first.

Refactor the module to include namespace { ... } and move build settings into .cpp
Saves ~1.5Kb and also allows gcc to issue unused warnings for declared functions.

As a side-effect of refactoring, (temporarily?) remove softAp leases support.
Current Core moved dhcps support into a C++ code, forcing internal logic
to reference a specific object. Better to wait a bit until that
stabilizes and try again. Plus, it is not currently available in the esp-idf.
  • Loading branch information
mcspr committed Aug 2, 2021
1 parent f361fbc commit dde5f37
Show file tree
Hide file tree
Showing 4 changed files with 357 additions and 449 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Expand Up @@ -154,7 +154,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Kingart curtain switch UI support ([#2250](https://github.com/xoseperez/espurna/issues/2250), thanks to **[@echauvet](https://github.com/echauvet)**)
- Refactor WS implementation, add some comments to the header ([#2261](https://github.com/xoseperez/espurna/issues/2261))
#### WiFi
- SoftAP DHCP leases ([#2320](https://github.com/xoseperez/espurna/issues/2320))
- Try to connect to a better AP, when the current RSSI is below -73dBm (only when WiFi scanning is enabled).
#### Relays
- Support multiple provider types (GPIO, virtual, IO expanders, etc.)
Expand Down
5 changes: 0 additions & 5 deletions code/espurna/config/general.h
Expand Up @@ -588,11 +588,6 @@
// By default or when empty, admin password is used instead.
#endif

#ifndef WIFI_AP_LEASES_SUPPORT
#define WIFI_AP_LEASES_SUPPORT 0 // (optional) Specify softAp MAC<->IP DHCP reservations
// Use `set wifiApLease# MAC`, where MAC is a valid 12-byte HEX number without colons
#endif

#ifndef WIFI_AP_CHANNEL
#define WIFI_AP_CHANNEL 1
#endif
Expand Down

0 comments on commit dde5f37

Please sign in to comment.