LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 10-30-2008, 02:48 PM   #1
userlander
Member
 
Registered: Jul 2008
Distribution: Arch, Debian
Posts: 61

Rep: Reputation: 18
Can't get Debian to Recognize APC UPS through USB


I have an APC UPS, model ES550, connected to my server with the supplied USB cable, but it's not recognized for some reason. This server is debian testing, and the kernel is 2.6.24.4. When it didn't work, I rebuilt the kernel a few times to make sure I had all the USB support I needed, and now I have most of the USB stuff built in because it seemed like some HID things weren't loading before.

I seem to have USB support now, though:

Code:
# ls -l /sys/bus/usb/drivers
total 0
drwxr-xr-x 2 root root 0 2008-10-30 15:19 hiddev
drwxr-xr-x 2 root root 0 2008-10-30 15:19 hub
drwxr-xr-x 2 root root 0 2008-10-30 15:34 libusual
drwxr-xr-x 2 root root 0 2008-10-30 15:38 usb
drwxr-xr-x 2 root root 0 2008-10-30 15:19 usbfs
drwxr-xr-x 2 root root 0 2008-10-30 15:19 usbhid
drwxr-xr-x 2 root root 0 2008-10-30 15:39 usb-storage
the one driver that's still a module is loading:

Code:
# lsmod
Module                  Size  Used by
uhci_hcd               30224  0
and in dmesg:

Code:
# dmesg |grep -i usb
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
usbmon: debugfs is not available
usbcore: registered new interface driver libusual
usbcore: registered new interface driver hiddev
usbcore: registered new interface driver usbhid
drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver
USB Universal Host Controller Interface driver v3.0
drivers/usb/core/inode.c: creating file 'devices'
drivers/usb/core/inode.c: creating file '001'
uhci_hcd 0000:00:11.2: new USB bus registered, assigned bus number 1
usb usb1: default language 0x0409
usb usb1: uevent
usb usb1: usb_probe_device
usb usb1: configuration #1 chosen from 1 choice
usb usb1: adding 1-0:1.0 (config #1, interface 0)
usb 1-0:1.0: uevent
hub 1-0:1.0: usb_probe_interface
hub 1-0:1.0: usb_probe_interface - got id
hub 1-0:1.0: USB hub found
hub 1-0:1.0: no power switching (usb 1.0)
drivers/usb/core/inode.c: creating file '001'
usb usb1: new device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: UHCI Host Controller
usb usb1: Manufacturer: Linux 2.6.24.4 uhci_hcd
usb usb1: SerialNumber: 0000:00:11.2
drivers/usb/core/inode.c: creating file '002'
uhci_hcd 0000:00:11.3: new USB bus registered, assigned bus number 2
usb usb2: default language 0x0409
usb usb2: uevent
usb usb2: usb_probe_device
usb usb2: configuration #1 chosen from 1 choice
usb usb2: adding 2-0:1.0 (config #1, interface 0)
usb 2-0:1.0: uevent
hub 2-0:1.0: usb_probe_interface
hub 2-0:1.0: usb_probe_interface - got id
hub 2-0:1.0: USB hub found
hub 2-0:1.0: no power switching (usb 1.0)
drivers/usb/core/inode.c: creating file '001'
usb usb2: new device strings: Mfr=3, Product=2, SerialNumber=1
usb usb2: Product: UHCI Host Controller
usb usb2: Manufacturer: Linux 2.6.24.4 uhci_hcd
usb usb2: SerialNumber: 0000:00:11.3
usb usb1: suspend_rh (auto-stop)
usb usb2: suspend_rh (auto-stop)
When I plug in a flash drive the light blinks and it gets recognized, with some weird errors toward the bottom though:

Code:
usb usb1: wakeup_rh (auto-start)
hub 1-0:1.0: state 7 ports 2 chg 0000 evt 0002
uhci_hcd 0000:00:11.2: port 1 portsc 0093,00
hub 1-0:1.0: port 1, status 0101, change 0001, 12 Mb/s
hub 1-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x101
usb 1-1: new full speed USB device using uhci_hcd and address 2
usb 1-1: default language 0x0409
usb 1-1: uevent
usb 1-1: usb_probe_device
usb 1-1: configuration #1 chosen from 1 choice
usb 1-1: adding 1-1:1.0 (config #1, interface 0)
usb 1-1:1.0: uevent
libusual 1-1:1.0: usb_probe_interface
libusual 1-1:1.0: usb_probe_interface - got id
drivers/usb/core/inode.c: creating file '002'
usb 1-1: new device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: Patriot Memory
usb 1-1: Manufacturer:         
usb 1-1: SerialNumber: 078704B405D0
hub 1-0:1.0: state 7 ports 2 chg 0000 evt 0002
SCSI subsystem initialized
Initializing USB Mass Storage driver...
usb-storage 1-1:1.0: usb_probe_interface
usb-storage 1-1:1.0: usb_probe_interface - got id
usb-storage: USB Mass Storage device detected
usb-storage: -- associate_dev
usb-storage: Vendor: 0x13fe, Product: 0x1e00, Revision: 0x0110
usb-storage: Interface Subclass: 0x06, Protocol: 0x50
usb-storage: Transport: Bulk
usb-storage: Protocol: Transparent SCSI
scsi0 : SCSI emulation for USB Mass Storage devices
usb-storage: *** thread sleeping.
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usb-storage: device found at 2
usb-storage: waiting for device to settle before scanning
usb-storage: usb_stor_control_msg: rq=fe rqtype=a1 value=0000 index=00 len=1
usb-storage: GetMaxLUN command result is 1, data is 0
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command INQUIRY (6 bytes)
usb-storage:  12 00 00 00 24 00
usb-storage: Bulk Command S 0x43425355 T 0x1 L 36 F 128 Trg 0 LUN 0 CL 6
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_sglist: xfer 36 bytes, 1 entries
usb-storage: Status code 0; transferred 36/36
usb-storage: -- transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk Status S 0x53425355 T 0x1 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
scsi 0:0:0:0: Direct-Access              Patriot Memory   PMAP PQ: 0 ANSI: 0 CCS
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Bad target number (1:0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Bad target number (2:0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Bad target number (3:0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Bad target number (4:0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Bad target number (5:0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Bad target number (6:0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Bad target number (7:0)
usb-storage: scsi cmd done, result=0x40000
usb-storage: *** thread sleeping.
usb-storage: device scan complete
Code:
# cat /proc/bus/usb/devices 

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.06
S:  Manufacturer=Linux 2.6.24.4 uhci_hcd
S:  Product=UHCI Host Controller
S:  SerialNumber=0000:00:11.3
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.06
S:  Manufacturer=Linux 2.6.24.4 uhci_hcd
S:  Product=UHCI Host Controller
S:  SerialNumber=0000:00:11.2
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=13fe ProdID=1e00 Rev= 1.10
S:  Manufacturer=        
S:  Product=Patriot Memory
S:  SerialNumber=078704B405D0
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
The UPS backup isn't recognized, though. apcupsd won't run, the pid just dies, I guess because it can't find any UPS. Can anyone help, I don't know what to do next.



----------------------------------
I thought I would add the apcupsd log:

Code:
$ cat /var/log/apcupsd.events 
Thu Oct 30 12:13:09 EDT 2008  apcupsd 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>.
Thu Oct 30 12:13:09 EDT 2008  apcupsd error shutdown completed

and it just repeats like that.

Last edited by userlander; 10-30-2008 at 03:07 PM. Reason: changed title, added apcupsd log
 
Old 10-30-2008, 03:29 PM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
What changes did you make to apcupsd.conf?
 
Old 10-30-2008, 03:46 PM   #3
userlander
Member
 
Registered: Jul 2008
Distribution: Arch, Debian
Posts: 61

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by billymayday View Post
What changes did you make to apcupsd.conf?
Just the standard changes. I believe it is correct, but I'll post it below if you want to take a look at it. I don't think the file would prevent the back-up from being detected through USB, though, but perhaps it can somehow in a way that is beyond how I would understand it. It would seem to me the problems are perhaps more related to some udev thing or permissions? Which I have to admit I know absolutely nothing about and hate having to deal with at all.

apcupsd.conf:

Code:
$ cat /etc/apcupsd/apcupsd.conf
## apcupsd.conf v1.1 ##
# 
#  for apcupsd release 3.14.4 (18 May 2008) - debian
#
# "apcupsd" POSIX config file

#
# ========= General configuration parameters ============
#

# UPSNAME xxx
#   Use this to give your UPS a name in log files and such. This
#   is particulary useful if you have multiple UPSes. This does not
#   set the EEPROM. It should be 8 characters or less.
#UPSNAME ES550

# UPSCABLE <cable>
#   Defines the type of cable connecting the UPS to your computer.
#
#   Possible generic choices for <cable> are:
#     simple, smart, ether, usb
#
#   Or a specific cable model number may be used:
#     940-0119A, 940-0127A, 940-0128A, 940-0020B,
#     940-0020C, 940-0023A, 940-0024B, 940-0024C,
#     940-1524C, 940-0024G, 940-0095A, 940-0095B,
#     940-0095C, M-04-02-2000
#
#UPSCABLE smart
UPSCABLE usb

# To get apcupsd to work, in addition to defining the cable
# above, you must also define a UPSTYPE, which corresponds to
# the type of UPS you have (see the Description for more details).
# You must also specify a DEVICE, sometimes referred to as a port.
# For USB UPSes, please leave the DEVICE directive blank. For
# other UPS types, you must specify an appropriate port or address.
#
# UPSTYPE   DEVICE           Description
# apcsmart  /dev/tty**       Newer serial character device,
#                            appropriate for SmartUPS models using
#                            a serial cable (not USB).
#
# usb       <BLANK>          Most new UPSes are USB. A blank DEVICE
#                            setting enables autodetection, which is
#                            the best choice for most installations.
#
# net       hostname:port    Network link to a master apcupsd
#                            through apcupsd's Network Information
#                            Server. This is used if you don't have
#                            a UPS directly connected to your computer.
#
# snmp      hostname:port:vendor:community
#                            SNMP Network link to an SNMP-enabled
#                            UPS device. Vendor is the MIB used by
#                            the UPS device: can be "APC", "APC_NOTRAP"
#                            or "RFC" where APC is the powernet MIB,
#                            "APC_NOTRAP" is powernet with SNMP trap
#                            catching disabled, and RFC is the IETF's 
#                            rfc1628 UPS-MIB. You usually want "APC".
#                            Port is usually 161. Community is usually
#                            "private".
#
# dumb      /dev/tty**       Old serial character device for use 
#                            with simple-signaling UPSes.
#
# pcnet    ipaddr:username:passphrase
#                            PowerChute Network Shutdown protocol
#                            which can be used as an alternative to SNMP
#                            with AP9617 family of smart slot cards.
#                            ipaddr is the IP address of the UPS mgmt
#                            card. username and passphrase are the
#                            credentials for which the card has been
#                            configured.
#
#UPSTYPE apcsmart
#DEVICE /dev/ttyS0
UPSTYPE usb
#DEVICE

# POLLTIME <int>
#   Interval (in seconds) at which apcupsd polls the UPS for status. This
#   setting applies both to directly-attached UPSes (UPSTYPE apcsmart, usb, 
#   dumb) and networked UPSes (UPSTYPE net, snmp). Lowering this setting
#   will improve apcupsd's responsiveness to certain events at the cost of
#   higher CPU utilization. The default of 60 is appropriate for most
#   situations.
#POLLTIME 60

# LOCKFILE <path to lockfile>
#   Path for device lock file. Not used on Win32.
LOCKFILE /var/lock

# SCRIPTDIR <path to script directory>
#   Directory in which apccontrol and event scripts are located.
SCRIPTDIR /etc/apcupsd

# PWRFAILDIR <path to powerfail directory>
#   Directory in which to write the powerfail flag file. This file
#   is created when apcupsd initiates a system shutdown and is
#   checked in the OS halt scripts to determine if a killpower
#   (turning off UPS output power) is required.
PWRFAILDIR /etc/apcupsd

# NOLOGINDIR <path to nologin directory>
#   Directory in which to write the nologin file. The existence
#   of this flag file tells the OS to disallow new logins.
NOLOGINDIR /etc


#
# ======== Configuration parameters used during power failures ==========
#

# The ONBATTERYDELAY is the time in seconds from when a power failure
#   is detected until we react to it with an onbattery event.
#
#   This means that, apccontrol will be called with the powerout argument
#   immediately when a power failure is detected.  However, the
#   onbattery argument is passed to apccontrol only after the 
#   ONBATTERYDELAY time.  If you don't want to be annoyed by short
#   powerfailures, make sure that apccontrol powerout does nothing
#   i.e. comment out the wall.
ONBATTERYDELAY 6

# 
# Note: BATTERYLEVEL, MINUTES, and TIMEOUT work in conjunction, so
# the first that occurs will cause the initation of a shutdown.
#

# If during a power failure, the remaining battery percentage
# (as reported by the UPS) is below or equal to BATTERYLEVEL, 
# apcupsd will initiate a system shutdown.
BATTERYLEVEL 5

# If during a power failure, the remaining runtime in minutes 
# (as calculated internally by the UPS) is below or equal to MINUTES,
# apcupsd, will initiate a system shutdown.
MINUTES 3

# If during a power failure, the UPS has run on batteries for TIMEOUT
# many seconds or longer, apcupsd will initiate a system shutdown.
# A value of 0 disables this timer.
#
#  Note, if you have a Smart UPS, you will most likely want to disable
#    this timer by setting it to zero. That way, you UPS will continue
#    on batteries until either the % charge remaing drops to or below BATTERYLEVEL,
#    or the remaining battery runtime drops to or below MINUTES.  Of course,
#    if you are testing, setting this to 60 causes a quick system shutdown
#    if you pull the power plug.   
#  If you have an older dumb UPS, you will want to set this to less than
#    the time you know you can run on batteries.
TIMEOUT 0

#  Time in seconds between annoying users to signoff prior to
#  system shutdown. 0 disables.
ANNOY 300

# Initial delay after power failure before warning users to get
# off the system.
ANNOYDELAY 60

# The condition which determines when users are prevented from
# logging in during a power failure.
# NOLOGON <string> [ disable | timeout | percent | minutes | always ]
NOLOGON disable

# If KILLDELAY is non-zero, apcupsd will continue running after a
# shutdown has been requested, and after the specified time in
# seconds attempt to kill the power. This is for use on systems
# where apcupsd cannot regain control after a shutdown.
# KILLDELAY <seconds>  0 disables
KILLDELAY 0

#
# ==== Configuration statements for Network Information Server ====
#

# NETSERVER [ on | off ] on enables, off disables the network
#  information server. If netstatus is on, a network information
#  server process will be started for serving the STATUS and
#  EVENT data over the network (used by CGI programs).
NETSERVER on

# NISIP <dotted notation ip address>
#  IP address on which NIS server will listen for incoming connections.
#  This is useful if your server is multi-homed (has more than one
#  network interface and IP address). Default value is 0.0.0.0 which
#  means any incoming request will be serviced. Alternatively, you can
#  configure this setting to any specific IP address of your server and 
#  NIS will listen for connections only on that interface. Use the
#  loopback address (127.0.0.1) to accept connections only from the
#  local machine.
NISIP 127.0.0.1

# NISPORT <port> default is 3551 as registered with the IANA
#  port to use for sending STATUS and EVENTS data over the network.
#  It is not used unless NETSERVER is on. If you change this port,
#  you will need to change the corresponding value in the cgi directory
#  and rebuild the cgi programs.
NISPORT 3551

# If you want the last few EVENTS to be available over the network
# by the network information server, you must define an EVENTSFILE.
EVENTSFILE /var/log/apcupsd.events

# EVENTSFILEMAX <kilobytes>
#  By default, the size of the EVENTSFILE will be not be allowed to exceed
#  10 kilobytes.  When the file grows beyond this limit, older EVENTS will
#  be removed from the beginning of the file (first in first out).  The
#  parameter EVENTSFILEMAX can be set to a different kilobyte value, or set
#  to zero to allow the EVENTSFILE to grow without limit.
EVENTSFILEMAX 10

#
# ========== Configuration statements used if sharing =============
#            a UPS with more than one machine

#
# Remaining items are for ShareUPS (APC expansion card) ONLY
#

# UPSCLASS [ standalone | shareslave | sharemaster ]
#   Normally standalone unless you share an UPS using an APC ShareUPS
#   card.
UPSCLASS standalone

# UPSMODE [ disable | share ]
#   Normally disable unless you share an UPS using an APC ShareUPS card.
UPSMODE disable

#
# ===== Configuration statements to control apcupsd system logging ========
#

# Time interval in seconds between writing the STATUS file; 0 disables
STATTIME 0

# Location of STATUS file (written to only if STATTIME is non-zero)
STATFILE /var/log/apcupsd.status

# LOGSTATS [ on | off ] on enables, off disables
# Note! This generates a lot of output, so if         
#       you turn this on, be sure that the
#       file defined in syslog.conf for LOG_NOTICE is a named pipe.
#  You probably do not want this on.
LOGSTATS off

# Time interval in seconds between writing the DATA records to
#   the log file. 0 disables.
DATATIME 0

# FACILITY defines the logging facility (class) for logging to syslog. 
#          If not specified, it defaults to "daemon". This is useful 
#          if you want to separate the data logged by apcupsd from other
#          programs.
#FACILITY DAEMON

#
# ========== Configuration statements used in updating the UPS EPROM =========
#

#
# These statements are used only by apctest when choosing "Set EEPROM with conf
# file values" from the EEPROM menu. THESE STATEMENTS HAVE NO EFFECT ON APCUPSD.
#

# UPS name, max 8 characters 
#UPSNAME UPS_IDEN

# Battery date - 8 characters
#BATTDATE mm/dd/yy

# Sensitivity to line voltage quality (H cause faster transfer to batteries)  
# SENSITIVITY H M L        (default = H)
#SENSITIVITY H

# UPS delay after power return (seconds)
# WAKEUP 000 060 180 300   (default = 0)
#WAKEUP 60

# UPS Grace period after request to power off (seconds)
# SLEEP 020 180 300 600    (default = 20)
#SLEEP 180

# Low line voltage causing transfer to batteries
# The permitted values depend on your model as defined by last letter 
#  of FIRMWARE or APCMODEL. Some representative values are:
#    D 106 103 100 097
#    M 177 172 168 182
#    A 092 090 088 086
#    I 208 204 200 196     (default = 0 => not valid)
#LOTRANSFER  208

# High line voltage causing transfer to batteries
# The permitted values depend on your model as defined by last letter 
#  of FIRMWARE or APCMODEL. Some representative values are:
#    D 127 130 133 136
#    M 229 234 239 224
#    A 108 110 112 114
#    I 253 257 261 265     (default = 0 => not valid)
#HITRANSFER 253

# Battery charge needed to restore power
# RETURNCHARGE 00 15 50 90 (default = 15)
#RETURNCHARGE 15

# Alarm delay 
# 0 = zero delay after pwr fail, T = power fail + 30 sec, L = low battery, N = never
# BEEPSTATE 0 T L N        (default = 0)
#BEEPSTATE T

# Low battery warning delay in minutes
# LOWBATT 02 05 07 10      (default = 02)
#LOWBATT 2

# UPS Output voltage when running on batteries
# The permitted values depend on your model as defined by last letter 
#  of FIRMWARE or APCMODEL. Some representative values are:
#    D 115
#    M 208
#    A 100
#    I 230 240 220 225     (default = 0 => not valid)
#OUTPUTVOLTS 230

# Self test interval in hours 336=2 weeks, 168=1 week, ON=at power on
# SELFTEST 336 168 ON OFF  (default = 336)
 
Old 10-30-2008, 04:23 PM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Try

UPSCABLE smart
 
Old 10-30-2008, 04:30 PM   #5
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
What does apcaccess show?
 
Old 10-30-2008, 04:30 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,191

Rep: Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087
Did you enable USB when you built apcupsd? USB is not enabled by default.
apctest is an independent utility to test the UPS that does not use the apcupsd daemon.
 
Old 10-30-2008, 04:49 PM   #7
userlander
Member
 
Registered: Jul 2008
Distribution: Arch, Debian
Posts: 61

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by michaelk View Post
Did you enable USB when you built apcupsd? USB is not enabled by default.
apctest is an independent utility to test the UPS that does not use the apcupsd daemon.
It's the debian package -- is there a way to check if it's enabled by default?
 
Old 10-30-2008, 04:50 PM   #8
userlander
Member
 
Registered: Jul 2008
Distribution: Arch, Debian
Posts: 61

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by billymayday View Post
What does apcaccess show?
It doesn't seem to be able to work without apcupsd running:

# apcaccess
Error contacting apcupsd @ localhost:3551: Connection refused

Trying UPSCALABLE smart...

----------
Upscalable smart didn't work.

Last edited by userlander; 10-30-2008 at 05:04 PM.
 
Old 10-30-2008, 09:02 PM   #9
userlander
Member
 
Registered: Jul 2008
Distribution: Arch, Debian
Posts: 61

Original Poster
Rep: Reputation: 18
No matter what I try I can't get the UPS to be detected through USB.

In the manual, they mention device nodes:

Quote:
Apcupsd accesses USB UPSes via the hiddev device nodes. Typically these are located in /dev/hiddevN, /dev/usb/hiddevN or /dev/usb/hiddev/hiddevN (where N is a digit 0 thru 9). Some distributions (some Debian releases, possibly others) do not provides these device nodes for you, so you will have to make them yourself. Check /dev, /dev/usb, and /dev/usb/hiddev and if you cannot find the hiddevN nodes, run (as root) the examples/make-hiddev script from the apcupsd source distribution.
...
The bottom line for apcupsd on such a system is that if the hiddevN is not created when you plug in your UPS, apcupsd will terminate with an error. The solution to the problem is to add a rule to the udev rules file.

http://www.apcupsd.com/manual/USB_Configuration.html
I didn't have any of those, so I got the source and ran the make-hiddev script, but the nodes that are created disappear every time I reboot. I tried making the nodes and then unplugging and plugging the usb plug again, but that didn't work, either.

I also made a /etc/udev/rules.d/50-udev.rules file and tried adding the udev rules mentioned on that page, restarted udev, but that also didn't work. I just can't figure out what the problem is here.

Could it be what michaelk said, that the debian binary doesn't build the usb support in their version of the package and I have to build it myself?

Last edited by userlander; 10-30-2008 at 09:03 PM.
 
Old 10-31-2008, 12:14 PM   #10
userlander
Member
 
Registered: Jul 2008
Distribution: Arch, Debian
Posts: 61

Original Poster
Rep: Reputation: 18
I'm starting to think this might be a defective UPS. I booted my laptop into windows XP and plugged the USB cable into there and nothing happened. I got it for cheap off of ebay, must have been a refurbished unit. I'm going to contact the seller and try to get a replacement. thanks everyone.

#------------------------>

UPDATE: The UPS was in fact defective. APC sent me a new one, it was detected through USB without incident.

The only strange thing is that the apcupsd daemon and the utils wouldn't run, and gave this error:

Error reading status from apcupsd @ localhost:3551: Connection reset by peer

A debian website also listed this problem, and said they got around it by unplugging the USB from the computer and then plugging it back in again. That didn't work for me. /var/log/apcuspd.events said:

Wed Nov 12 16:04:23 EST 2008 Connection from 127.0.0.1 refused by tcp_wrappers.

I added apcupsd: 127.0.0.1 to /etc/hosts.allow, and now it works. That seemed kind of strange to me, and then I noticed that by not specifying a name for the UPS in /etc/apcupsd/apcupsd.conf, it was defaulting to my system host name. I added an entry to apcupsd.conf to name it, but that didn't work. It seems to need the allowance in the hosts.allow file.

It's now working, and I don't see any big problems with having that entry in the hosts.allow, so I consider this ~CASE SOLVED~.

Last edited by userlander; 11-12-2008 at 03:46 PM.
 
1 members found this post helpful.
Old 07-09-2009, 07:33 PM   #11
viklahan
LQ Newbie
 
Registered: Aug 2008
Distribution: Ubuntu/Fedora/Mandriva
Posts: 7

Rep: Reputation: 0
Error reading status from apcupsd @ localhost:3551: Connection timed out

Can you tell me how did you got it working? Thanks.. cuz I am also getting the same error.

cat /var/log/apcupsd.events has the following thing


Thu Jul 09 17:32:12 PDT 2009 Valid lock file for pid=2073, but not ours pid=6251
Thu Jul 09 17:32:12 PDT 2009 apcupsd FATAL ERROR in device.c at line 70
Unable to create UPS lock file.
If apcupsd or apctest is already running,
please stop it and run this program again.
Thu Jul 09 17:32:12 PDT 2009 Valid lock file for pid=2073, but not ours pid=6251
Thu Jul 09 17:32:12 PDT 2009 apcupsd error shutdown completed

Any help is appreciated!

Thanks
Vik

Quote:
Originally Posted by userlander View Post
I'm starting to think this might be a defective UPS. I booted my laptop into windows XP and plugged the USB cable into there and nothing happened. I got it for cheap off of ebay, must have been a refurbished unit. I'm going to contact the seller and try to get a replacement. thanks everyone.

#------------------------>

UPDATE: The UPS was in fact defective. APC sent me a new one, it was detected through USB without incident.

The only strange thing is that the apcupsd daemon and the utils wouldn't run, and gave this error:

Error reading status from apcupsd @ localhost:3551: Connection reset by peer

A debian website also listed this problem, and said they got around it by unplugging the USB from the computer and then plugging it back in again. That didn't work for me. /var/log/apcuspd.events said:

Wed Nov 12 16:04:23 EST 2008 Connection from 127.0.0.1 refused by tcp_wrappers.

I added apcupsd: 127.0.0.1 to /etc/hosts.allow, and now it works. That seemed kind of strange to me, and then I noticed that by not specifying a name for the UPS in /etc/apcupsd/apcupsd.conf, it was defaulting to my system host name. I added an entry to apcupsd.conf to name it, but that didn't work. It seems to need the allowance in the hosts.allow file.

It's now working, and I don't see any big problems with having that entry in the hosts.allow, so I consider this ~CASE SOLVED~.
 
Old 07-09-2009, 08:15 PM   #12
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
What makes you think that's the same error?

Is it already running?
 
Old 07-10-2009, 12:36 PM   #13
viklahan
LQ Newbie
 
Registered: Aug 2008
Distribution: Ubuntu/Fedora/Mandriva
Posts: 7

Rep: Reputation: 0
Its working now!

OK! I got it working. Now this is strange, I mean I rebooted the system and yes there is working and fine. Strange... but not good. Shudnt need a restart since I am working on a huge corporate network, I dnt want machines to be restarted for getting this daemon working.

Thanks
Vik

Quote:
Originally Posted by billymayday View Post
What makes you think that's the same error?

Is it already running?
 
  


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 UPS backup-ups ES RJ-45 augurseer Linux - Hardware 3 11-18-2009 11:32 PM
Anyone Use APC UPS in Debian? carlosinfl Debian 5 04-14-2009 09:54 AM
APC UPS Communication with Linux? SlowCoder Linux - General 3 06-02-2007 01:20 PM
APC UPS Smart_UPS v/s 650 MikeAtVillage Linux - Hardware 4 07-05-2005 04:08 AM
apc Back-ups a10392 Debian 1 12-03-2004 10:24 AM

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

All times are GMT -5. The time now is 11:28 PM.

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
Open Source Consulting | Domain Registration