Alright, here's how I did. It works fine on my Asus WL-500gP with DD-WRT v24-sp2 Big (SVN revision 13401M NEWD Eko).
1. installed Optware on a 512MB USB stick according to this guide (see this topic also)
2. enabled USB 1.1 Support (UHCI) in the web interface (Services > USB > USB 1.1 Support UHCI = enable). Router rebooted. (You may have to enable OHCI instead, if the next steps fail, it really depends on your router hardware which is the right option)
3. issued the following command via telnet/ssh:
Code:
cat /proc/bus/usb/devices
it should output many things, but what's interesting is:
only.
Get the HID driver from here, unpack hid-linux-2.4.35-mips.tar.gz to /opt/lib/modules/hid.o and install it with the following command:
Code:
insmod -f /opt/lib/modules/hid.o
(note the -f switch, the kernel on the router is 2.4.37, while the driver was compiled for 2.4.35, however with -f it installs and works fine, despite some warnings at installation)
After this cat /proc/bus/usb/devices will display this, among others:
4. Installed the latest apcupsd from optware repository with the command:
Code:
ipkg install apcupsd
5. Configured these values inside /opt/etc/apcupsd/apcupsd.conf:
Quote:
UPSNAME Router
UPSCABLE usb
UPSTYPE usb
DEVICE
(note the DEVICE line should be empty, just DEVICE and a space character, other default values are fine)
7. Created a /lock folder in /opt/var (to have /opt/var/lock for the lockfile)
8. Tests according the manual:
- command apctest displays a test menu for the UPS
- command apcaccess status displays UPS parameters
All the tests described in the manual should work.
After this, all you have to do is customize apcupsd to your needs (startup/shutdown actions, notifications, monitoring graph by munin, etc). Follow apcupsd manual for further details.
Good luck!
Last edited by robertut on Sat Feb 06, 2010 22:18; edited 4 times in total
To enable apcupsd at startup, I made an Optware service called "apcupsd", for the application apcupsd.
I made a file called S96apcupsd in /opt/etc/init.d with the following content.
The script loads the hid driver before running apcupsd, and unloads it after stopping it. Not the most proffessional way, but it works. It seems enough.
Please keep us updated on possible HID driver modules for different kernel versions. I'd love to see a proper module compiled for 2.4.37 and 2.6. Maybe someone could help us in this matter, who has developer environment installed?
I think everything is setup, do i need anything more then apcupsd and the modules installed?
Try using ipkg-opt's version of apcupsd, the binary worked for me.
I am also trying to setup it in K2.6 and apparently the HID module needs to be recompiled with the CONFIG_USB_HIDDEV option on, else you will step in some error like this:
Code:
root@snowball:/opt/etc/apcupsd# apctest
2011-03-04 01:46:48 apctest 3.14.8 (16 January 2010) 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 ...
apctest FATAL ERROR in linux-usb.c at line 609
Cannot find UPS device --
For a link to detailed USB trouble shooting information,
please see <http://www.apcupsd.com/support.html>.
apctest error termination completed
I am trying to rebuild it from the keychain using those instructions:
emerzon got it right. had the kernel options wrong. included the right options and recompiled and now apctest sees the ups.
thanks, emerzon.
ive attached the properly configured kernel modules
Thanks a lot billyburly! I wasn't able to compile the modules on my own
I used your modules and now I can see the device appearing in dmesg:
Code:
hiddev96: USB HID v1.10 Device [American Power Conversion Back-UPS RS 1500 LCD FW:839.H7 .D USB FW:H7 ] on usb-0000:00:02.0-1
However, apctest still doesn't see it:
Quote:
2011-04-10 00:19:01 apctest 3.14.8 (16 January 2010) 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 ...
apctest FATAL ERROR in linux-usb.c at line 609
Cannot find UPS device --
For a link to detailed USB trouble shooting information,
please see <http://www.apcupsd.com/support.html>.
apctest error termination completed
I'm getting close on this as well, but am missing something. After following the suggestions here on getting this working on k26, I am realizing that "ls -l /sys/bus/usb/drivers/" does not show HID drivers. (per apcupsd.com) I installed the HID.zip mentioned previously, but am clearly missing something.
EDIT:
I got it going. I'm not exactly sure what was tripping me up. I did chmod 777 all the *.ko files, but I'm not sure that is related. Anyways, here are the commands I run to get an HID driver loaded for my UPC UPS:
Afterwards, I can confirm the driver loads with 'cat /proc/bus/usb/devices'. apctest works too (after configuring it's conf file)!!! Happy camper here... Thanks guys!