Re: [Nut-upsuser] Have any FreeBSD users tried the new libusb-1.0 branch?

2017-11-26 Thread Sam Varshavchik

Charles Lepple writes:

I don't currently have a physical Fedora test system, but can you see if  
this works at least as well as it did prior to the libusb-1.0 branch? (I  
have a few kludges in my tree to make this work on a Raspberry Pi, but they  
are not ready to push.)


https://github.com/networkupstools/nut/commit/ 
170c0ee390c7ecdfb7d86d3b8ee6ca4240f72c2a or checkout branch  
fix_usb_scan_issue_499 from that Git repo.


Yes, that did the trick.

[root@monster ups]# nut-scanner
Scanning USB bus.
No start IP, skipping SNMP
Scanning XML/HTTP bus.
No start IP, skipping NUT bus (old connect method)
Scanning NUT bus (avahi method).
Scanning IPMI bus.

Decided to ^C out of this, instead of waiting for it to time out, then:

[root@monster tmp]# nut-scanner -U
Scanning USB bus.
[nutdev1]
driver = "usbhid-ups"
port = "auto"
vendorid = "0764"
productid = "0501"
product = "CP1500PFCLCD"
serial = ""
vendor = "CPS"
bus = "006"





pgpC3Q2RmIIYe.pgp
Description: PGP signature
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] Have any FreeBSD users tried the new libusb-1.0 branch?

2017-11-26 Thread Charles Lepple
> 
>> # nut-scanner
>> Cannot load USB library (/usr/lib64/libusb-1.0.so.0.1.0) : 
>> /usr/lib64/libusb-1.0.so.0.1.0: undefined symbol: usb_get_string_simple. USB 
>> search disabled.
> 
> Although I suspect that the USB portion of nut-scanner could probably be 
> replaced with a small shell script that parses the output of lsusb, this 
> shouldn't be too hard to fix. Logged, in case it is not as simple as it 
> looks: https://github.com/networkupstools/nut/issues/499

I don't currently have a physical Fedora test system, but can you see if this 
works at least as well as it did prior to the libusb-1.0 branch? (I have a few 
kludges in my tree to make this work on a Raspberry Pi, but they are not ready 
to push.)

https://github.com/networkupstools/nut/commit/170c0ee390c7ecdfb7d86d3b8ee6ca4240f72c2a
 or checkout branch fix_usb_scan_issue_499 from that Git repo.
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Have any FreeBSD users tried the new libusb-1.0 branch?

2017-11-26 Thread Charles Lepple
On Nov 26, 2017, at 3:15 PM, Sam Varshavchik wrote:
> 
> Charles Lepple writes:
> 
>> still looking for volunteers to test the libusb-1.0 code on FreeBSD and 
>> other systems.
> 
> On Fedora 27, running commit 2999c95f0:

Thanks for checking this. I should have been more clear in the second email in 
the thread, but commit 2999c95f0 is on the original "libusb-1.0" branch, which 
had a bunch of half-duplicated commits and other junk on it. There is now a 
"libusb-1.0+0.1" branch with all of that cleaned up. Originally just at 
https://github.com/zykh/nut.git, it is now on 
https://github.com/networkupstools/nut with a few additions (currently at 
revision 80bc452cc).

> 
> # nut-scanner
> Cannot load USB library (/usr/lib64/libusb-1.0.so.0.1.0) : 
> /usr/lib64/libusb-1.0.so.0.1.0: undefined symbol: usb_get_string_simple. USB 
> search disabled.

Although I suspect that the USB portion of nut-scanner could probably be 
replaced with a small shell script that parses the output of lsusb, this 
shouldn't be too hard to fix. Logged, in case it is not as simple as it looks: 
https://github.com/networkupstools/nut/issues/499

> 
> There's also a bug in the configure script on 64 bit Fedora. The configure 
> script sets systemdsystemshutdowndir to /usr/lib64/systemd/systemd-shutdown 
> which misses the mark, a little bit. The fix:

Agreed - looks like we will have that after a merge from master:

https://github.com/networkupstools/nut/pull/496/commits/491d088af70a67b6ed1d2a6a6711d83be71dd911
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Have any FreeBSD users tried the new libusb-1.0 branch?

2017-11-26 Thread Sam Varshavchik

Charles Lepple writes:

still looking for volunteers to test the libusb-1.0 code on FreeBSD and  
other systems.


On Fedora 27, running commit 2999c95f0:

# nut-scanner
Cannot load USB library (/usr/lib64/libusb-1.0.so.0.1.0) :  
/usr/lib64/libusb-1.0.so.0.1.0: undefined symbol: usb_get_string_simple. USB  
search disabled.


There's also a bug in the configure script on 64 bit Fedora. The configure  
script sets systemdsystemshutdowndir to /usr/lib64/systemd/systemd-shutdown  
which misses the mark, a little bit. The fix:


if test -n "${systemdsystemunitdir}"; then
-   systemdsystemshutdowndir="${libdir}/systemd/system-shutdown"
+   systemdsystemshutdowndir="`$PKG_CONFIG --variable=systemdshutdowndir 
systemd`"

This experiment also coincides with the delivery and installation of my new  
Cyberpower CP1500PFCLCD. Slightly hampered by the nut-scanner problem, I  
grabbed the USB ids from lsusb.


It came up without any issues:

[root@monster system]# upsc nutdev1
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 20
battery.mfr.date: CPS
battery.runtime: 1410
battery.runtime.low: 300
battery.type: PbAcid
battery.voltage: 24.0
battery.voltage.nominal: 24
device.mfr: CPS
device.model: CP1500PFCLCD
device.serial: 
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 10
driver.parameter.port: auto
driver.parameter.productid: 0501
driver.parameter.synchronous: no
driver.parameter.vendorid: 0764
driver.version: 2.7.4.1
driver.version.data: CyberPower HID 0.4
driver.version.internal: 0.42
driver.version.usb: libusb-1.0 (API: 0x1000105)
input.transfer.high: 139
input.transfer.low: 88
input.voltage: 121.0
input.voltage.nominal: 120
output.voltage: 137.0
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.delay.start: 30
ups.load: 28
ups.mfr: CPS
ups.model: CP1500PFCLCD
ups.productid: 0501
ups.realpower.nominal: 900
ups.serial: 
ups.status: OL
ups.test.result: No test initiated
ups.timer.shutdown: -60
ups.timer.start: -60
ups.vendorid: 0764



pgpFOxtdAFqMY.pgp
Description: PGP signature
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] Have any FreeBSD users tried the new libusb-1.0 branch?

2017-11-26 Thread Charles Lepple
On Nov 22, 2017, at 7:39 PM, Charles Lepple  wrote:
> 
> The new branch will only attach to the device if I pass the '-u root' flag to 
> usbhid-ups.

fixed: https://github.com/networkupstools/nut/compare/dfd514e...80bc452

still looking for volunteers to test the libusb-1.0 code on FreeBSD and other 
systems.
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


[Nut-upsuser] Have any FreeBSD users tried the new libusb-1.0 branch?

2017-11-22 Thread Charles Lepple
Hi all,

I am doing some final testing of the libusb-1.0 branch (specifically 
https://github.com/zykh/nut.git branch libusb-1.0+0.1 @ dfd514e7), and I am 
running across a regression in usbhid-ups relative to the previous libusb-0.1 
code running on FreeBSD. Basically, the master (2.7.4+; c703fa75) code was able 
to start running as root, drop privileges (usually to uucp, the default for the 
ports tree), and then attach to the USB device. The new branch will only attach 
to the device if I pass the '-u root' flag to usbhid-ups.

So far, I have tested this on FreeBSD 11.0-RELEASE and 11.1-RELEASE. The error 
I get seems to be around where it claims the device.

Are there any FreeBSD users who have dealt with these sorts of USB issues 
before, or are willing to help debug this? At this point, I am not sure if I am 
just seeing weird build issues, and both test machines are kind of slow.

-- 

Thanks,
- Charles Lepple
https://ghz.cc/charles/



___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser