diff --git a/tools/esp8266/app.cpp b/tools/esp8266/app.cpp index 6d4056c2..aace1c53 100644 --- a/tools/esp8266/app.cpp +++ b/tools/esp8266/app.cpp @@ -150,7 +150,8 @@ void app::loop(void) { inv = mSys->getInverterByPos(i); if(NULL != inv) { mSys->Radio.sendTimePacket(inv->radioId.u64, mTimestamp); - delay(20); + yield(); + delay(100); } } } @@ -171,6 +172,7 @@ void app::loop(void) { snprintf(val, 10, "%.3f", mSys->getValue(iv, i)); mMqtt.sendMsg(topic, val); delay(20); + yield(); } } } @@ -187,6 +189,7 @@ void app::loop(void) { snprintf(val, 10, "%.3f %s", mSys->getValue(iv, i), mSys->getUnit(iv, i)); Serial.println(String(topic) + ": " + String(val)); } + yield(); } } } diff --git a/tools/esp8266/defines.h b/tools/esp8266/defines.h index 74bb4f90..d974e9eb 100644 --- a/tools/esp8266/defines.h +++ b/tools/esp8266/defines.h @@ -25,7 +25,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 2 -#define VERSION_PATCH 7 +#define VERSION_PATCH 8 //------------------------------------- diff --git a/tools/esp8266/main.cpp b/tools/esp8266/main.cpp index 746c11e7..25b68c71 100644 --- a/tools/esp8266/main.cpp +++ b/tools/esp8266/main.cpp @@ -43,8 +43,6 @@ void Main::setup(const char *ssid, const char *pwd, uint32_t timeout) { mWeb->onNotFound (std::bind(&Main::showNotFound, this)); startAp = getConfig(); - if(String(mDeviceName) != "") - WiFi.hostname(mDeviceName); if(false == startAp) startAp = setupStation(timeout); @@ -126,6 +124,8 @@ bool Main::setupStation(uint32_t timeout) { WiFi.mode(WIFI_STA); WiFi.begin(mStationSsid, mStationPwd); + if(String(mDeviceName) != "") + WiFi.hostname(mDeviceName); delay(5000); Serial.println("wait for network");