-
Notifications
You must be signed in to change notification settings - Fork 89
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
Create a RsOpenLEADR module #1026
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Ruben Nijveld <[email protected]>
Signed-off-by: Ruben Nijveld <[email protected]>
// sleep in maximum steps of 5 minutes, to make sure that power | ||
// management features don't send our retrieval schedule out of | ||
// sync | ||
while time_remaining > TimeDelta::zero() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if I understand the while loop here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah draft
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is basically a way to handle two things: any suspend-state that a system might end up in, in which case the monotonic clock these timers are based upon aren't advancing or when an NTP daemon does clock adjustments using jumps, which also doesn't affect the monotonic clock that is used for timers in Linux.
The sleeps we are working with here are generally pretty large (in the order of a day or even a week), and just setting a timeout for 86400 seconds might result in overshooting the target time significantly given the previously mentioned problems. This implementation is an attempt to not overshoot the target time while at the same time not completely falling back to a busy loop. A better solution would of course be if the underlying system offers a way of waking up the process when a certain time is reached, but I don't think everest offers such an interface?
Having said all that: I'm not sure how much I should really be worrying about these problems at all, and I could just as well remove this code altogether if desired :)
Describe your changes
This is a work in progress draft implementation for OpenADR 3.0 using openleadr-rs. The goals here would be:
To do this, we need two mechanisms implemented that aren't in openleadr-rs:
I've attempted to implement these two parts, but have not yet implemented the sending of updated values using the external_energy_limits interface.
Issue ticket number and link
Checklist before requesting a review