Commit fd84b81f authored by Eric Duminil's avatar Eric Duminil
Browse files

FIXMEs

parent c424067c
......@@ -3,6 +3,7 @@
#include <Arduino.h>
#include "config.h"
#include "wifi_util.h" // To get MAC
//FIXME: Only if CSV
#include "csv_writer.h" // To close filesystem before reset
#include <WiFiUdp.h> //required for NTP
......
......@@ -88,6 +88,7 @@ namespace web_server {
"<tr><th colspan='2'>CSV</th></tr>\n"
"<tr><td>Last write</td><td>%s</td></tr>\n"
"<tr><td>Timestep</td><td>%5d s</td></tr>\n"
"<tr><td>Available drive space</td><td>%d kB</td></tr>\n"
#endif
#ifdef AMPEL_MQTT
"<tr><th colspan='2'>MQTT</th></tr>\n"
......@@ -106,7 +107,6 @@ namespace web_server {
"<tr><td>Local address</td><td><a href='http://%s.local/'>%s.local</a></td></tr>\n"
"<tr><td>Local IP</td><td><a href='http://%s'>%s</a></td></tr>\n"
"<tr><td>Free heap space</td><td>%6d bytes</td></tr>\n"
"<tr><td>Available drive space</td><td>%d kB</td></tr>\n"
"<tr><td>Max loop duration</td><td>%5d ms</td></tr>\n"
"<tr><td>Board</td><td>%s</td></tr>\n"
"<tr><td>Uptime</td><td>%4d h %02d min %02d s</td></tr>\n"
......@@ -198,6 +198,7 @@ namespace web_server {
ss -= hh * 3600;
uint8_t mm = ss / 60;
ss -= mm * 60;
//FIXME: only if AMPEL_CSV
uint16_t available_fs_space = csv_writer::getAvailableSpace() / 1024;
//NOTE: Splitting in multiple parts in order to use less RAM
......@@ -215,7 +216,7 @@ namespace web_server {
snprintf_P(content, sizeof(content), body_template, SENSOR_ID.c_str(), sensor::co2, sensor::temperature,
sensor::humidity, sensor::timestamp.c_str(), config::measurement_timestep,
#ifdef AMPEL_CSV
csv_writer::last_successful_write.c_str(), config::csv_interval,
csv_writer::last_successful_write.c_str(), config::csv_interval, available_fs_space,
#endif
#ifdef AMPEL_MQTT
mqtt::last_successful_publish.c_str(), config::sending_interval,
......@@ -225,8 +226,7 @@ namespace web_server {
config::lorawan_sending_interval,
#endif
config::temperature_offset, SENSOR_ID.c_str(), SENSOR_ID.c_str(), WiFi.localIP().toString().c_str(),
WiFi.localIP().toString().c_str(), get_free_heap_size(), available_fs_space, max_loop_duration, BOARD, hh, mm,
ss);
WiFi.localIP().toString().c_str(), get_free_heap_size(), max_loop_duration, BOARD, hh, mm, ss);
http.sendContent(content);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment