Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish-retry-with-override #697

Draft
wants to merge 2 commits into
base: publish-retry
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Wippersnapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2664,7 +2664,8 @@ bool Wippersnapper::publish(const char *topic, uint8_t *payload, uint16_t bLen,
WS_DEBUG_PRINTLN(WS._mqtt->connected());
WS_DEBUG_PRINT("Network status: ");
WS_DEBUG_PRINTLN(networkStatus());
if (WS._mqtt->connected() && networkStatus() == WS_NET_CONNECTED) {
WS_DEBUG_PRINTLN("IF:");
if (WS._mqtt->connected() && (networkStatus() == WS_NET_CONNECTED)) {
WS_DEBUG_PRINTLN("Failed to publish MQTT message, retrying!");
} else {
WS_DEBUG_PRINTLN("MQTT connection broken! Running network FSM then publish...");
Expand Down
3 changes: 2 additions & 1 deletion src/network_interfaces/Wippersnapper_ESP32.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ class Wippersnapper_ESP32 : public Wippersnapper {
@return ws_status_t
*/
/********************************************************/
ws_status_t networkStatus() {
ws_status_t networkStatus() override {
WS_DEBUG_PRINTLN("ESP NetStatus");
switch (WiFi.status()) {
case WL_CONNECTED:
return WS_NET_CONNECTED;
Expand Down
Loading