Skip to content

Commit df1c227

Browse files
committed
fix heartbeat on Ethernet
1 parent 06008fc commit df1c227

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/system.cpp

+9-4
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,12 @@ void System::send_heartbeat() {
404404
return;
405405
}
406406

407-
int8_t rssi = wifi_quality();
408-
if (rssi == -1) {
409-
return;
407+
int8_t rssi;
408+
if (!ethernet_connected_) {
409+
rssi = wifi_quality();
410+
if (rssi == -1) {
411+
return;
412+
}
410413
}
411414

412415
StaticJsonDocument<EMSESP_JSON_SIZE_SMALL> doc;
@@ -420,7 +423,9 @@ void System::send_heartbeat() {
420423
doc["status"] = FJSON("disconnected");
421424
}
422425

423-
doc["rssi"] = rssi;
426+
if (!ethernet_connected_) {
427+
doc["rssi"] = rssi;
428+
}
424429
doc["uptime"] = uuid::log::format_timestamp_ms(uuid::get_uptime_ms(), 3);
425430
doc["uptime_sec"] = uuid::get_uptime_sec();
426431
doc["mqttfails"] = Mqtt::publish_fails();

0 commit comments

Comments
 (0)