Hi, I've seen a few emails in the archives about problems polling MGE UPSs via USB under FreeBSD, but unfortunately I didn't find a solution in them that works for me. A few details about my setup.. The UPS is a MGE Nova AVR 600 connected via USB to a FreeBSD 6.2 box. I have tried both the nut port (2.0.5) and the svn trunk but have had no success yet. I am running nut as root to exclude the possibility of permission issues. The testing below is done on the trunk version. My ups.conf: [mge-nova] driver=usbhid-ups port=auto desc="MGE Nova 600VA on Bozo" vendorid = 0463 pollinterval = 30 upsd.conf: ACL all 0.0.0.0/0 ACL localhost 127.0.0.1/32 ACCEPT localhost REJECT all MAXAGE 60 usbdevs -vd: Controller /dev/usb0: addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x0000), rev 1.00 uhub0 port 1 addr 2: low speed, power 20 mA, config 1, NOVA AVR(0xffff), MGE UPS SYSTEMS(0x0463), rev 0.01 ugen0 When I start up the usbhid-ups driver manually it seems to be able to communicate with the UPS ok: bin/usbhid-ups -DD -u root -a mge-nova Network UPS Tools: 0.28 USB communication driver 0.28 - core 0.30 (2.1.0) debug level is '2' Checking device (0463/FFFF) (/dev/usb0//dev/ugen0) - VendorID: 0463 - ProductID: ffff - Manufacturer: MGE UPS SYSTEMS - Product: NOVA AVR - Serial Number: unknown - Bus: /dev/usb0 Trying to match device Device matches HID descriptor retrieved (Reportlen = 358) Report descriptor retrieved (Reportlen = 358) Found HID device Report Descriptor size = 358 Detected a UPS: MGE UPS SYSTEMS/NOVA AVR Using subdriver: MGE HID 1.0 Path: UPS.PowerConverter.PowerConverterID, Type: Feature, ReportID: 0x0b, Offset: 0, Size: 8, Value: 1.000000 (I get lots of lines like this with various data form the UPS. The last couple of lines of output are..) upsdrv_updateinfo... dstate_init: sock /var/db/nut/mge-nova open on fd 5 upsdrv_updateinfo... Waiting for notifications... At this point I load up upsd with the following result: ./upsd -DDD -u root Network UPS Tools upsd 2.1.0 /usr/local/ups/etc/upsd.conf is world readable listen_add: added 0.0.0.0:3493 listening on 0.0.0.0 port 3493 Connected to UPS [mge-nova]: mge-nova /usr/local/ups/etc/upsd.users is world readable Pinging UPS [mge-nova] Pinging UPS [mge-nova] sstate_dead: didn't hear from driver for UPS [mge-nova] for 0 seconds Data for UPS [mge-nova] is stale - check driver sstate_dead: didn't hear from driver for UPS [mge-nova] for 0 seconds Pinging UPS [mge-nova] sstate_dead: didn't hear from driver for UPS [mge-nova] for 0 seconds (continues on like this) The window running usbhid-ups does not show any further output while this is occuring. I could use some suggestions on where to go from here. I'm happy to test code, capture debugs, etc, to get these FreeBSD related problems sorted out. Thanks, Rob
On Friday 16 February 2007 13:22, Rob Wise wrote:> I've seen a few emails in the archives about problems polling MGE UPSs > via USB under FreeBSD, but unfortunately I didn't find a solution in > them that works for me.I haven't been able to get it working, I stuck with RS232 :( ...> I could use some suggestions on where to go from here. I'm happy to > test code, capture debugs, etc, to get these FreeBSD related problems > sorted out.I believe it is a bug in the ugen driver or the USB stack but it's really hard to say. You could try the 'usb4bsd' patches. I tried older ones without much success but the author was responsive (I just haven't had time to try the newest patches yet). http://www.turbocat.net/~hselasky/usb4bsd/ -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20070216/7512991e/attachment.pgp
Herman J van der Merwe
2007-Feb-16 07:42 UTC
[Nut-upsuser] MGE Nova AVR 600 USB on FreeBSD
Hi Rob, Please state which version of FreeBSD you are running and if you have a custom kernel. There were some ugen bugs in FreeBSD 6.0 Herman ----- Original Message ----- From: "Rob Wise" <rob@wonk.org> To: <nut-upsuser@lists.alioth.debian.org> Sent: Friday, February 16, 2007 4:52 AM Subject: [Nut-upsuser] MGE Nova AVR 600 USB on FreeBSD> Hi, > > I've seen a few emails in the archives about problems polling MGE UPSs > via USB under FreeBSD, but unfortunately I didn't find a solution in > them that works for me. > > A few details about my setup.. The UPS is a MGE Nova AVR 600 connected > via USB to a FreeBSD 6.2 box. I have tried both the nut port (2.0.5) > and the svn trunk but have had no success yet. I am running nut as > root to exclude the possibility of permission issues. > > The testing below is done on the trunk version. > > My ups.conf: > [mge-nova] > driver=usbhid-ups > port=auto > desc="MGE Nova 600VA on Bozo" > vendorid = 0463 > pollinterval = 30 > > upsd.conf: > ACL all 0.0.0.0/0 > ACL localhost 127.0.0.1/32 > ACCEPT localhost > REJECT all > MAXAGE 60 > > usbdevs -vd: > Controller /dev/usb0: > addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), > Intel(0x0000), rev 1.00 > uhub0 > port 1 addr 2: low speed, power 20 mA, config 1, NOVA AVR(0xffff), > MGE UPS SYSTEMS(0x0463), rev 0.01 > ugen0 > > When I start up the usbhid-ups driver manually it seems to be able to > communicate with the UPS ok: > bin/usbhid-ups -DD -u root -a mge-nova > Network UPS Tools: 0.28 USB communication driver 0.28 - core 0.30 (2.1.0) > > debug level is '2' > Checking device (0463/FFFF) (/dev/usb0//dev/ugen0) > - VendorID: 0463 > - ProductID: ffff > - Manufacturer: MGE UPS SYSTEMS > - Product: NOVA AVR > - Serial Number: unknown > - Bus: /dev/usb0 > Trying to match device > Device matches > HID descriptor retrieved (Reportlen = 358) > Report descriptor retrieved (Reportlen = 358) > Found HID device > Report Descriptor size = 358 > Detected a UPS: MGE UPS SYSTEMS/NOVA AVR > Using subdriver: MGE HID 1.0 > Path: UPS.PowerConverter.PowerConverterID, Type: Feature, ReportID: > 0x0b, Offset: 0, Size: 8, Value: 1.000000 > (I get lots of lines like this with various data form the UPS. The > last couple of lines of output are..) > upsdrv_updateinfo... > dstate_init: sock /var/db/nut/mge-nova open on fd 5 > upsdrv_updateinfo... > Waiting for notifications... > > At this point I load up upsd with the following result: > > ./upsd -DDD -u root > Network UPS Tools upsd 2.1.0 > /usr/local/ups/etc/upsd.conf is world readable > listen_add: added 0.0.0.0:3493 > listening on 0.0.0.0 port 3493 > Connected to UPS [mge-nova]: mge-nova > /usr/local/ups/etc/upsd.users is world readable > Pinging UPS [mge-nova] > Pinging UPS [mge-nova] > sstate_dead: didn't hear from driver for UPS [mge-nova] for 0 seconds > Data for UPS [mge-nova] is stale - check driver > sstate_dead: didn't hear from driver for UPS [mge-nova] for 0 seconds > Pinging UPS [mge-nova] > sstate_dead: didn't hear from driver for UPS [mge-nova] for 0 seconds > (continues on like this) > > The window running usbhid-ups does not show any further output while > this is occuring. > > I could use some suggestions on where to go from here. I'm happy to > test code, capture debugs, etc, to get these FreeBSD related problems > sorted out. > > Thanks, > > Rob > > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser@lists.alioth.debian.org > http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser > > > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.411 / Virus Database: 268.17.39/687 - Release Date: 2/14/2007 > >
> ./upsd -DDD -u root > Network UPS Tools upsd 2.1.0 > /usr/local/ups/etc/upsd.conf is world readableThat is bad, fix it.> listen_add: added 0.0.0.0:3493 > listening on 0.0.0.0 port 3493 > Connected to UPS [mge-nova]: mge-nova > /usr/local/ups/etc/upsd.users is world readableThis is *really* bad, you *must* fix this or risk that people with access to this file shutdown your system. Future versions of NUT may refuse to start when this is found.> Pinging UPS [mge-nova] > Pinging UPS [mge-nova] > sstate_dead: didn't hear from driver for UPS [mge-nova] for 0 secondsOops! For some reason you decided to set MAXAGE to 0 seconds. Please read the appropriate section from 'man 5 upsd.conf' again. Do not set MAXAGE to anything *lower* than the 15 second default.> Data for UPS [mge-nova] is stale - check driver > sstate_dead: didn't hear from driver for UPS [mge-nova] for 0 seconds > Pinging UPS [mge-nova] > sstate_dead: didn't hear from driver for UPS [mge-nova] for 0 seconds > (continues on like this)Sure it will. If you tell the server that the date it receives expires immediately, it will happily report that back to you. What made you think setting MAXAGE to 0 was a good idea?> The window running usbhid-ups does not show any further output while > this is occuring. > > I could use some suggestions on where to go from here. I'm happy to > test code, capture debugs, etc, to get these FreeBSD related problems > sorted out.No need for all this, you just messed up your upsd.conf file... :-) Best regards, Arjen -- Eindhoven - The Netherlands Key fingerprint - 66 4E 03 2C 9D B5 CB 9B 7A FE 7E C1 EE 88 BC 57
> My ups.conf: > [mge-nova] > driver=usbhid-ups > port=auto > desc="MGE Nova 600VA on Bozo" > vendorid = 0463 > pollinterval = 30The latter needs to be 'pollfreq', not 'pollinterval'. I know this is not documented, but trust me on this. Usually pollinterval is only used on serial UPS'es which can't cope with polling every two seconds. The usbhid-ups however uses a different mechanism to reduce the amount of queries to the UPS. Best regards, Arjen -- Eindhoven - The Netherlands Key fingerprint - 66 4E 03 2C 9D B5 CB 9B 7A FE 7E C1 EE 88 BC 57
[adding back nut list ; please, keep it cc'ed] 2007/2/19, Rob Wise <rob@wonk.org>:> Hi Arnaud, > > On 16/02/07, Arnaud Quette <aquette.dev@gmail.com> wrote: > > does the driver block on "Waiting for notifications... " > > or do you see some other identical messages? > > > > if the driver is blocked, then you have (about) the same problem as > > solaris (but they don't have implemented USB interrupts through > > libusb!). > > a call to usb_interrupt_read() (libusb function) block indefinitly the process! > > if this is the case, you can try to extend the workaround: > > - look at configure.in, > > - search for SUN_LIBUSB > > - extend the target_os to include the freebsd system > > - call autoreconf and recompile usbhid-ups > > This has worked! - I am now able to poll data from the UPS:good to hear> root# /usr/local/ups/bin/upsc mge-nova@localhost > battery.charge: 100 > battery.charge.low: 30 > battery.runtime: 1000 > battery.type: PbAc > (etc) > > > then relaunch usbhid-ups in debug and feed us back, > > Note that this is only a temporary fix that disable interrupt handling > > (so the driver only polls the UPS), while waiting for a proper > > solution in freebsd / sun... > > Just to clarify this.. There is a bug with the USB code in FreeBSD > 6.2 causing the driver to block - do you know if anyone has raised a > PR for it?I don't know. @Thierry: any input on this point?> Also your comment "(so the driver only polls the UPS)" - does this > mean the UPS will not be able to notify NUT of a power failure as it > occurs, but we'll pick it up next time NUT polls?exactly. Arnaud -- Linux / Unix Expert - MGE UPS SYSTEMS - R&D Dpt Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/ Debian Developer - http://people.debian.org/~aquette/ OpenSource Developer - http://arnaud.quette.free.fr/