mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-10 07:26:38 +02:00
* try to avoid exceptions, added yield
* try to fix DNS problems
This commit is contained in:
parent
7b0eeb2d4e
commit
169bf8c7c8
3 changed files with 7 additions and 4 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
//-------------------------------------
|
||||
#define VERSION_MAJOR 0
|
||||
#define VERSION_MINOR 2
|
||||
#define VERSION_PATCH 7
|
||||
#define VERSION_PATCH 8
|
||||
|
||||
|
||||
//-------------------------------------
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue