Expandable-6-Channel-ESP32-Energy-Meter
Expandable-6-Channel-ESP32-Energy-Meter copied to clipboard
Feature request: EmonESP change sampling rate
Would it be possible to add the option to adjust the sampling rate on the EmonESP via the web access? Currently it is doing every second which is crating 1000's of data points. If not do I just add a delay in the emoncms.cpp?
Thanks, Matt
I'm not a programmer, but this solution is working for me. I added a delay line at the bottom of the loop in SRC. See below.
// ------------------------------------------------------------------- // LOOP // ------------------------------------------------------------------- void loop() { #ifdef ENABLE_WDT feedLoopWDT(); #endif
web_server_loop(); wifi_loop();
#ifdef ESP8266 ota_loop(); #endif
#ifdef ENABLE_ENERGY_METER energy_meter_loop(); #endif
boolean gotInput = input_get(input); if (gotInput) { DBUGS.println("."); }
if (wifi_client_connected()) { if (emoncms_apikey != 0 && gotInput) { DBUGS.println(input); emoncms_publish(input); } if (mqtt_server != 0) { mqtt_loop(); if (gotInput && mqtt_connected()) { mqtt_publish(input); } } } // ------------------------------------------------------------------- delay(60000); //60-Second delay // ------------------------------------------------------------------- } // end loop