1
0
mirror of https://github.com/revspace/operame synced 2024-12-04 21:57:30 +00:00

Don't try mqtt connect without wifi

This commit is contained in:
Juerd Waalboer 2020-11-28 22:10:12 +01:00
parent 26ee5d39c6
commit b31be4ee84

View File

@ -244,7 +244,7 @@ void connect_mqtt() {
if (mqtt.connected()) return; // already/still connected
static int failures = 0;
if (mqtt.connect(WiFiSettings.hostname.c_str())) {
if (WiFi.status() == WL_CONNECTED && mqtt.connect(WiFiSettings.hostname.c_str())) {
failures = 0;
} else {
failures++;