Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: EmonESP change sampling rate #78

Open
Projects0987 opened this issue Jan 21, 2022 · 1 comment
Open

Feature request: EmonESP change sampling rate #78

Projects0987 opened this issue Jan 21, 2022 · 1 comment

Comments

@Projects0987
Copy link

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

@github768484
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants