diff --git a/fan_control/include/ota.hpp b/fan_control/include/ota.hpp index dcba75b..75be939 100644 --- a/fan_control/include/ota.hpp +++ b/fan_control/include/ota.hpp @@ -4,4 +4,4 @@ #include #include -void ota_setup(const char* name); \ No newline at end of file +void ota_setup(); \ No newline at end of file diff --git a/fan_control/src/main.cpp b/fan_control/src/main.cpp index 044b8e3..e369ab4 100644 --- a/fan_control/src/main.cpp +++ b/fan_control/src/main.cpp @@ -6,11 +6,10 @@ #include "serial.hpp" -const char* ssid = "fan_XXX"; void setup() { Serial.begin(115200); - ota_setup(ssid); + ota_setup(); server_setup(); collector_setup(); DEBUG_OUT.println(F("Setup done")); diff --git a/fan_control/src/ota.cpp b/fan_control/src/ota.cpp index db4918b..ab548fc 100644 --- a/fan_control/src/ota.cpp +++ b/fan_control/src/ota.cpp @@ -2,8 +2,12 @@ #include "serial.hpp" #include -void ota_setup(const char* ssid) { +static String ssid; +void ota_setup() { + String mac = WiFi.macAddress(); + mac.replace(":","_"); + ssid = String("fan_") + mac; DEBUG_OUT.println("Booting"); boolean result = WiFi.softAP(ssid); while (result == false) {