Skip to content

genericups: Add support for FTTx battery backup. - #1061

Merged
jimklimov merged 12 commits into
networkupstools:masterfrom
dogtopus:ftth-battery-contact-closure
Oct 5, 2021
Merged

jimklimov merged 12 commits into
networkupstools:masterfrom
dogtopus:ftth-battery-contact-closure

Conversation

@dogtopus

@dogtopus dogtopus commented Jul 7, 2021 •

Copy link
Copy Markdown
Contributor

battery

(Picture from CyberPower website)

A lot of those "UPSes" use a 4-wire open-drain-like contact closure signaling (dubbed "telemetry interface") to report their status (see https://dl4jz3rbrsfum.cloudfront.net/documents/CyberPower_UM_CBN50U48A-1.pdf for example). They are sorta compatible with APC 940-0020B/C cables in terms of pin assignments, with extra signals for replace battery and battery missing and lack of shutdown signal.

nut-fttx

This patch adds a sample device type (23) for this kind of device. It also adds support for the extra signal types (RB for replace battery and BYPASS for disconnected battery) used by these devices, as well as an option to unassign/disable an unused signal in the config file by setting it to NULL (I can also change it to none to be more consistent with the docs. It's your choice).

Note that there is no standard cable for this kind of device, so type 23 assumes RS232 control signaling active low TTL signaling (typical for USB to serial converter chips such as CH340x and FT232 series, as well as RS232 transcievers) with pull-up and RTS as the voltage source for input pin pullups.

dogtopus and others added 9 commits July 6, 2021 22:25
A lot of those "UPSes" use a 4-wire open-drain-like contact closure signaling (dubbed "telemetry interface") to report their status (see https://dl4jz3rbrsfum.cloudfront.net/documents/CyberPower_UM_CBN50U48A-1.pdf for example). They are sorta compatible with APC 940-0020B/C cables in terms of pin assignments, with extra signals for replace battery and battery missing and lack of shutdown signal.

This patch adds a sample device type (23) for this kind of device. It also adds support for the extra signal types (RB for replace battery and BYPASS for disconnected battery) used by these devices, as well as an option to unassign/disable an unused signal in the config file by setting it to NULL.

Note that there is no standard cable for this kind of device, so type 23 assumes RS232 control signaling and RTS as the voltage source for input pin pullups.
Seems that typical RS232 transceivers inverts the signal automatically anyway, so there's no point of making them active high by default.
Comment thread docs/man/genericups.txt
23 = Generic FTTx (Fiber to the x) battery backup
with 4-wire telemetry interface

[CP=RTS] [OL=CTS] [LB=-DCD] [RB=-RNG] [BYPASS=-DSR] [SD=none]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@dogtopus : In the patch description you mentioned a "NULL" vs. "none" - is this SD=none one of such cases? I did not find an earlier particular handling for "none" string in genericups.c so got no strong opinion... just wondering if that strstr call checking for "NULL" string should also check for "or none" and that's it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jimklimov Yes, that's exactly what I meant. Documentations have none as the placeholder for not applicable/disabled signals but I used NULL instead (mostly because I implemented the feature before I actually read that part of the doc).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Followed up with dogtopus#1

Wondering now if an SD=none as documented with the original PR would have been in fact handled when parsing the upstype from ups.conf as documented? Just in case, did you check that ability to customize?

@jimklimov jimklimov added the ready / gonna merge The PR is in final cycles leading to merge unless someone logs an objection before we hit the button label Sep 23, 2021
…LL=none

Contact closure genericUPS: alias NULL=none
@jimklimov
jimklimov merged commit d0cbd05 into networkupstools:master Oct 5, 2021
@jimklimov

Copy link
Copy Markdown
Member

Thanks for bearing with me, and for the contribution and explanations of course :)

jimklimov added a commit to jimklimov/nut that referenced this pull request Oct 8, 2021
…ntact-closure

genericups: Add support for FTTx battery backup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready / gonna merge The PR is in final cycles leading to merge unless someone logs an objection before we hit the button

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants