To use apcupsd on Asus WL500gPwith kamikaze kernel 2.4 & APC Back-UPS CS 650 usb cable:
(sorry for my english...)
1.
I've flashed this firmware http://downloads.x-wrt.org/xwrt/kamikaz … uashfs.trx
(snapshot from 26 june 2008 )
Configure your router for networking,ssh,usb,mc , etc.
2.
download from this page http://www.dd-wrt.com/phpBB2/viewtopic.php?t=33079
hid-linux-2.4.35-mips.tar.gz
it contains a precompiled module hid.o.
copy hid.o to /lib/modules/2.4.35.4/
3.
create a file to load the module:
#echo hid >/etc/modules.d/60-usb-hid
4.
install optware
* See http://forum.openwrt.org/viewtopic.php?id=15286
5.
#ipkg-opt update
#mkdir -p /opt/var/lock
#ipkg-opt install apcupsd
6.
without rebooting You should see something like this:
#insmod hid
Warning: loading hid will taint the kernel: no license
See http://www.tux.org/lkml/#export-tainted for information about tainted modules
#dmesg
...
usb.c: registered new driver hiddev
usb.c: registered new driver hid
hiddev0: USB HID v1.10 Device [American Power Conversion Back-UPS CS 650 FW:817.v2.I USB FW:v2] on usb4:5.0
hid-core.c: v1.8.1 Andreas Gal, Vojtech Pavlik <vojtech@suse.cz>
hid-core.c: USB HID support drivers
# lsusb
Bus 004 Device 001: ID 0000:0000
Bus 004 Device 002: ID 0409:0056 NEC Corp.
Bus 004 Device 003: ID 04b4:6560 Cypress Semiconductor Corp. CY7C65640 USB-2.0 "TetraHub"
Bus 004 Device 004: ID 0b05:1715 ASUSTek Computer, Inc.
Bus 004 Device 005: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 004 Device 006: ID 0557:2006 ATEN International Co., Ltd UC-1284B Printer Port
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
# cat /proc/bus/usb/devices |grep ^[SI]
...
S: Manufacturer=American Power Conversion
S: Product=Back-UPS CS 650 FW:817.v2.I USB FW:v2
S: SerialNumber=QB0445137434
I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=hid
...
Without driver installed last line would show something like this:
I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=(none)
7.
configure apcupsd for usb(defaults are for serial smart-ups)
#mcedit /opt/etc/apcupsd/apcupsd.conf
a. give it a name :
ex. UPSNAME apc
b. set ups cable type:
ex. UPSCABLE usb
c. define ups type:
ex. UPSTYPE usb
d. comment DEVICE=/dev/ttyS0
ex. #DEVICE=/dev/ttyS0
Those are minimum needed.
8.
Test
#apctest
2008-06-27 11:23:46 apctest 3.14.4 (18 May 2008) unknown
Checking configuration ...
Attached to driver: usb
sharenet.type = DISABLE
cable.type = USB_CABLE
You are using a USB cable type, so I'm entering USB test mode
mode.type = USB_UPS
Setting up the port ...
Hello, this is the apcupsd Cable Test program.
This part of apctest is for testing USB UPSes.
Getting UPS capabilities...SUCCESS
Please select the function you want to perform.
1) Test kill UPS power
2) Perform self-test
3) Read last self-test result
4) Change battery date
5) View battery date
6) View manufacturing date
7) Set alarm behavior
8) Set sensitivity
9) Set low transfer voltage
10) Set high transfer voltage
11) Quit
Select function number:
9.
Remove apctest.output created in working directory.
10.
Reboot
11.
yet to be done :
-persuade developers to add kmod-usb-hid & apcupsd (or nut http://www.networkupstools.org/ eventually,or both) to kamikaze
-configure router to shutdown gracefully when power events occurs.
-configure apcupsd to shutdown over network my desktop pc if it is on
and turn it back on(wol) when power comes back.