Carlos E. R. wrote:
Hi,
I'm attempting to make use of my new UPS, connecting it via USB to the 'nut' service (nut-classic package), but I'm failing.
It is a Belkin, model BU306000me. According to http://www.networkupstools.org/compat/stable.html I should use the driver megatec_usb, because the vendor id 0665.
See the kernel log:
kernel: usb 3-1: new low speed USB device using uhci_hcd and address 14 kernel: usb 3-1: configuration #1 chosen from 1 choice kernel: hiddev96hidraw0: USB HID v1.00 Device [Cypress Semiconductor USB to Serial] on usb-0000:02:02.1-1 kernel: usb 3-1: New USB device found, idVendor=0665, idProduct=5161 kernel: usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 kernel: usb 3-1: Product: USB to Serial kernel: usb 3-1: Manufacturer: Cypress Semiconductor
So in '/etc/ups/ups.conf' I configured it thus:
[myups] driver = megatec_usb port = /dev/hiddev0 desc = "Local UPS"
When I run "rcupsd start" it fails; it simply says "failed", there is nothing in the logs. But searching this list archive, I found one
Date: Jun 2008 Subject: Re: [opensuse] new ups device, what location
in which it says, amongst other things, that the user 'upsd' should be added to the group 'uucp' - I understand because the the daemon runs as user and needs access to '/dev/hiddev0':
crw-rw-r-- 1 root daemon 180, 96 Nov 18 01:55 /dev/hiddev0
but perhaps it now has to be added to the group "daemon", so that I have added user 'upsd' to both groups. Now I'm getting output in the logs, so I must have done something right.
The script "rcupsd start" takes 45" to finish, and fails:
nimrodel:~ # time rcupsd start Starting NUT UPS drivers failed
real 0m45.113s user 0m0.028s sys 0m0.044s
One of the problems is that the device _disappears_ as soon as the above script starts:
nimrodel:/etc/ups # l /dev/hiddev0 ls: cannot access /dev/hiddev0: No such file or directory
and a minute before it was there. There is an entry in the log:
Nov 18 01:57:35 nimrodel megatec_usb[23363]: Startup successful
but I think it is false, though I'm unsure how to test it. I suppose it should be this:
nimrodel:/etc/ups # upscmd -l myups Error: Connection failure: Connection refused
but it fails. Something is running, though:
23276 ? Ss 0:00 /usr/lib/ups/driver/megatec_usb -a myups
The daemon stop is also problematic, takes 4 seconds but succeeds:
nimrodel:~ # time rcupsd stop Shutting down NUT UPS monitor done Shutting down NUT UPS server done Shutting down NUT UPS drivers.... done
real 0m4.295s user 0m0.104s sys 0m0.128s nimrodel:~ #
and the log shows it:
Nov 18 01:58:58 nimrodel megatec_usb[23363]: Signal 15: exiting
I have also tried using mknod to create the device, to no avail. Of course, it does not disappear, but it does not work.
nimrodel:/etc/ups # mknod /dev/hiddev0 c 180 96 nimrodel:/etc/ups # chmod 0664 /dev/hiddev0 nimrodel:/etc/ups # chown :uucp /dev/hiddev0
What can I do to make it work - if it should work at all?
Carlos, You are getting close. There should be a whole string of e-mails on the list from about 6-8 months ago between Patrick Shanahan and myself concerning nut setup for the usb model cyber power UPS. I have forgotten the details, but the permission on the /dev/hiddev0 were important, and for some reason, if not set up right the node would get deleted, etc.. and you would have to create it again.. The permissions need to be setGID uucp. We finally got it solved. If you can search the archives for usb ups cyber power hiddev0 shanahan, I bet you'll find an answer. It works: http://www.3111skyline.com/nutindex.html For my setup hiddev0 isn't there, I have: [03:09 nirvana/home/david/tmp/ups] # lsusb Bus 002 Device 002: ID 0764:0501 Cyber Power System, Inc. ^^^^^^^ ^^^^^^^^^^^ Bus 002 Device 001: ID 0000:0000 Bus 001 Device 001: ID 0000:0000 [03:09 nirvana/home/david/tmp/ups] # l /dev/bus/usb/002/ ^^^^^^^^ total 0 drwxr-xr-x 2 root root 80 2008-11-06 04:34 ./ drwxr-xr-x 4 root root 80 2008-11-06 04:34 ../ crw-r--r-- 1 root root 189, 128 2008-11-06 04:34 001 crw-rw-r-- 1 root uucp 189, 129 2008-11-18 03:11 002 ^^^^ ^^^ ^^^ ^^^ IIRC, you need to create the node for the "Bus" and "Device" After creating the node about 5 times until I figured it out, I ended up with this config: hosts.conf: MONITOR nirvana_ups@localhost "Local UPS" ups.conf: [nirvana_ups] driver = usbhid-ups explore vendor="CPS" desc = "Nirvana UPS - Cyberpower 1000" port = /dev/hiddev0 upsd.conf: ACL all 0.0.0.0/0 ACL localhost 127.0.0.1/32 ACL nirvana 127.0.0.2/32 ACCEPT localhost REJECT all upsd.users: [upsmaster] password = putPasswordHere allowfrom = localhost upsmon master [upsslave] password = putPasswordHere allowfrom = localhost upsmon slave [david] password = putPasswordHere allowfrom = localhost nirvana skyline rbpllc actions = SET instcmds = ALL upsmon.conf: MONITOR nirvana_ups@localhost 1 upsmaster putPasswordHere master MINSUPPLIES 1 SHUTDOWNCMD "/sbin/shutdown -h +0" NOTIFYCMD /usr/lib/powersave/powersave-notify POLLFREQ 5 POLLFREQALERT 5 HOSTSYNC 15 DEADTIME 15 POWERDOWNFLAG /etc/killpower NOTIFYFLAG ONLINE SYSLOG NOTIFYFLAG COMMOK SYSLOG NOTIFYFLAG SHUTDOWN SYSLOG NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC NOTIFYFLAG LOWBATT SYSLOG+WALL+EXEC NOTIFYFLAG FSD SYSLOG+WALL+EXEC NOTIFYFLAG NOCOMM SYSLOG+WALL+EXEC NOTIFYFLAG COMMBAD SYSLOG+WALL+EXEC RBWARNTIME 43200 NOCOMMWARNTIME 300 FINALDELAY 5 upssched.conf: CMDSCRIPT /usr/local/ups/bin/upssched-cmd upsset.conf: I_HAVE_SECURED_MY_CGI_DIRECTORY Good Luck -- David C. Rankin, J.D.,P.E. | Rankin Law Firm, PLLC | Countdown for openSuSE 11.1 510 Ochiltree Street | http://counter.opensuse.org/11.1/small Nacogdoches, Texas 75961 | Telephone: (936) 715-9333 | openSoftware und SystemEntwicklung Facsimile: (936) 715-9339 | http://www.opensuse.org/ www.rankinlawfirm.com | -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org