Skip to content

Commit

Permalink
Temperature Display in data screen (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
easytarget committed Sep 3, 2021
1 parent ba13cfd commit f6f4642
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app_httpd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ static ra_filter_t ra_filter;
httpd_handle_t stream_httpd = NULL;
httpd_handle_t camera_httpd = NULL;

#ifdef __cplusplus
extern "C" {
#endif
uint8_t temprature_sens_read();
#ifdef __cplusplus
}
#endif

static mtmn_config_t mtmn_config = {0};
static int8_t is_enrolling = 0;
static face_id_list id_list = {0};
Expand Down Expand Up @@ -872,9 +880,14 @@ static esp_err_t dump_handler(httpd_req_t *req){
int upHours = int64_t(floor(sec/3600)) % 24;
int upMin = int64_t(floor(sec/60)) % 60;
int upSec = sec % 60;
int McuTc = (temprature_sens_read() - 32) / 1.8; // celsius
int McuTf = temprature_sens_read(); // fahrenheit

d+= sprintf(d,"Up: %" PRId64 ":%02i:%02i:%02i (d:h:m:s)<br>\n", upDays, upHours, upMin, upSec);
d+= sprintf(d,"Active streams: %i, Previous streams: %lu, Images captured: %lu<br>\n", streamCount, streamsServed, imagesServed);
d+= sprintf(d,"Freq: %i MHz<br>\n", ESP.getCpuFreqMHz());
d+= sprintf(d,"<span title=\"NOTE: Internal temperature sensor readings can be innacurate on the ESP32-c1 chipset, and may vary significantly between devices!\">");
d+= sprintf(d,"MCU temperature : %i &deg;C, %i &deg;F</span>\n<br>", McuTc, McuTf);
d+= sprintf(d,"Heap: %i, free: %i, min free: %i, max block: %i<br>\n", ESP.getHeapSize(), ESP.getFreeHeap(), ESP.getMinFreeHeap(), ESP.getMaxAllocHeap());
d+= sprintf(d,"Psram: %i, free: %i, min free: %i, max block: %i<br>\n", ESP.getPsramSize(), ESP.getFreePsram(), ESP.getMinFreePsram(), ESP.getMaxAllocPsram());
if (filesystem) {
Expand Down

0 comments on commit f6f4642

Please sign in to comment.