* try to avoid exceptions, added yield

* try to fix DNS problems
This commit is contained in:
lumapu 2022-04-26 08:50:36 +02:00
parent 7b0eeb2d4e
commit 169bf8c7c8
3 changed files with 7 additions and 4 deletions

View file

@ -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");