Small changes

This commit is contained in:
fvanroie 2020-12-10 22:43:53 +01:00
parent 1a435fd094
commit e5e118575d
3 changed files with 9 additions and 4 deletions

View File

@ -379,13 +379,14 @@ bool gpioIsSystemPin(uint8_t gpio)
} // if tft_espi pins
// To-do:
// Backlight GPIO
// Network GPIOs
// Serial GPIOs
// Tasmota Slave GPIOs
#ifdef ARDUINO_ARCH_ESP32
if(psramFound()) {
if((gpio >= 16) && (gpio <= 17)) return true; // PSRAM
if((gpio == 16) || (gpio == 17)) return true; // PSRAM
}
#endif

View File

@ -334,6 +334,7 @@ void mqttStart()
bool mqttFirstConnect = true;
mqttClient.setServer(mqttServer, 1883);
// mqttClient.setSocketTimeout(10); //in seconds
/* Construct unique Client ID*/
{
@ -348,6 +349,8 @@ void mqttStart()
snprintf_P(buffer, sizeof(buffer), PSTR("%sstatus"), mqttNodeTopic); // lastWillTopic
snprintf_P(lastWillPayload, sizeof(lastWillPayload), PSTR("OFF")); // lastWillPayload
haspProgressMsg(F("Connecting MQTT..."));
haspProgressVal(mqttReconnectCount * 5);
if(!mqttClient.connect(mqttClientId, mqttUser, mqttPassword, buffer, 2, false, lastWillPayload, true)) {
// Retry until we give up and restart after connectTimeout seconds
mqttReconnectCount++;
@ -388,7 +391,7 @@ void mqttStart()
}
Log.warning(TAG_MQTT, buffer);
if(mqttReconnectCount > 50) {
if(mqttReconnectCount > 20) {
Log.error(TAG_MQTT, F("Retry count exceeded, rebooting..."));
dispatch_reboot(false);
}

View File

@ -76,6 +76,7 @@ bool networkEverySecond(void)
#if HASP_USE_WIFI > 0
// return wifiEverySecond();
#endif
return true;
}
#endif