[Nut-upsuser] trying to use powerware 3110 USB with NUT

John H. mistamaila at gmail.com
Wed Oct 5 22:09:09 UTC 2005


 ./usbups
[root at home usb]# cat /tmp/usb.log
usbups: device =
[root at home usb]# cat /tmp/usb.log
usbups: device =
[root at home usb]# cat /tmp/usb.log
usbups: device =




On 10/5/05, John H. <mistamaila at gmail.com> wrote:
> this is what i have now
>
>  cat usbups
> #!/bin/bash
> # Implementation by Wolfgang Ocker
> #
> # /etc/hotplug/usb/usbups
> #
> # Sets up newly plugged in USB USP
> #
> # In the usermap file, the first field "usb module" should be named
> # "usbups" like this script.
> #
> echo usbups: device = $DEVICE >>/tmp/usb.log
>
> NUTOWNER=nut
>
> if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
> then
> chmod 0000 "${DEVICE}"
> chown "$NUTOWNER" "${DEVICE}"
> chmod 0644 "${DEVICE}"
> fi
>
>
> cat usbups.usermap
>
>
> # usb module match_flags idVendor idProduct bcdDevice_lo
> bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol
> bInterfaceClass bInterfaceSubClass bInterfaceProtocol driver_info
> # Powerware USB
> usbups 0x0003 0x06da 0x0002 0 0 0 0 0x00 0x00 0x00 0x00 0x00000000
>
>
> from libhid.usermap
>
> # Powerware USB
> libhidups      0x0003      0x06da   0x0002    0x0000       0x0000
>  0x00      0x00            0x00            0x00            0x00
>        0x00            0x00000000
>
>
> from /proc/bus/usb/devices
>
> T:  Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=1.5 MxCh= 0
> D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
> P:  Vendor=06da ProdID=0002 Rev= 0.01
> S:  Manufacturer=POWERWARE
> S:  Product=Powerware UPS
> C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr= 20mA
> I:  If#= 0 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
> E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=20ms
>
>
> On 10/5/05, Kjell Claesson <kjell.claesson at telia.com> wrote:
> > Ok.
> >
> > We have to look at the 'device'. The problem is that
> > this type of drivers don't use any ordinary /dev entry.
> >
> > As i understand you have the /etc/hotplug/usb/libhidups
> > script in the right place and chmod +x.
> >
> > And your /etc/hotplug/libhid/usermap is setup with
> > your vendor and product id.
> >
> > One thing, if you use the script from 2.1.0 it reads:
> >
> > if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then
> >   chown root:nobody "$DEVICE"
> >   chmod 0660 "$DEVICE"
> > fi
> >
> > So it sets the device to be owned by root and group nobody.
> > Change the line
> >   chown root:nobody "$DEVICE"
> > to
> >   chown root:nut "$DEVICE"
> >
> > If you run it as user nut.
> >
> > I use Wolfgangs script.
> >
> > --------------------------------
> > echo usbups: device = $DEVICE >>/tmp/usb.log
> >
> > NUTOWNER=nut
> >
> > if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
> > then
> >     chmod 0000 "${DEVICE}"
> >     chown "$NUTOWNER" "${DEVICE}"
> >     chmod 0644 "${DEVICE}"
> > fi
> > --------------------------------------------
> >
> > This has the advantage that i can check the
> > /tmp/ups.log for the device.
> >
> > cat /tmp/usb.log
> > usbups: device = /proc/bus/usb/002/002
> > usbups: device = /proc/bus/usb/002/002
> > usbups: device = /proc/bus/usb/001/002
> > usbups: device = /proc/bus/usb/001/002
> > usbups: device = /proc/bus/usb/001/002
> >
> > Then i can check the 'device'
> >
> > ls -al /proc/bus/usb/001/002
> > -rw-r--r--  1 nut usb 52  6 okt 00.01 /proc/bus/usb/001/002
> >
> > That it has the right owner and that it exists after plugging in the ups.
> >
> > Kjell
> >
> >
> >
> > ons 2005-10-05 klockan 16:42 -0500 skrev John H.:
> > >  bcmxcp_usb -DD -a PW3 -u nut
> > > Network UPS Tools - BCMXCP UPS driver 0.09 (2.1.0)
> > >
> > > debug level is '2'
> > > Can't open POWERWARE USB device, retrying ...
> > > Can't open POWERWARE USB device, retrying ...
> > > Can't open POWERWARE USB device, retrying ...
> > > Can't open POWERWARE USB device, retrying ...
> > >
> > >
> > > On 10/5/05, Kjell Claesson <kjell.claesson at telia.com> wrote:
> > > > Hi
> > > >
> > > > Start it like
> > > >
> > > > /usr/local/ups/bcmxcp_usb -DD -a PW3 -u nut
> > > >
> > > > Or enter
> > > >
> > > > user = nut in the ups.conf.
> > > >
> > > > Not inside the [PW3]
> > > >
> > > > Like this
> > > >
> > > > user = nut
> > > >
> > > > [PW3]
> > > >         driver = bcmxcp_usb
> > > >         port = auto
> > > >         shutdown_delay = 60
> > > >         desc = "My pc"
> > > >
> > > > Kjell
> > > >
> > > > ons 2005-10-05 klockan 16:22 -0500 skrev John H.:
> > > > >  ls -la
> > > > > total 20K
> > > > > drwxr-xr-x   4 root root 4.0K Oct  5 16:21 .
> > > > > drwxr-xr-x  29 root root 4.0K Sep 10 12:31 ..
> > > > > drwxr-xr-x   3 root root 4.0K Jul 28 16:28 apt
> > > > > drwxrwx---   2 nut  nut  4.0K Oct  5 16:21 ups
> > > > >
> > > > >
> > > > > but still
> > > > >
> > > > >  bcmxcp_usb -DD -a PW3
> > > > > Network UPS Tools - BCMXCP UPS driver 0.09 (2.1.0)
> > > > >
> > > > > debug level is '2'
> > > > > Can't chdir to /var/state/ups: Permission denied
> > > > >
> > > > > as su root.
> > > > >
> > > > > On 10/5/05, Kjell Claesson <kjell.claesson at telia.com> wrote:
> > > > > > Hi John.
> > > > > >
> > > > > > Yep, you need the /var/state/ups directory. And it
> > > > > > must be accessible by the user you run the NUT as.
> > > > > >
> > > > > > This is how it look's on my side.
> > > > > > ls -al /var/state/
> > > > > > totalt 0
> > > > > > drwxr-xr-x   3 root root  96  9 sep  2004 .
> > > > > > drwxr-xr-x  15 root root 408  1 maj 21.08 ..
> > > > > > -rw-r--r--   1 root root   0  8 sep 22.12 .keep
> > > > > > drwxrwx---   2 nut  nut  144  5 okt 18.09 ups
> > > > > >
> > > > > > This directory holds the socket to communicate at
> > > > > > and some pid files.
> > > > > >
> > > > > > ls -al /var/state/ups/
> > > > > > totalt 8
> > > > > > drwxrwx---  2 nut  nut  144  5 okt 18.09 .
> > > > > > drwxr-xr-x  3 root root  96  9 sep  2004 ..
> > > > > > srw-rw----  1 nut  nut    0  5 okt 18.07 bcmxcp_usb-auto
> > > > > > -rw-r--r--  1 nut  nut    5  5 okt 18.07 bcmxcp_usb-auto.pid
> > > > > > -rw-r--r--  1 nut  nut    5  5 okt 18.09 upsd.pid
> > > > > >
> > > > > > Create this directory, then try.
> > > > > >
> > > > > > /usr/local/ups/bin/bcmxcp_usb -DD -a PW3
> > > > > >
> > > > > > If your ups.conf holds the.
> > > > > >
> > > > > > [PW3]
> > > > > >         driver = bcmxcp_usb
> > > > > >         port = auto
> > > > > >         shutdown_delay = 60
> > > > > >         desc = "My pc"
> > > > > >
> > > > > > kjell
> > > > > >
> > > > > >
> > > > > > ons 2005-10-05 klockan 15:36 -0500 skrev John H.:
> > > > > > >  bcmxcp_usb -DDDDD -a PW3
> > > > > > > Network UPS Tools - BCMXCP UPS driver 0.09 (2.1.0)
> > > > > > >
> > > > > > > debug level is '5'
> > > > > > > Can't chdir to /var/state/ups: No such file or directory
> > > > > > >
> > > > > > >
> > > > > > > Did I miss something?  what do I put for your_ups, which is device?  I
> > > > > > > have auto specfied in ups.conf
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On 10/5/05, Arnaud Quette <aquette.dev at gmail.com> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > > 2005/10/5, John H. <mistamaila at gmail.com>:
> > > > > > > > > ls -la libhidups
> > > > > > > > > -rwxr-xr-x  1 root root 481 Sep 29 08:05 libhidups
> > > > > > > >
> > > > > > > >  ok, so stop every pieces of NUT, and try to start the driver manually, and
> > > > > > > > in debug mode (ie bcmxcp_usb -DDDDD -a your-ups) after having set the env.
> > > > > > > > var USB_DEBUG to 3 (ie export USB_DEBUG=3).
> > > > > > > >
> > > > > > > >  Then send back this output.
> > > > > > > >
> > > > > > > >  The underlying problem might be a device disconnexion due to EMI. But the
> > > > > > > > reconnexion might fail for some reason. If you see anything that can be
> > > > > > > > interesting in your log (ie some failure of hotplug...), send it also back.
> > > > > > > >
> > > > > > > >  Arnaud
> > > > > > > >
> > > > > > >
> > > > > > > _______________________________________________
> > > > > > > Nut-upsuser mailing list
> > > > > > > Nut-upsuser at lists.alioth.debian.org
> > > > > > > http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser
> > > > > >
> > > > > >
> > > >
> > > >
> > > > _______________________________________________
> > > > Nut-upsuser mailing list
> > > > Nut-upsuser at lists.alioth.debian.org
> > > > http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser
> > > >
> > >
> > > _______________________________________________
> > > Nut-upsuser mailing list
> > > Nut-upsuser at lists.alioth.debian.org
> > > http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser
> >
> >
>



More information about the Nut-upsuser mailing list