Skip to content

Commit 441fcdf

Browse files
committed
Check networkstatus in publish failure
1 parent 4dc62b2 commit 441fcdf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Wippersnapper.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2664,7 +2664,8 @@ bool Wippersnapper::publish(const char *topic, uint8_t *payload, uint16_t bLen,
26642664
WS_DEBUG_PRINTLN(WS._mqtt->connected());
26652665
WS_DEBUG_PRINT("Network status: ");
26662666
WS_DEBUG_PRINTLN(networkStatus());
2667-
if (WS._mqtt->connected() && networkStatus() == WS_NET_CONNECTED) {
2667+
WS_DEBUG_PRINTLN("IF:");
2668+
if (WS._mqtt->connected() && (networkStatus() == WS_NET_CONNECTED)) {
26682669
WS_DEBUG_PRINTLN("Failed to publish MQTT message, retrying!");
26692670
} else {
26702671
WS_DEBUG_PRINTLN("MQTT connection broken! Running network FSM then publish...");

0 commit comments

Comments
 (0)