Skip to content

Conversation

@mcsarge
Copy link
Member

@mcsarge mcsarge commented Jul 21, 2023

As discussed, I have reworked the looping to call for a publish periodically. The wake publish rate is limited to not fater than every 5 seconds. When publish time comes around, the buffer flags are cleared and an attempt is made to fill them again. Once filled, the data is published to mqtt. Only one modbus async read is allowed at a time. So when multiple reads need to be done, that are done sequentially. If the modbus read does not return or errors out the publish does not happen. There is a timer that will clear the modbus read flag if the read never returns or errors out as a safety.

valid = false;
}
int rate = _webServer.arg(wakePublishRateParam.getId()).toInt() * 1000;
// long mqttServerParamLength = _webServer.arg(mqttServerParam.getId()).length();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this code is commented?

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

Successfully merging this pull request may close these issues.

2 participants