Added more information about the system (ie dev mac address + current software version) and added OTA checks (querying the update server for available updates)
This commit is contained in:
parent
0dcb532007
commit
09aee48f27
@ -3,7 +3,7 @@
|
|||||||
boolean task_blink(void *pData)
|
boolean task_blink(void *pData)
|
||||||
{
|
{
|
||||||
SAB *p = (SAB *) pData;
|
SAB *p = (SAB *) pData;
|
||||||
p->getIoManager().getPcf().togglePin(PCF8574::P2);
|
p->getIOManager().getPcf().togglePin(PCF8574::P2);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -19,18 +19,37 @@ boolean task_sys_info(void *pData)
|
|||||||
|
|
||||||
TimeSpan ts(p->sab->getUpTime());
|
TimeSpan ts(p->sab->getUpTime());
|
||||||
|
|
||||||
Serial.printf_P(PSTR("BATT SENSING...\nUp Time : %d d %d h %d m %d s\nSystem error : %u\nStation IP : %s, %d dBm\nAP IP : %s\nWEB Server clients : %u\nMemory info:\n\tFree RAM : %u\n\tHeap frag : %u\n\tMax block %u\n"),
|
Serial.printf_P(PSTR("BATT SENSING...\nSoftware version : %s\nUp Time : %d d %d h %d m %d s\nSystem error : %u\nStation IP : %s, %d dBm\nAP IP : %s\nDevice MAC : %s\nWEB Server clients : %u\nMemory info:\n\tFree RAM : %u\n\tHeap frag : %u\n\tMax block %u\n"),
|
||||||
|
p->sab->getSoftVersion(),
|
||||||
ts.days(), ts.hours(), ts.minutes(), ts.seconds(),
|
ts.days(), ts.hours(), ts.minutes(), ts.seconds(),
|
||||||
p->sab->getError(),
|
p->sab->getError(),
|
||||||
p->sab->getConnectivityManager().localIP().toString().c_str(),
|
p->sab->getConnectivityManager().localIP().toString().c_str(),
|
||||||
p->sab->getConnectivityManager().RSSI(),
|
p->sab->getConnectivityManager().RSSI(),
|
||||||
p->sab->getConnectivityManager().softAPIP().toString().c_str(),
|
p->sab->getConnectivityManager().softAPIP().toString().c_str(),
|
||||||
|
p->sab->getConnectivityManager().macAddress().c_str(),
|
||||||
p->sab->getWebServer().getConnectedClientsCount(),
|
p->sab->getWebServer().getConnectedClientsCount(),
|
||||||
freeRAM,
|
freeRAM,
|
||||||
HEAPfrag,
|
HEAPfrag,
|
||||||
biggestContigMemBlock);
|
biggestContigMemBlock);
|
||||||
p->powerInfo = p->sab->getPowerManager().getPowerInfo();
|
p->powerInfo = p->sab->getPowerManager().getPowerInfo();
|
||||||
|
|
||||||
|
if(p->sab->getOTAManager().isEnabled())
|
||||||
|
{
|
||||||
|
OTAUpdater::UpdateInfo updateInfo = p->sab->getOTAManager().getOTAUpdater().fetchUpdateInfo(p->sab->getSoftVersion());
|
||||||
|
if(updateInfo.version != NULL)
|
||||||
|
{
|
||||||
|
Serial.printf("OTA : %s -> version(%s)\n", updateInfo.HTTPUpdateInfoToString(), updateInfo.version);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Serial.printf("OTA : %s\n", updateInfo.HTTPUpdateInfoToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Serial.println("OTA updates disabled");
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,7 +82,7 @@ boolean task_post_data_logger(void * pData)
|
|||||||
postData.add("post4", NULL);
|
postData.add("post4", NULL);
|
||||||
|
|
||||||
|
|
||||||
if(p->client.sendHttpQuery(HttpClient::HttpRequestMethod::POST, &getData, &postData))
|
if(p->client.sendHttpQuery(HttpClient::HttpRequestMethod::POST, &getData, &postData) == 0)
|
||||||
{
|
{
|
||||||
Serial.println("Send successful");
|
Serial.println("Send successful");
|
||||||
p->rdy = false;
|
p->rdy = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user