Browse Source

wifi bugfix with config_override

pull/1663/head
geronet1 8 months ago
parent
commit
1f90961305
  1. 5
      src/config/config.h
  2. 3
      src/config/config_override_example.h
  3. 2
      src/network/AhoyWifiEsp32.h

5
src/config/config.h

@ -16,9 +16,8 @@
//------------------------------------- //-------------------------------------
// Fallback WiFi Info // Fallback WiFi Info
#define FB_WIFI_SSID "YOUR_WIFI_SSID" #define FB_WIFI_SSID ""
#define FB_WIFI_PWD "YOUR_WIFI_PWD" #define FB_WIFI_PWD ""
// Access Point Info // Access Point Info
// In case there is no WiFi Network or Ahoy can not connect to it, it will act as an Access Point // In case there is no WiFi Network or Ahoy can not connect to it, it will act as an Access Point

3
src/config/config_override_example.h

@ -6,9 +6,6 @@
#ifndef __CONFIG_OVERRIDE_H__ #ifndef __CONFIG_OVERRIDE_H__
#define __CONFIG_OVERRIDE_H__ #define __CONFIG_OVERRIDE_H__
// override fallback WiFi info
#define FB_WIFI_OVERRIDDEN
// each override must be preceded with an #undef statement // each override must be preceded with an #undef statement
#undef FB_WIFI_SSID #undef FB_WIFI_SSID
#define FB_WIFI_SSID "MY_SSID" #define FB_WIFI_SSID "MY_SSID"

2
src/network/AhoyWifiEsp32.h

@ -17,7 +17,7 @@ class AhoyWifi : public AhoyNetwork {
void begin() override { void begin() override {
mAp.enable(); mAp.enable();
if(String(FB_WIFI_SSID) == mConfig->sys.stationSsid) if(strlen(mConfig->sys.stationSsid) == 0)
return; // no station wifi defined return; // no station wifi defined
WiFi.disconnect(); // clean up WiFi.disconnect(); // clean up

Loading…
Cancel
Save