warn when current/voltage limits are at 0 #72

Closed
opened 2022-08-26 19:47:17 +08:00 by sb10q · 6 comments
Owner
No description provided.
esavkin was assigned by sb10q 2022-12-12 18:37:16 +08:00
Owner

Proposed features

Emit warning messages to the log and all TCP sessions once, on the case: any of the max_v, max_i_pos, max_i_neg of any channel is set to zero+-EPSILON by pwm command.

Emit warning messages to the newly created TCP session once, on the case: client connected by TCP, and any of the max_v, max_i_pos, max_i_neg of any channel is equal to zero+-EPSILON.

All above cases should emit one message per zeroed channel:variable pair.

Message format

For TCP sessions, message should be in machine-readable format (JSON):

{ "warning": "limit is set to zero", "channel": <channel number>, "limit": "<variable name>" }

For the log:

<log prefixes> <variable name> limit is set to zero at channel <channel number>
### Proposed features Emit warning messages to the log and all TCP sessions **once**, on the case: any of the *max_v, max_i_pos, max_i_neg* of any channel is set to zero+-EPSILON by pwm command. Emit warning messages to the newly created TCP session **once**, on the case: client connected by TCP, and any of the *max_v, max_i_pos, max_i_neg* of any channel is equal to zero+-EPSILON. All above cases should emit one message per zeroed `channel:variable` pair. ### Message format For TCP sessions, message should be in machine-readable format (JSON): ```json { "warning": "limit is set to zero", "channel": <channel number>, "limit": "<variable name>" } ``` For the log: ``` <log prefixes> <variable name> limit is set to zero at channel <channel number> ```
Author
Owner

The log is only used for development AFAIK and this is a user feature, so we can skip the log part.

Might be easier and cleaner to do client-side.

The log is only used for development AFAIK and this is a user feature, so we can skip the log part. Might be easier and cleaner to do client-side.
Owner

Might be easier and cleaner to do client-side.

I doubt it would be far easier. What should happen on multiuser case? If that's would be pure client feature, that would be either of these:

  1. Client silently requests for report over some specified time (or enables report mode), and once any of the max_v, max_i_pos, max_i_neg is near zero, emits warning message to the STDERR.
  2. Client silently requests for report after every command, and once any of the max_v, max_i_pos, max_i_neg is near zero, emits warning message to the STDERR.
  3. Client requests for values on its construction and checks user's input in set_param only, and once any of the max_v, max_i_pos, max_i_neg is near zero, emits warning message to the STDERR.

From server-side though, it could effectively send to all tcp channels the warnings once the values changed.

> Might be easier and cleaner to do client-side. I doubt it would be far easier. What should happen on multiuser case? If that's would be pure client feature, that would be either of these: 1. Client silently requests for report over some specified time (or enables report mode), and once any of the `max_v, max_i_pos, max_i_neg` is near zero, emits warning message to the STDERR. 2. Client silently requests for report after every command, and once any of the `max_v, max_i_pos, max_i_neg` is near zero, emits warning message to the STDERR. 3. Client requests for values on its construction and checks user's input in `set_param` only, and once any of the `max_v, max_i_pos, max_i_neg` is near zero, emits warning message to the STDERR. From server-side though, it could effectively send to all tcp channels the warnings once the values changed.
Author
Owner

The intended purpose here is to tell the user what to do when bringing up a Thermostat with the default values at zero. No need to make this overly complicated. If there are multiple connections we can assume the user knows what they are doing already.

The intended purpose here is to tell the user what to do when bringing up a Thermostat with the default values at zero. No need to make this overly complicated. If there are multiple connections we can assume the user knows what they are doing already.
Owner

So overall proposed feature is this?

Client requests for values on its construction, and once any of the max_v, max_i_pos, max_i_neg on any channel is near zero, emits warning message to the STDERR:

<variable name> limit is set to zero at channel <channel number>
So overall proposed feature is this? Client requests for values on its construction, and once any of the `max_v`, `max_i_pos`, `max_i_neg` on any channel is near zero, emits warning message to the STDERR: ``` <variable name> limit is set to zero at channel <channel number> ```
Author
Owner

Yes, something like that. And the equivalent in the GUI

Yes, something like that. And the equivalent in the GUI
sb10q closed this issue 2023-03-23 17:01:30 +08:00
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/thermostat#72
No description provided.