Show WIFI signal text labels / Log RSSI value to logfile (#1877)

* Overview: WIFI RSSI strength text labels

* Log RSSI value (debug level)

* Typo
This commit is contained in:
Slider0007
2023-01-21 09:24:23 +01:00
committed by GitHub
parent 2735a0862f
commit 14888bca3f
2 changed files with 21 additions and 6 deletions

View File

@@ -870,12 +870,12 @@ void task_autodoFlow(void *pvParameter)
LogFile.RemoveOldDataLog();
}
//CPU Temp
float cputmp = temperatureRead();
//CPU Temp -> Logfile
std::stringstream stream;
stream << std::fixed << std::setprecision(1) << cputmp;
string zwtemp = "CPU Temperature: " + stream.str();
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, zwtemp);
stream << std::fixed << std::setprecision(1) << temperatureRead();
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "CPU Temperature: " + stream.str() + "°C");
// WIFI Signal Strength (RSSI) -> Logfile
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "WIFI Signal (RSSI): " + std::to_string(get_WIFI_RSSI()) + "dBm");
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Round #" + std::to_string(countRounds) +
" completed (" + std::to_string(getUpTime() - roundStartTime) + " seconds)");

View File

@@ -154,7 +154,22 @@
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var _rsp = xhttp.responseText;
$('#rssi').html("RSSI: " + _rsp);
var _rspVal = _rsp.split("d")[0]
if (_rspVal >= -55) {
$('#rssi').html("WIFI Signal: Excellent (" + _rsp + ")");
}
else if (_rspVal < -55 && _rspVal >= -67) {
$('#rssi').html("WIFI Signal: Good (" + _rsp + ")");
}
else if (_rspVal < -67 && _rspVal >= -78) {
$('#rssi').html("WIFI Signal: Fair (" + _rsp + ")");
}
else if (_rspVal < -78 && _rspVal >= -85) {
$('#rssi').html("WIFI Signal: Weak (" + _rsp + ")");
}
else {
$('#rssi').html("WIFI Signal: Unreliable (" + _rsp + ")");
}
}
}
xhttp.open("GET", url, true);