nut
nut copied to clipboard
Support some more Legrand devices
This is to track the progress on the topic. Reference: https://alioth-lists.debian.net/pipermail/nut-upsdev/2018-July/007392.html
- [x]
usbhid-ups
: add new dedicated subdriver - [x]
nutdrv_qx
: support devices which don't terminate their replies with the expected CR (#441) - [x]
nutdrv_qx
: add VID:PID tokrauler
USB subdriver - [x]
metasys
: add new devices + fix a few glitches - [x] update HCL
- [ ] ~~update DDL~~ (deferred to after release)
- [x] get/publish protocol used by the new devices ('id code' >= 11) supported by the
metasys
driver: https://github.com/networkupstools/nut-website/commit/570c1e5e9f1fb4f82abef9359897b5159e88fc50 - [x] (possibly) get/publish protocol used by the devices ('id code' < 11) already supported by the
metasys
driver: https://github.com/networkupstools/nut-website/commit/66d30c90401ff7929b25e5a87f9299b728f861ea
Anything else?
Current branch: https://github.com/zykh/nut/tree/issue-441+legrand_updated (this is likely to cause some conflicts with the libusb branches, so I'd prefer to wait for #300 to be solved before rebasing and merging this one)
@zykh do you think this one can still go into 2.7.5 if we want to release now?
@aquette: sure, it's ready, but, as mentioned above, if 2.7.5 will contain one of the libusb branches, I'd prefer to (rebase and) merge this one after the libusb branch, to avoid possible conflicts there.
Hello together, just bought a new Legrand KEOR PDU 800 and can't get it recognized by the drivers under version 2.7.4 I found compatibility (from 2016) with the KEOR Multiplug but I guess this was the previous Hardware version. the new products seem to be different
Cheerz, Chris
Seems this support was added after the 2.7.4 release, and a 2.7.5 is sadly still pending. If you can try building from sources available on Github, you can confirm if that would support your device or some further work is needed.
On Sat, Jul 24, 2021 at 2:56 PM Christian Raab @.***> wrote:
Hello together, just bought a new Legrand KEOR PDU 800 and can't get it recognized by the drivers under version 2.7.4 I found compatibility (from 2016) with the KEOR Multiplug but I guess this was the previous Hardware version. the new products seem to be different
Cheerz, Chris
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/networkupstools/nut/issues/616#issuecomment-886049978, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMPTFCFFNKXGWTIZMINTL3TZK2ABANCNFSM4FUJGXRQ .
Hi there, @greyslater I'm waiting for Keor 800 support too :)
@jimklimov unfortunately i can't but do we have any progress in general here on 2.7.5 as far as i understand @zykh already implemented it in the forked repository
hi @nseries100 - i came upon all this because i connected the Keor 800 to a QNAP NAS and it's not recognized found out that QTS (QNAP OS) uses NUT under the hood
Got this branch running on current master by resolving some of the conflicts. removed metasys changes for now as there were too many conflicts, anything else built fine. (still need to figure out the metasys (don't have such a device), or split the issue
see PR https://github.com/networkupstools/nut/pull/1075
after compiling (on my raspian) using the guide here https://github.com/networkupstools/nut/wiki/Building-NUT-on-Debian,-Raspbian-and-Ubuntu
./configure --includedir=/usr/include --mandir=/usr/share/man --infodir=/usr/share/info --sysconfdir=/etc/nut --localstatedir=/var --libexecdir=/usr/lib/nut --srcdir=. --enable-maintainer-mode --disable-silent-rules --libdir=/usr/lib/$(gcc -print-multiarch) --with-ssl --with-nss --with-cgi --with-dev --enable-static --with-statepath=/var/run/nut --with-altpidpath=/var/run/nut --with-drvpath=/lib/nut --with-cgipath=/usr/lib/cgi-bin/nut --with-htmlpath=/usr/share/nut/www --with-pidpath=/var/run/nut --datadir=/usr/share/nut --with-pkgconfig-dir=/usr/lib/$(gcc -print-multiarch)/pkgconfig --with-user=nut --with-group=nut --with-udev-dir=/lib/udev --with-systemdsystemunitdir=/lib/systemd/system --with-usb --disable-dependency-tracking
and then overwriting the binaries
cp drivers/usbhid-ups /usr/lib/nut/usbhid-ups
i was able to have my Legrand KEOR PDU 800 report the variables. didnt test anything else yet. what else needs to be done on this PR?
My Legrand KEOR PDU 800 is also working (reporting values) with @blecher-at's updated branch.
I checked this branch with updates from master again and noticed that after values like UPS.Input.Voltage now report an invalid value of -0.1. However I believe the issue lies outside the legrand subdrivers, as also dumping usb-hid values using the explore command (as outlined here https://github.com/networkupstools/nut/blob/master/docs/hid-subdrivers.txt) now shows them as invalid. My best guess is this being a regression of https://github.com/networkupstools/nut/issues/1023 I'll add more information there.
Thanks for the report about possible regression, I've posted a PR to help investigate this. THX: #1138
Got this branch running on current master by resolving some of the conflicts. removed metasys changes for now as there were too many conflicts, anything else built fine. (still need to figure out the metasys (don't have such a device), or split the issue
see PR #1075
after compiling (on my raspian) using the guide here https://github.com/networkupstools/nut/wiki/Building-NUT-on-Debian,-Raspbian-and-Ubuntu
./configure --includedir=/usr/include --mandir=/usr/share/man --infodir=/usr/share/info --sysconfdir=/etc/nut --localstatedir=/var --libexecdir=/usr/lib/nut --srcdir=. --enable-maintainer-mode --disable-silent-rules --libdir=/usr/lib/$(gcc -print-multiarch) --with-ssl --with-nss --with-cgi --with-dev --enable-static --with-statepath=/var/run/nut --with-altpidpath=/var/run/nut --with-drvpath=/lib/nut --with-cgipath=/usr/lib/cgi-bin/nut --with-htmlpath=/usr/share/nut/www --with-pidpath=/var/run/nut --datadir=/usr/share/nut --with-pkgconfig-dir=/usr/lib/$(gcc -print-multiarch)/pkgconfig --with-user=nut --with-group=nut --with-udev-dir=/lib/udev --with-systemdsystemunitdir=/lib/systemd/system --with-usb --disable-dependency-tracking
and then overwriting the binariescp drivers/usbhid-ups /usr/lib/nut/usbhid-ups
i was able to have my Legrand KEOR PDU 800 report the variables. didnt test anything else yet. what else needs to be done on this PR?
After compiling still the same issue:
sudo upsdrvctl start Network UPS Tools - UPS driver controller 2.7.4 Network UPS Tools - Generic HID driver 0.43 (2.7.4-2984-g3d7d9597) USB communication driver 0.33 No matching HID UPS found Driver failed to start (exit status=1) any ideas? thx
is it really connected? what does lsusb say? what about /usr/lib/nut/usbhid-ups -DDD -a lups (lups is the name of the config section in /etc/nut/ups.conf, which in my case looks like this:
[lups] driver = usbhid-ups port = auto vendorid = 1cb0 productid = 0038
also I need need to reset the device when driver was already running (can be done physically, or using the usbreset utulity https://wiki.ubuntuusers.de/usbreset/)
/home/pi/nut# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 1cb0:0038
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
slush its fine
/home/pi/nut# /usr/lib/nut/usbhid-ups -DDD -a ups Network UPS Tools - Generic HID driver 0.43 (2.7.4-2984-g3d7d9597) USB communication driver 0.33 0.000000 [D1] debug level is '3' 0.002045 [D2] Initializing an USB-connected UPS with library (null) (NUT subdriver name='USB communication driver' ver='0.33') 0.002124 [D1] upsdrv_initups (non-SHUT)... 0.029510 [D3] usb_busses=0x18af90 0.029616 [D2] Checking device (1D6B/0003) (002/001) 0.058555 [D2] - VendorID: 1d6b 0.058632 [D2] - ProductID: 0003 0.058687 [D2] - Manufacturer: unknown 0.058734 [D2] - Product: unknown 0.058777 [D2] - Serial Number: unknown 0.058819 [D2] - Bus: 002 0.058868 [D2] - Device: 001 0.058914 [D2] - Device release number: 0510 0.058957 [D2] Trying to match device 0.059002 [D2] match_function_subdriver (non-SHUT mode): matching a device... 0.059062 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID 0.059110 [D2] Device does not match - skipping 0.059578 [D2] Checking device (1CB0/0038) (001/003) 0.059732 [D2] - VendorID: 1cb0 0.059782 [D2] - ProductID: 0038 0.059825 [D2] - Manufacturer: unknown 0.059870 [D2] - Product: unknown 0.059915 [D2] - Serial Number: unknown 0.059958 [D2] - Bus: 001 0.060004 [D2] - Device: 003 0.060050 [D2] - Device release number: 0200 0.060092 [D2] Trying to match device 0.060135 [D2] match_function_subdriver (non-SHUT mode): matching a device... 0.060187 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID 0.060236 [D2] Device does not match - skipping 0.060299 [D2] Checking device (2109/3431) (001/002) 0.060400 [D2] - VendorID: 2109 0.060450 [D2] - ProductID: 3431 0.060492 [D2] - Manufacturer: unknown 0.060536 [D2] - Product: unknown 0.060589 [D2] - Serial Number: unknown 0.060632 [D2] - Bus: 001 0.060673 [D2] - Device: 002 0.060716 [D2] - Device release number: 0421 0.060767 [D2] Trying to match device 0.060820 [D2] match_function_subdriver (non-SHUT mode): matching a device... 0.060870 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID 0.060914 [D2] Device does not match - skipping 0.060981 [D2] Checking device (1D6B/0002) (001/001) 0.061076 [D2] - VendorID: 1d6b 0.061125 [D2] - ProductID: 0002 0.061167 [D2] - Manufacturer: unknown 0.061209 [D2] - Product: unknown 0.061251 [D2] - Serial Number: unknown 0.061293 [D2] - Bus: 001 0.061338 [D2] - Device: 001 0.061389 [D2] - Device release number: 0510 0.061434 [D2] Trying to match device 0.061477 [D2] match_function_subdriver (non-SHUT mode): matching a device... 0.061525 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID 0.061572 [D2] Device does not match - skipping 0.061641 [D2] libusb: No appropriate HID device found 0.061698 No matching HID UPS found looks not good: no matching HID device found
You compiled the wrong commit, https://github.com/networkupstools/nut/commit/3d7d9597012e9e316a358e9ed67a1da818e6fd3a the pull request you need to build is this one: https://github.com/networkupstools/nut/pull/1075 -> https://github.com/blecher-at/nut/tree/issue-441%2Blegrand_updated-3
ok thx I used this guide: https://github.com/networkupstools/nut/wiki/Building-NUT-on-Debian,-Raspbian-and-Ubuntu eher was my misstake?
You need to clone the repo from this PR:
git clone https://github.com/blecher-at/nut.git && cd nut && git checkout issue-441+legrand_updated-3
and then build
or wait for this PR to be merged
your build same problem: root@raspberrypi:/home/pi# /usr/lib/nut/usbhid-ups -DDD -a ups Network UPS Tools - Generic HID driver 0.43 (2.7.4-2486-gaa0b3d1d) USB communication driver 0.33 0.000000 [D1] debug level is '3' 0.002261 [D2] Initializing an USB-connected UPS with library (null) (NUT subdriver name='USB communication driver' ver='0.33') 0.002347 [D1] upsdrv_initups (non-SHUT)... 0.037190 [D3] usb_busses=0x23ff90 0.037302 [D2] Checking device (1D6B/0003) (002/001) 0.066162 [D2] - VendorID: 1d6b 0.066234 [D2] - ProductID: 0003 0.066286 [D2] - Manufacturer: unknown 0.066337 [D2] - Product: unknown 0.066388 [D2] - Serial Number: unknown 0.066893 [D2] - Bus: 002 0.067149 [D2] - Device: 001 0.067583 [D2] - Device release number: 0510 0.068013 [D2] Trying to match device 0.068447 [D2] match_function_subdriver (non-SHUT mode): matching a device... 0.068976 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID 0.069033 [D2] Device does not match - skipping 0.069883 [D2] Checking device (1CB0/0038) (001/003) 0.070281 [D2] - VendorID: 1cb0 0.070469 [D2] - ProductID: 0038 0.070771 [D2] - Manufacturer: unknown 0.071070 [D2] - Product: unknown 0.071369 [D2] - Serial Number: unknown 0.071673 [D2] - Bus: 001 0.071721 [D2] - Device: 003 0.071765 [D2] - Device release number: 0200 0.071808 [D2] Trying to match device 0.072032 [D2] match_function_subdriver (non-SHUT mode): matching a device... 0.072419 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID 0.072801 [D2] Device does not match - skipping 0.073344 [D2] Checking device (2109/3431) (001/002) 0.073791 [D2] - VendorID: 2109 0.074031 [D2] - ProductID: 3431 0.074411 [D2] - Manufacturer: unknown 0.074775 [D2] - Product: unknown 0.075140 [D2] - Serial Number: unknown 0.075556 [D2] - Bus: 001 0.075866 [D2] - Device: 002 0.076049 [D2] - Device release number: 0421 0.076230 [D2] Trying to match device 0.076412 [D2] match_function_subdriver (non-SHUT mode): matching a device... 0.076608 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID 0.076803 [D2] Device does not match - skipping 0.077250 [D2] Checking device (1D6B/0002) (001/001) 0.077499 [D2] - VendorID: 1d6b 0.077684 [D2] - ProductID: 0002 0.077737 [D2] - Manufacturer: unknown 0.077780 [D2] - Product: unknown 0.077823 [D2] - Serial Number: unknown 0.077865 [D2] - Bus: 001 0.078093 [D2] - Device: 001 0.078491 [D2] - Device release number: 0510 0.078705 [D2] Trying to match device 0.078919 [D2] match_function_subdriver (non-SHUT mode): matching a device... 0.079146 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID 0.079369 [D2] Device does not match - skipping 0.079626 [D2] libusb: No appropriate HID device found 0.079852 No matching HID UPS found root@raspberrypi:/home/pi# sudo upsdrvctl start Network UPS Tools - UPS driver controller 2.7.4 Network UPS Tools - Generic HID driver 0.43 (2.7.4-2486-gaa0b3d1d) USB communication driver 0.33 No matching HID UPS found Driver failed to start (exit status=1) Network UPS Tools - Generic HID driver 0.43 (2.7.4-2486-gaa0b3d1d) USB communication driver 0.33 No matching HID UPS found Driver failed to start (exit status=1)
your log still shows it was built from the wrong commit. (expecting 2.7.4-3009-gd831a9ae). please check you're on the branch and repo I mentioned (commit d831a9ae). looks like you didnt checkout the PR branch after cloning my fork... Other than that I don't know what you're doing wrong, maybe wait for this PR to be merged and then try the official build
Ok thx I will try it tomorrow, when will the official version be released?
Next Problem:
Driver failed to start (exit status=1) Network UPS Tools - Generic HID driver 0.43 (2.7.4-3009-gd831a9ae) USB communication driver 0.33 interrupt pipe disabled (add 'pollonly' flag to 'ups.conf' to get rid of this message) Can't claim USB device [1cb0:0038]: could not detach kernel driver from interface 0: Operation not permitted Driver failed to start (exit status=1) Network UPS Tools - Generic HID driver 0.43 (2.7.4-3009-gd831a9ae) USB communication driver 0.33 interrupt pipe disabled (add 'pollonly' flag to 'ups.conf' to get rid of this message) Can't claim USB device [1cb0:0038]: could not detach kernel driver from interface 0: Operation not permitted Driver failed to start (exit status=1) pi@raspberrypi:~ $ usbreset Usage: usbreset PPPP:VVVV - reset by product and vendor id usbreset BBB/DDD - reset by bus and device number usbreset "Product" - reset by product name
Devices: Number 002/002 ID 090c:1000 Flash Drive FIT Number 001/003 ID 24ae:2013 Rapoo 2.4G Wireless Device Number 001/002 ID 2109:3431 USB2.0 Hub Number 001/004 ID 1cb0:0038 KEOR PDU 800 pi@raspberrypi:~ $ /usr/lib/nut/usbhid-ups -DDD -a ups Network UPS Tools - Generic HID driver 0.43 (2.7.4-3009-gd831a9ae) USB communication driver 0.33 0.000000 Can't open /etc/nut/ups.conf: Can't open /etc/nut/ups.conf: Permission denied pi@raspberrypi:~ $ sudo /usr/lib/nut/usbhid-ups -DDD -a ups Network UPS Tools - Generic HID driver 0.43 (2.7.4-3009-gd831a9ae) USB communication driver 0.33 0.000000 [D1] debug level is '3' 0.002137 [D2] Initializing an USB-connected UPS with library (null) (NUT subdriver name='USB communication driver' ver='0.33') 0.002229 [D1] upsdrv_initups (non-SHUT)... 0.004143 [D3] usb_busses=0x1c434b8 0.004246 [D2] Checking device (090C/1000) (002/002) 0.004437 [D2] - VendorID: 090c 0.004505 [D2] - ProductID: 1000 0.004568 [D2] - Manufacturer: unknown 0.004627 [D2] - Product: unknown 0.004686 [D2] - Serial Number: unknown 0.004747 [D2] - Bus: 002 0.004805 [D2] - Device: 002 0.004863 [D2] - Device release number: 1100 0.004923 [D2] Trying to match device 0.004983 [D2] match_function_subdriver (non-SHUT mode): matching a device... 0.005059 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID 0.005122 [D2] Device does not match - skipping 0.005211 [D2] Checking device (1D6B/0003) (002/001) 0.005343 [D2] - VendorID: 1d6b 0.005408 [D2] - ProductID: 0003 0.005467 [D2] - Manufacturer: unknown 0.005525 [D2] - Product: unknown 0.005584 [D2] - Serial Number: unknown 0.005645 [D2] - Bus: 002 0.005703 [D2] - Device: 001 0.005761 [D2] - Device release number: 0510 0.005820 [D2] Trying to match device 0.005879 [D2] match_function_subdriver (non-SHUT mode): matching a device... 0.005947 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID 0.006007 [D2] Device does not match - skipping 0.006094 [D2] Checking device (1CB0/0038) (001/004) 0.006245 [D2] - VendorID: 1cb0 0.006308 [D2] - ProductID: 0038 0.006366 [D2] - Manufacturer: unknown 0.006427 [D2] - Product: unknown 0.006484 [D2] - Serial Number: unknown 0.006543 [D2] - Bus: 001 0.006602 [D2] - Device: 004 0.006662 [D2] - Device release number: 0200 0.006719 [D2] Trying to match device 0.006780 [D2] match_function_subdriver (non-SHUT mode): matching a device... 0.006844 interrupt pipe disabled (add 'pollonly' flag to 'ups.conf' to get rid of this message) 0.006907 [D3] match_function_regex: matching a device... 0.007057 [D2] Device matches 0.007131 [D2] failed to claim USB device: could not claim interface 0: Operation not permitted 0.007202 [D2] failed to detach kernel driver from USB device: could not detach kernel driver from interface 0: Operation not permitted 0.007270 [D2] failed to claim USB device: could not claim interface 0: Operation not permitted 0.007333 [D2] failed to detach kernel driver from USB device: could not detach kernel driver from interface 0: Operation not permitted 0.007395 [D2] failed to claim USB device: could not claim interface 0: Operation not permitted 0.007456 [D2] failed to detach kernel driver from USB device: could not detach kernel driver from interface 0: Operation not permitted 0.007523 [D2] failed to claim USB device: could not claim interface 0: Operation not permitted 0.007588 [D2] failed to detach kernel driver from USB device: could not detach kernel driver from interface 0: Operation not permitted 0.007652 Can't claim USB device [1cb0:0038]: could not detach kernel driver from interface 0: Operation not permitted
Generally, the Operation not permitted
probably mean that your NUT run-time user account may not write (or even read?) the device filesystem nodes for the USB device. It should be permitted to access (or even "own") the device for the UPS, and apply that across reboots and possibly device re-plugs, which may be a very different adventure depending on the OS used (e.g. USB ports may get re-enumerated based on their population with connected devices or hubs).
One alternative, not perfect but usable, would be to run the NUT driver as root
.
UPDATE: Re-reading your log, I see you've also hit the issue with ups.conf
not accessible to your test user so you re-ran the driver via sudo
; in that case check if some OS/kernel subsystem (such as udev) may be grabbing and holding your UPS as a HID device. A build of NUT should generate config snippets for several device-management frameworks to tell them that a NUT driver is responsible for a matching device.
@jimklimov can we merge this? or what's missing. It runs on my device for over a month now without issues.
Thanks for confirmation, hope to take another look soon, then.
On Thu, Dec 2, 2021, 13:09 Stephan @.***> wrote:
@jimklimov https://github.com/jimklimov can we merge this? or what's missing. It runs on my device for over a month now without issues.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/networkupstools/nut/issues/616#issuecomment-984569310, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMPTFFCZUHNWB4HFJFWFB3UO5OXXANCNFSM4FUJGXRQ . 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.
I got 2x of those Keor 800 and the patch is working well. Thank you for it.
Hi, I've a KEOR 800 too attached to a synology 220+. Is not clear to me how to apply the patch to NUT insite DSM to have the legrand recognized. Someone can help me please? Many thanks!
Hi, I've a KEOR 800 too attached to a synology 220+. Is not clear to me how to apply the patch to NUT insite DSM to have the legrand recognized. Someone can help me please? Many thanks!
Unless you have root access and able to compile it yourself, you have to wait until this is merged, they release a new version and Synology updates NUT.
Any news here? What we are waiting for?
The merge to master was done last month; release of NUT and eventual updated packaging in different distros is still on the menu - got some loose ends to tie up first, and late-coming fixes.
Regarding this issue, so far not closing it as the early discussion mentioned some follow-up work, though it has its own tickets (e.g. #619)