Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 76838 - Trouble with apcupsd with a SmartUPS 1400 (serial port)
Summary: Trouble with apcupsd with a SmartUPS 1400 (serial port)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High major
Assignee: Michael Imhof (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-05 17:46 UTC by Richard Gray
Modified: 2005-07-28 15:36 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Gray 2005-01-05 17:46:46 UTC
A standalone smart UPS is configured on /dev/ttyS0 on a Dell Poweredge 6300 QUAD PII machine. apcupsd and apctest both complain that they cannot talk to the UPS. Now change the cable type to "simple" in apcupsd.conf, (as opposed to 'smart') and run apctest - no need to actually do anything, just quit right away. Now change the cable type back to smart, and run either apcupsd or apctest now and the UPS now communicates fine. 'rmmod serial' and then 'modprobe serial' brings the problem back again. This suggests a problem in the serial kernel module rather than apcupsd, perhaps?
An earlier version of apcupsd works fine on an old 2.2 kernel machine on a variety of other (old) Dell poweredge machines.
Comment 1 peter denisevich 2005-01-14 12:56:52 UTC
I've got similar problems with apcupsd that are _kernel-dependent_:
Works fine under kernel-2.4.26-r9 (gentoo-sources, my .config) with my Smart-UPS-700 and a smart serial cable.  Does _not_ work with kernel-2.4.28-r4 (same .config) : cannot connect to dev/ttyS0.  The trick of "jiggling" the apcupsd.conf file between "samrt" and "simple" allows communications but it's garbled -- misidentifies UPS as BackUPS and various status items are wrongly reported. 

 Under kernel-2.6.1-r2 (gentoo-dev-sources) it's worse -- complains cannot connect to USB [sic] device /dev/ttyS0!

See also the comments I posted yesterday at http://forums.gentoo.org/viewtopic.php?t=279362
with link to my kernel configs.

FWIW this used to work (same PC/cable/UPS) fine under Fedora Core 2 and 3. 
-peter denisevich
Comment 2 Richard Gray 2005-01-14 14:18:03 UTC
I seem to find that it's kernel dependent too: I've recently updated to 2.4.28-gentoo-r5 without amending the .config at all and it runs fine. I'm not sure that this warrants being called "fixed" without understanding what the hell is going on - I'm just keeping my eye on it for now.
Comment 3 peter denisevich 2005-01-14 18:27:00 UTC
Works for me, too, with kernel-2.4.28-r5, using the identical configuration as for the (bad) -r4.

There seems to be a related report on the apcupsd-users mailing list where under RedHat a kernel and gcc upgrade broke a working serial port setup.  But there's no resolution posted: 
http://sourceforge.net/mailarchive/message.php?msg_id=9149755

I agree that there seems to be something flaky about the serial port handling. And I wouldn't change the status of this bug report until we understand something ...
 
Comment 4 Michael Imhof (RETIRED) gentoo-dev 2005-01-18 07:01:51 UTC
So any news on this bug?
Comment 5 Michael Imhof (RETIRED) gentoo-dev 2005-05-30 12:18:46 UTC
any news on this bug?
if not i will close it within a week
Comment 6 Richard Gray 2005-05-30 13:23:28 UTC
It would appear that the current ebuild fixes this problem. Regrettably I have
no real insights into what the underlying problem was. Well, if it aint broke,
don't mend it!
Comment 7 Richard Gray 2005-06-30 07:34:48 UTC
I've just updated to the 2.6 kernel and now /dev/ttyS0 device doesn't seem to
exist, so now there's no communications with the UPS. The /dev/ttyS0 inode is
there, and I'm pretty sure the kernel build options are OK. I am using udev.
Comment 8 Richard Gray 2005-06-30 18:19:47 UTC
It seems that I need to explicitly load the "8250" module to cause the
appropriate serial port devices to appear. Once I do this, the apcupsd works fine.
I think this problem is more to do with my not understanding properly how things
work, in particular the new udev system, rather than a bug as such. It would be
nice if these things automagically appeared and loaded the appropriate modules
when needed; but it probably can be set up to do this, I just don't know how yet.
Comment 9 Richard Gray 2005-07-07 16:07:40 UTC
OK, it seems that I need to manually load module 8250 in order to have
/dev/ttyS0 appear in /dev. Unlike devfs, udev doesn't load modules and it would
appear that it never will work this way. Upon reflection, this is probably a
hotplug [coldplug] problem more than anything else. I would be content to have
this bug set as "fixed".
Comment 10 Michael Imhof (RETIRED) gentoo-dev 2005-07-28 15:36:04 UTC
Done ;)