Changes to add support for AMETEK Powervar UPM as usb-hid UPS.#733
Changes to add support for AMETEK Powervar UPM as usb-hid UPS.#733jimklimov merged 16 commits intonetworkupstools:masterfrom
Conversation
…ng a report index to libusb.c in order to handle the composite device in the UPM.
|
This pull request introduces 1 alert when merging adb504d into 1b217f4 - view on LGTM.com new alerts:
|
|
The BUILD_TYPE=default failed for a missing dependency in "make install". I don't think any of my changes could have caused this, any ideas why the build failed like this? |
@jimklimov do you have a way to retry that build on Travis? |
|
@clepple theoretically you can access by clicking the link and restart build (which I just did) |
jimklimov
left a comment
There was a problem hiding this comment.
Can't comment on actual driver content (mostly it is HID mapping... and whether correct flags, string-names and other fields are used), but structurally the change looks good :)
Note this will slightly conflict (at least in Makefile and likely in subdriver list) with changes from PR #807
|
|
||
| static hid_info_t powervar_hid2nut[] = { | ||
|
|
||
| { "ups.powersummary.iproduct", 0, 0, "UPS.PowerSummary.iProduct", NULL, "%.0f", 0, NULL }, |
There was a problem hiding this comment.
same comments as #807 on indexed string (mfr, model, serial)
There was a problem hiding this comment.
@aquette Are you saying that we don't need to have the iProduct, iSerialNumber & iManufacturer entries?
There was a problem hiding this comment.
Understood. I have removed them and diid a build and an install locally and all is well. I'll wait to upload until we have completed the other review items.
There was a problem hiding this comment.
Ok.
Please send in an upsc output once good, to confirm everything is fine
There was a problem hiding this comment.
UPSC output with all changes included.
amccartney@amccartney-OptiPlex-3010:/lib/nut$ upsc UPM@localhost
Init SSL without certificate database
battery.capacity: 100
battery.capacitymode: 2
battery.charge: 100
battery.designcapacity: 100
battery.ioeminformation: AMETEK-POWERVAR Cor
battery.runtime: 360000
battery.type: PbAc
device.mfr: AMETEK-POWERVAR Corporation
device.model: UPM UPS (v01.51, Nov 3 2018)
device.serial: 5014403R-1740135
device.type: ups
driver.flag.pollonly: enabled
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.synchronous: no
driver.version: 2.7.4-732-gadb504d0
driver.version.data: Powervar HID 0.19
driver.version.internal: 0.43
ups.mfr: AMETEK-POWERVAR Corporation
ups.model: UPM UPS (v01.51, Nov 3 2018)
ups.powersummary.imanufacturer: 2
ups.powersummary.iproduct: 2
ups.powersummary.iserialnumber: 4
ups.productid: 0002
ups.serial: 5014403R-1740135
ups.status: OL
ups.vendorid: 4234
There was a problem hiding this comment.
thx @andrewmccartney
few more comments in light of this (@jimklimov @clepple and others may complete):
-
battery.capacitymode: 2
** capacitymode doesn't exist (as per https://github.com/networkupstools/nut/blob/master/docs/nut-names.txt#L350)
** battery.capacity.mode would be more appropriate at first sight (new var, need RFC), but depends on what the values meaning
** for the value, there should be something more friendly to provide (2 == "some explicit string") -
battery.designcapacity
** battery.charge.design would be more appropriate (new var, need RFC), considering the value -
battery.ioeminformation
** non existing variable. battery.mfr or device.mfr.oem or ? -
device.model: UPM UPS (v01.51, Nov 3 2018)
** the part between parenthesis should be split between device.firmware and ups.mfr.date -
ups.powersummary.imanufacturer & ups.powersummary.iproduct & ups.powersummary.iserialnumber
** to be removed, as per my previous comment. these are just the indexes of the strings, already published as device.{mfr, model, serial} -
side comment: I see no load, realpower nor power data, that would give visibility on the power consumption on the UPS output. Nothing avail?
cheers,
Arno
There was a problem hiding this comment.
@aquette @jimklimov with regards to these changes, if I am understanding you correctly I would need to change the Powervar UPS HID behavior to accomplish this. This would be a UPS firmware change and at this time that is not a possibility. Please advise me if I am not understanding what you are asking here.
There was a problem hiding this comment.
@andrewmccartney no need to modify your FW for the above (possibly apart from the realpower, power and load Usage.
The other comments need just the NUT subdriver modification.
device.firmware could also be in its own "UPS.PowerSummary.iVersion", but can also be split from iModel using the callback function:
- modify powervar_format_model() so that it strips the parenthesis and just return the model
- leave a mapping on iProduct, but for device.firmware and set a callback function to extract the firmware info
{ "device.firmware", 0, 0, "UPS.PowerSummary.iProduct", NULL, "%.0f", 0, stringid_to_firmware}, - same for ups.mfr.date...
|
This pull request introduces 1 alert when merging b25f8b5 into 6eceb3f - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging 1c75f81 into ab955fd - view on LGTM.com new alerts:
|
|
There were some good comments in discussion about ensuring an UPS poweroff with some clever scenarios, which currently should be set up outside the USB HID connection. I think the manpage needs to mention that, perhaps referencing the vendor documentation (if there are some stable URLs possible) or spelling out the interesting parts in NUT docs/ codebase. This also brought to my attention that the PR does not update
|
|
…ded company/contributor info. Updated docs/man/usbhid-ups.txt
|
This pull request introduces 1 alert when merging e266362 into f83ca0b - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging 29f78b5 into f83ca0b - view on LGTM.com new alerts:
|
|
Thanks for getting to the docs too! Dictionary wants an update per https://travis-ci.org/github/networkupstools/nut/jobs/735038633#L870 : |
Add new product name and vendor keywords
Rearranged lines to keep "all" block together, and finish the list item with a comma without much context change ;)
|
This pull request introduces 1 alert when merging d4172dc into f83ca0b - view on LGTM.com new alerts:
|
|
@jimklimov I'm new to the process here for merging changes. At this stage the changes are approved - correct? is there anything else I need to do to have them merged? |
|
This pull request introduces 1 alert when merging a567c93 into fe1ad77 - view on LGTM.com new alerts:
|
Add vendor contribution from AMETEK Powervar for UPM series
|
Looks good to me, if other NUT maintainers do not voice objections I plan to merge this PR in a week or so. Thank you very much for the contribution, and for patience with us :) Much appreciated! |
| * link:https://www.ametek.com/products/businessunits/powersystemsandinstruments/powervar[AMETEK | ||
| Powervar], through Andrew McCartney, has added support for all AMETEK Powervar | ||
| UPM models as usb-hid UPS. | ||
|
|
There was a problem hiding this comment.
Note @andrewmccartney : I took the liberty to stub an acknowledgements entry here. Feel free to modify if I got some names or spellings wrong.
|
This pull request introduces 1 alert when merging 55778c9 into 3f3a959 - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging 501ae3a into 26c8994 - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging 4fd8a45 into 3a4e88d - view on LGTM.com new alerts:
|
|
Since other NUT maintainers did not voice objections, I plan to merge this after the build completes which re-syncs the PR code to current master branch state. |
|
This pull request introduces 1 alert when merging ecce15e into 9defa7a - view on LGTM.com new alerts:
|
Includes adding a report index to libusb.c in order to handle the composite device in the UPM.
The original code has the report index hard coded to zero. By using a variable for the report index it can be set to the desired report index based on detecting connected devices that use multiple report indexes.
All other changes are the standard items for introducing a new HID device.