mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-19 01:06:41 +00:00
Small changes
This commit is contained in:
parent
1a435fd094
commit
e5e118575d
@ -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
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -76,6 +76,7 @@ bool networkEverySecond(void)
|
||||
#if HASP_USE_WIFI > 0
|
||||
// return wifiEverySecond();
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user