mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-10 13:36:54 +03:00
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:
@@ -870,12 +870,12 @@ void task_autodoFlow(void *pvParameter)
|
|||||||
LogFile.RemoveOldDataLog();
|
LogFile.RemoveOldDataLog();
|
||||||
}
|
}
|
||||||
|
|
||||||
//CPU Temp
|
//CPU Temp -> Logfile
|
||||||
float cputmp = temperatureRead();
|
|
||||||
std::stringstream stream;
|
std::stringstream stream;
|
||||||
stream << std::fixed << std::setprecision(1) << cputmp;
|
stream << std::fixed << std::setprecision(1) << temperatureRead();
|
||||||
string zwtemp = "CPU Temperature: " + stream.str();
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "CPU Temperature: " + stream.str() + "°C");
|
||||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, zwtemp);
|
// 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) +
|
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Round #" + std::to_string(countRounds) +
|
||||||
" completed (" + std::to_string(getUpTime() - roundStartTime) + " seconds)");
|
" completed (" + std::to_string(getUpTime() - roundStartTime) + " seconds)");
|
||||||
|
|||||||
@@ -154,7 +154,22 @@
|
|||||||
xhttp.onreadystatechange = function() {
|
xhttp.onreadystatechange = function() {
|
||||||
if (this.readyState == 4 && this.status == 200) {
|
if (this.readyState == 4 && this.status == 200) {
|
||||||
var _rsp = xhttp.responseText;
|
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);
|
xhttp.open("GET", url, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user