Repository navigation
siemens-sitop: new driver for Siemens SITOP UPS500-series UPSes - #545
Conversation
zykh
left a comment
There was a problem hiding this comment.
I've nitpicked a bit (and today wasn't even nitpicking day, otherwise I would've marked all the remaining 'nits' -- I'll let you find all of them).
No, seriously, on a first look, overall it looks good to me.
Ah, one last remark, I think that our new drivers are supposed to have a name starting with 'nutdrv_' (and with underscores instead of dashes).
There was a problem hiding this comment.
What about an AsciiDoc admonition paragraph here?
There was a problem hiding this comment.
Thanks for your review and comments.
I'm new to writing manpages, and just found out that 'AsciiDoc' is the magic word to google... ;-)
I reformatted the text in various locations.
There was a problem hiding this comment.
These would be better served by an AsciiDoc listing block.
There was a problem hiding this comment.
I'd remove these redundant 'ups.*' items.
There was a problem hiding this comment.
I got those from the skeleton driver skel.c, so that one might needs a revision as well.
There was a problem hiding this comment.
This is a blocker. If you add a new var you are supposed to:
- document it in nut-names.txt / cmdvartab
- get it approved.
There was a problem hiding this comment.
I have considered to use the existing variable battery.charge, but people (and code?) would probably assume that it contains an integer (percentage), not a string ("<85%" or ">85%").
As far as I could see, the list of existing variables does not contain a variable that suits this purpose, or does it?
There was a problem hiding this comment.
hmm... I'm not so sure this is the best thing to do (without even documenting it in the man page): people will complain that the driver doesn't respect their settings.
There was a problem hiding this comment.
You are right. Instead, I added a log message if the interval is set higher than 5.
There was a problem hiding this comment.
Why not moving these remarks in instcmd() and simply call instcmd("shutdown.return", NULL) here?
There was a problem hiding this comment.
What about using our str_to_uint() (the sign is ignored)?
There was a problem hiding this comment.
If it only would have been mentioned somewhere in the Developer Guide, I would have known about it ;-)
|
One issue remaining: the naming of new drivers. |
|
Thanks for addressing those issues. Two (three) things left:
In my opinion this is (almost) ready, so I'm adding it to 2.7.5 milestone. |
|
About the charge level indication variable: I started a thread about this on the nut-upsdev list, but up to now it remains quiet there… (https://alioth-lists.debian.net/pipermail/nut-upsdev/2018-April/thread.html). For now, I removed the % characters from the indication values. I added a separate section to the man page about polling, and fixed the line endings. |
|
@zykh and @mtenberge what's the status on this one? |
|
@aquette: code-wise, this should be ready (after a rebase). As mentioned in the last comment, the only thing left is the publication of the (approximate) level of battery charge reported (these devices only report if they are below or above 85%) and the formalisation of the var used for that purpose and of its content (i.e. document it in a. add a new variable for things like that? I'm more for the 'a' option, which is the one @mtenberge already implemented, but with a name of But I'm not good at naming things... |
|
I don't have a strong opinion on the variable naming, I'll leave that up to you core devs to decide. I'll see if I can do a rebase this week. |
be2a4cc to
dc5eebb
Compare
- The number of delimiter characters is no longer hard-coded, but will be detected and thrown away at runtime - Discard any remains in the RX buffer after communication errors - collapse repeating code - upsdrv_shutdown now uses instcmd (removes duplicate code) - obsolete ups.* variables removed - poll_interval not hard-coded, but give a warning when a large value is encountered - option parsing improved
dc5eebb to
8dcb9fb
Compare
|
@mtenberge, thanks and sorry for the huge delay. |
…oc: Fixed man page naming for `nutdrv_siemens-sitop(.8)` (dash vs. underscore) to match the driver program name [networkupstools#1209, networkupstools#545] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Please consider this new driver for inclusion in NUT.
Siemens has a line of small UPSes, specially designed for use in machine control cabinets with embedded industrial PCs: they operate at 24V DC instead of AC line voltages, and are suited for DIN-rail mounting.
Machines are mostly switched off by simply interrupting the mains voltage, so with the growing popularity of embedded Linux systems in industry, I expect these UPSes to be used more and more.
There are models with lead acid batteries, but also maintenance-free models with supercaps. Some models have serial ports, others have USB interfaces.
Siemens only provides a Windows application to interface with these UPSes, but they have published the protocol in the device manual.
The protocol is not compatible with existing drivers in NUT, so I have written a new driver and corresponding documentation.
Theoretically, all models from the series (both serial and USB) should work, but as mentioned in the docs, I have only tested the driver with only 1 model variant with USB port.