generic modbus driver#1052
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@dtsecon does this mean that i can setup my own Modbus TCP server and set NUT server to point to it and then i fill out data into the registries which NUT server would read , is that correct understood ? |
Yes, your assumption is correct although never tested. However, OL (online), OB (on battery), LB (low battery), HB (high battery), RB (replace battery) and FSD (forced shutdown) statuses are currently supported. |
|
@jimklimov hello, Regards, |
|
Sorry for the lag on my side. Travis CI has gone away from free FOSS builds, so a new dedicated NUT CI is being built. There are still some rough edges, but it should be usable by now and I'm bumping the existing PRs to build there. Thanks for waiting :\ |
|
Hello, it seems that I may not update the PR source (your "master" branch) because it has github branch protection rules, probably: Can you please disable that config point, seems Travis is not coming back... |
done! |
|
With CI finally somewhat rectified, it finds code issues in this PR - mostly due to platforms/standards mixup I think. A few that caught my eye in orange balls at https://ci.networkupstools.org/blue/organizations/jenkins/nut%2Fnut/detail/PR-1052/1 are:
|
done! |
|
Looks good to me and CI, hopefully tested with HW on your side at least? :) One question about the side fixes for asciidoc builds -- did your tools complain about the lack of equals sign? Seems those versions on CI farm are okay with it either way, at least they do not fail due to CLI :) |
the driver supports any UPS with relay contact signals via a remote I/O device (with RS485 or TCP/IP interface). It has been thoroughly tested against PULS UB40.241 but is expected to work with any other similar UPS. there is a missing '=' in a2x --xsltproc-opts switch argument, specifically in conficure.ac and docs/man/Makefile.am. It seems that "=" is mandatory for a2x to run successfully otherwise building procedure (with --with-doc(s)) couldn't compile man pages at all. |
|
Thanks for clarifications. Just to know: what version of a2x and on what OS
did not work for you with the older Makefiles? Because that part did not
change for a few years AFAIK and worked on many different platforms.
Wondering if yours is too new or too old? Or some fork?
Either way, new CLI syntax seems to work for CI builders too, so thanks!
…On Fri, Sep 17, 2021, 10:34 dtsecon ***@***.***> wrote:
Looks good to me and CI, hopefully tested with HW on your side at least? :)
One question about the side fixes for asciidoc builds -- did your tools
complain about the lack of equals sign? Seems those versions on CI farm are
okay with it either way, at least they do not fail due to CLI :)
Did you verify that the results of those docs builds are equivalent?
the driver supports any UPS with relay contact signals via a remote I/O
device (with RS485 or TCP/IP interface). It has been thoroughly tested
against PULS UB40.241 but is expected to work with any other similar UPS.
there is a missing '=' in a2x --xsltproc-opts switch argument,
specifically in conficure.ac and docs/man/Makefile.am. It seems that "="
is mandatory for a2x to run successfully otherwise building procedure (with
--with-doc(s)) couldn't compile man pages at all.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1052 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMPTFF2S733G24U6IXLJFTUCL4QBANCNFSM47IFNFEA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Here is the platform used for building: OS: Ubuntu 20.04, a2x 9.0.0rc1 (provided by asciidoc-base_9.0.0~rc1-1), GNU Make 4.2.1. |
|
Still looks good, merging! Thanks for the driver and for a2x fixes to move forward :) |
|
Cheers, one more question as I'm going over the code to address some style and stricter compiler warnings: in many places you use arch-dependent "int" and "uint", shouldn't there be more definitively-sized types (uint16_t and so on) to correspond to some wire protocol and library structures? |
This is a generic modbus driver expected to work with contact (direct) signal UPS devices, connected via modbus RIO (remote I/O) either serial or TCP/IP. The driver has been tested against PULS UPS (model UB40.241) via MOXA ioLogikR1212 (RS485) and ioLogikE1212 (TCP/IP).
The PULS UPS UB40.241 supports the following signals:
(DO) <--> HB(DO) <--> OL | OB(DO) <--> LB(DO) <--> RB(DI) <--> FSDDO and DI assumes device perspective
The driver's concept is to map the UPS states (as defined in nut) onto UPS contacts' states
The driver has an extended configuration interface implemented using variables defined in ups.conf.
[generic_modbus]# info parametersdriver = generic_modbusport = /dev/ttyUSB0# port = 192.168.2.104# port = 192.168.2.104:1502desc = "generic ups driver"# device infodevice_mfr = "PULS"device_model = "UB40.241"# serial settingsser_baud_rate = 9600ser_parity = Nser_data_bit = 8ser_stop_bit = 1modbus slave idrio_slave_id = 5# UPS signal state attributesOB_addr = 0x0OB_regtype = 1OB_noro = 0LB_addr = 0x1LB_regtype = 1HB_addr = 0x2HB_regtype = 1RB_addr = 0x3RB_regtype = 1# CHRG_addr = 0x0# CHRG_regtype = 1# CHRG_noro = 1DISCHRG_addr = 0x0DISCHRG_regtype = 1DISCHRG_noro = 0FSD_addr = 0x140FSD_regtype = 0FSD_pulse_duration = 180XXX_addrdenote the modbus address of RIO where the UPS signal is connectedXXX_regtypeis the type of modbus register (0:COIL, 1:INPUT_B, 2:INPUT_R, 3:HOLDING)XXX_norois the configuration for NO/NC (normally open, normally closed contact)FSD_pulse_durationdefines the duration in ms of the inhibit pulse. if it's not defined signal has only one transition depending on noro configuration.Regards
Dimitris.