mirror of
https://github.com/revspace/operame
synced 2025-01-08 05:47:01 +00:00
Don't try mqtt connect without wifi
This commit is contained in:
parent
26ee5d39c6
commit
b31be4ee84
@ -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++;
|
||||
|
Loading…
Reference in New Issue
Block a user