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:
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