LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 10-16-2010, 02:33 PM   #1
camorri
LQ Veteran
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1, 14.2, current, slackware-arm-currnet
Posts: 5,437

Rep: Reputation: 621Reputation: 621Reputation: 621Reputation: 621Reputation: 621Reputation: 621
Getting APCUPSD to talk to an APC ES 750


I can not get my new APC Back-UPS ES 750 to talk to Mandriva 10.1 over the supplied usb cable.

uname -a reports -

Quote:
uname -a
Linux duelie 2.6.33.7-desktop-2mnb #1 SMP Mon Sep 20 18:19:20 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
When I hot plug the sub cable into my Mandriva system, I get the following from dmesg.

Quote:
usb 1-6: new low speed USB device using ohci_hcd and address 3
usb 1-6: device not accepting address 3, error -71
usb 1-6: new low speed USB device using ohci_hcd and address 4
usb 1-6: device descriptor read/all, error -71
usb 1-6: new low speed USB device using ohci_hcd and address 5
usb 1-6: device descriptor read/8, error -71
usb 1-6: device descriptor read/8, error -71
usb 1-6: new low speed USB device using ohci_hcd and address 6
usb 1-6: device descriptor read/8, error -71
usb 1-6: device descriptor read/8, error -71
hub 1-0:1.0: unable to enumerate USB device on port 6
lsusb never shows the device. I know the UPS supply is working, I can plug it into my netbook running Ubuntu 10.1 and the USB device shows up with lsusb.

I did some research and found a package to support APC-UPS. Here is what is installed on my 64 bit system.

Quote:
Version: 3.14.8-1mdv2010.1
Currently installed version: 3.14.8-1mdv2010.1
Group: System/Servers
Architecture: x86_64
I followed the instructions with this package. It had me modprobe the hid and usbhid modules. They load without problems. The doc also has you create device nodes in /dev/usb/hid/ in fact there is an example script I ran to do the work. It worked and created the nodes. I discovered Mandriva deleted the manually created nodes after a cold boot. I have no idea how to prevent that. I can re-create them, Mandriva will wipe them out on the next boot.

From the doc supplied, I appear to have all the correct drivers loaded.
Here is what the doc calls for for a 2.6 kernel.
Quote:
...or perhaps something like:

total 0
drwxr-xr-x 2 root root 0 Jan 6 15:27 hiddev
drwxr-xr-x 2 root root 0 Jan 6 15:28 hub
drwxr-xr-x 2 root root 0 Jan 6 15:28 usb
drwxr-xr-x 2 root root 0 Jan 6 15:27 usbfs
drwxr-xr-x 2 root root 0 Jan 6 15:28 usbhid
and what I have installed...

Quote:
ls -l /sys/bus/usb/drivers/
total 0
drwxr-xr-x 2 root root 0 2010-10-16 14:22 hiddev/
drwxr-xr-x 2 root root 0 2010-10-16 14:22 hub/
drwxr-xr-x 2 root root 0 2010-10-16 14:22 usb/
drwxr-xr-x 2 root root 0 2010-10-16 14:22 usbfs/
drwxr-xr-x 2 root root 0 2010-10-16 14:22 usbhid/
Now, here is the kicker... from the install instructions a direct copy and paste...

Quote:
What complicates the situation much more on Mandrake kernels is their security level since CONFIG_DYNAMIC_USB_MINORS is turned on, but on higher security levels devfs is turned off. The net result, is that in those situations hiddev is completely unusable so apcupsd will not work. So, in these cases, the choices are:

1. Reduce the security level setting of the system (not sure if this is possible after the initial install).
2. Custom build a high security kernel with devfs enabled and make sure devfs is mounted and devfsd is running.
3. Custom build a high security kernel with dynamic minors disabled
4. Use udev
This has to do with the device being recognized by Mandrake. I have security set to 'Standard'. There doesn't appear to be a lower setting. Not sure I want one either. However, since the system will not 'see' the device on the usb connection, what do I do now?

I don't have a clew on building a kernel. Use udev? How?

BTW, the usb ports seem to work just fine for the other usb devices I have. The ups is seen by Ubuntu, so I know the cable should not be the problem, or the code on the UPS, since it works with Ubuntu.

Has anyone got a APC UPS working with Mandriva? If so, how?

BTW, I saw some threads with similar hot plugging issues, and one solution was to use modprobe to unload the ehci_hcd driver and use only ohci_hcd. Of course this means you run all devices at the slower 1.0 usb speed. On some systems this got around a problem. On this bug it made no difference.

Last edited by camorri; 10-16-2010 at 02:36 PM.
 
Old 10-18-2010, 02:26 PM   #2
ernie
Senior Member
 
Registered: Nov 2001
Location: Toledo, Ohio - USA
Distribution: Mageia 1
Posts: 1,079
Blog Entries: 4

Rep: Reputation: 70
Have you used MCC to set up your UPS? I do not use a UPS here, but MCC has an applet (icon) named "Set up a UPS for power monitoring" in the hardware category.

1. Open MCC (Tools > System Tools > Configure your computer in the menu system)

2. Select Hardware in the category list at the left.

3. Open the Set up a UPS for power monitoring icon in the main pane.

Follow the prompts from there.

HTH,
 
Old 10-18-2010, 02:44 PM   #3
camorri
LQ Veteran
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1, 14.2, current, slackware-arm-currnet
Posts: 5,437

Original Poster
Rep: Reputation: 621Reputation: 621Reputation: 621Reputation: 621Reputation: 621Reputation: 621
ernie,

Yes, that was the first thing I tried. It fails because the system is not seeing the device on the usb bus. I have not been able to find out what error 71 is for the usb, yet. (First set of error messages I posted.)

The interesting thing I found out is this function uses NUT to try and talk to the device. I have that working now on my netbook running Ubuntu 10.1. So, at this point I know the UPS is O.K. The last quote I posted basically says Mandrake will not work with this type of USB device using hiddev. Then it lists my choices. I was hoping someone who knows Mandriva very well could give me some idea of how to use udev. I sure don't want to build a custom kernel to get it working. If it comes to that, I will install a distro known to run hiddev.
 
Old 10-19-2010, 01:25 AM   #4
ernie
Senior Member
 
Registered: Nov 2001
Location: Toledo, Ohio - USA
Distribution: Mageia 1
Posts: 1,079
Blog Entries: 4

Rep: Reputation: 70
You can try adding the modules to /etc/modprobe.preload which should ensure that they are loaded at boot time, then add the commands that create the device nodes you need to the end of /etc/profile. Better yet, to avoid typos, copy the script you used to create the device nodes to /bin, or /usr/bin, then call the script from /etc/profile. To call the script, (assuming the script name is installUPSdeviceNodes, and you copied it to /usr/bin) add the full path name to the end of /etc/profile (/usr/bin/installUPSdeviceNodes). See if that works.

The file /etc/modprobe.preload does just what its name indicates, it is used to list (one module per line) the modules that should be loaded at boot time.

I do not currently have to use /etc/modprobe.preload to load any modules here, but I have had to do so in the past (with earlier releases of Mandriva).

What follows is the comment text found in the default file:
Quote:
# /etc/modprobe.preload: kernel modules to load at boot time.
#
# This file should contain the names of kernel modules that are
# to be loaded at boot time, one per line. Comments begin with
# a `#', and everything on the line after them are ignored.
# this file is for module-init-tools (kernel 2.5 and above) ONLY
# for old kernel use /etc/modules
/etc/profile is read by bash at boot time, and any commands in it are run as root. I assume that you had to run the commands (or script) as root to create the device nodes in the first place.

HTH,

Last edited by ernie; 10-19-2010 at 01:29 AM. Reason: Clarity
 
Old 10-19-2010, 09:24 AM   #5
camorri
LQ Veteran
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1, 14.2, current, slackware-arm-currnet
Posts: 5,437

Original Poster
Rep: Reputation: 621Reputation: 621Reputation: 621Reputation: 621Reputation: 621Reputation: 621
Thank-you for the reply. I will give it a try that way, and see what happens. I'll post back.
 
Old 10-19-2010, 02:45 PM   #6
camorri
LQ Veteran
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1, 14.2, current, slackware-arm-currnet
Posts: 5,437

Original Poster
Rep: Reputation: 621Reputation: 621Reputation: 621Reputation: 621Reputation: 621Reputation: 621
Some progress. I now have the needed modules loading a boot time. ( At least I think I have them all loaded ). I edited /etc/modprobe.preload and added hid, usbhid and hidusb-ups. No errors, and the modules show up with lsmod.

I can not get the shell script to add the nodes however, be editing /etc/profile. I tried calling the script, that failed, then I put the command into the file. Either way, after boot, /dev/usb/hid/ does not exist. If I run the command as root, ie 'sh make-hiddev' it works.

For the record, here is the contents of the file.

Quote:
cat /usr/local/nut/make-hiddev
#!/bin/sh
mkdir -p /dev/usb/hid
mknod /dev/usb/hid/hiddev0 c 180 96
mknod /dev/usb/hid/hiddev1 c 180 97
mknod /dev/usb/hid/hiddev2 c 180 98
mknod /dev/usb/hid/hiddev3 c 180 99
mknod /dev/usb/hid/hiddev4 c 180 100
mknod /dev/usb/hid/hiddev5 c 180 101
mknod /dev/usb/hid/hiddev6 c 180 102
mknod /dev/usb/hid/hiddev7 c 180 103
mknod /dev/usb/hid/hiddev8 c 180 104
mknod /dev/usb/hid/hiddev9 c 180 105
mknod /dev/usb/hid/hiddev10 c 180 106
mknod /dev/usb/hid/hiddev11 c 180 107
mknod /dev/usb/hid/hiddev12 c 180 108
mknod /dev/usb/hid/hiddev13 c 180 109
mknod /dev/usb/hid/hiddev14 c 180 110
mknod /dev/usb/hid/hiddev15 c 180 111
and the permissions,

Quote:
ll /usr/local/nut/make-hiddev
-rwxr--r-- 1 root root 626 2010-10-19 14:00 /usr/local/nut/make-hiddev*
The ups is not seen on the usb bus.
 
Old 10-19-2010, 11:13 PM   #7
ernie
Senior Member
 
Registered: Nov 2001
Location: Toledo, Ohio - USA
Distribution: Mageia 1
Posts: 1,079
Blog Entries: 4

Rep: Reputation: 70
OK, I goofed. /etc/profile is not the place to call your script. I did a small experiment. I put commands in /etc/profile to create a test file in my $HOME directory with the value contained in $UID (root = 0), and I got back a my user uid (10001). It has been too long since I did any shell scripting . . .

Try adding the call to the script in /etc/rc.local. Remember to use the full path name as described in post # 4 of this thread.

HTH,
 
Old 10-20-2010, 03:01 PM   #8
camorri
LQ Veteran
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1, 14.2, current, slackware-arm-currnet
Posts: 5,437

Original Poster
Rep: Reputation: 621Reputation: 621Reputation: 621Reputation: 621Reputation: 621Reputation: 621
Well, progress is slow. I got the script to work when I boot the system. That is the good news. The bad news is the ups still does not show up when I do a lsusb. dmesg shows errors as before.

So, at this point I have the NUT utilities installed and configure. They are running, I get a message that the UPS is not available.

I'm going to do some more scratching around to see if I can figure out why the UPS shows up on Ubuntu and not Mandrake.
 
Old 10-20-2010, 09:35 PM   #9
mecelec415
Member
 
Registered: Jan 2008
Location: Noble Park ,Victoria, Australia
Distribution: Mageia
Posts: 183
Blog Entries: 2

Rep: Reputation: 23
have you played with usb speed settings in the bios changing them to max resolved a usb detection issue i had with a card reader a while ago.
 
Old 10-21-2010, 09:24 AM   #10
camorri
LQ Veteran
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1, 14.2, current, slackware-arm-currnet
Posts: 5,437

Original Poster
Rep: Reputation: 621Reputation: 621Reputation: 621Reputation: 621Reputation: 621Reputation: 621
Quote:
have you played with usb speed settings in the bios
I have been in the BIOS, I did not see any speed settings. As far as I know, speed is controlled by the usb driver the device connects to. These are the drivers loaded, after a clean boot.

Quote:
lsmod | grep usb
usbhid 49577 0
hid 81757 1 usbhid
usbcore 210196 4 usbhid,ohci_hcd,ehci_hcd
Ohci is the low speed and ehci is the high speed. I'll have another look, however not sure it will help.

I had another look at the BIOS settings. I do not see any speed settings for USB. For the record, the system board is a Gigabyte GA-M61SME-S2 and the BIOS level is F4.

Last edited by camorri; 10-21-2010 at 09:48 AM. Reason: Adding info
 
Old 11-05-2010, 07:49 PM   #11
camorri
LQ Veteran
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1, 14.2, current, slackware-arm-currnet
Posts: 5,437

Original Poster
Rep: Reputation: 621Reputation: 621Reputation: 621Reputation: 621Reputation: 621Reputation: 621
An update. I have installed the latest BIOS for my Gigabyte system board. It is now at level F10a. There is no change in the problem. The UPS is still not detected by Mandriva.

I'm looking into configuring my own kernel. This is a learning process, I have never created my own kernel.

I compiled the kernel without CONFIG_USB_DYNAMIC_MINORS and it made no difference. I still do not see the device with lsusb.

Last edited by camorri; 11-15-2010 at 04:36 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
APC Smart-UPS and apcupsd michaelsr Linux - Software 4 06-24-2014 07:49 AM
use apcupsd or power chute with APC SURT1000 in suse 10.2 ? b-RAM Linux - Software 3 04-27-2010 09:43 PM
APC UPS - apcupsd on Ubuntu 8.04 not sending emails bob808 Linux - Software 1 04-24-2009 01:08 PM
talk talk daemon configuration ananthkrk Red Hat 1 10-16-2004 12:45 PM
why cannot "talk" to others,since mesg is yes and disable = no(in /etc/xinetd.c/talk) whepin Linux - Newbie 0 12-31-2001 03:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 09:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration