Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I have an old Ubuntu server (uname -r: 2.6.17-10-generic). We've been having issues with coming in in the morning and the thing has restarted or is off, so we have no Internet and had to restart it. I figured the APC BACK-UPS wasn't doing its job so last month we bought a shiny new Smart-UPS. But I can't get them to talk to each other.
The UPS came with a serial cable labelled "940-0625A" which I have plugged in to a serial port on the server.
My apcupsd.conf is as follows:
UPSCABLE smart (note that putting in the actual cable number doesn't work - unrecognized cable)
DEVICE /dev/ttyS0 (this is just a guess, I've tried S1 as well)
But there is a problem because when I run apcupsd I get a fatal error:
Wed Jan 29 20:06:47 EST 2014 apcupsd FATAL ERROR in smartsetup.c at line 174
PANIC! Cannot communicate with UPS via serial port.
Please make sure the port specified on the DEVICE directive is correct,
and that your cable specification on the UPSCABLE directive is correct.
Wed Jan 29 20:06:47 EST 2014 apcupsd error shutdown completed
I've installed setserial which just seems to report that my serial ports do in fact exist. Example:
Yes, I've read the apcupsd manual (http://www.apcupsd.com/manual/#configuration-examples) and googled extensively, but I can't seem to get the apcupsd to recognise my cable. I was hoping someone else had experienced the issue and managed to solve it, or at least understood the inner workings of the apcupsd program better than I and would know what options I could try to get it working.
ETA: I don't even know how to tell WHICH serial port the apcupsd thinks the UPS is plugged into, since using either /dev/ttyS0 and /dev/ttyS1 (and setserial output) produce identical results. When I try to communicate with either port using Minicom, nothing happens.
apcupsd updated their home page and removed the note about the SMT UPS models. It basically said these devices are unsupported as is due to APC's new microlink communication protocol. That said you can either use the simple cable with reduced capability as described in the manual or install the AP9620 card.
You're correct; it turns out my model of new APC UPS does in fact use a Microlink protocol, which my old server and old apcupsd cannot communicate. Mystery solved as to WHY I can't get them to talk, now the question as to how I can fix it.
This very interesting thread: http://forums.apc.com/thread/5374 indicates that after 3 years APC agreed it was unwise to alienate all its non-Microsoft users, and created a second protocol (MODBUS) which they shared with apcupsd developers. Apparently there is a new version of apcupsd that uses the new protocol. This is likely why the notice came off their homepage?
Is there a way to tell if my UPS supports MODBUS and how I can get the new apcupsd installed on my old Linux (might not be compatible?)
OK... I've compiled the newest apcupsd from source. This incorporates the modbus protocol and it had the correct cable listed, which I've used. It seems to have installed successfully, however I still cannot connect to my APC UPS over serial. When I type "apcaccess status" I do see the stats from the UPS and the STATUS: COMMLOST, STATFLAG: 0x05000100.
I checked in /var/log/apcupsd.events and saw the following:
"Communications with UPS lost" (repeated about every 4-6 minutes)
"apcserver: cannot bind port 3551. ERR=Address already in use" (every hour. I used netstat to verify that nothing is using 3551)
Again, I'm not sure how to tell which serial port it even thinks it's connected to. When I run apcupsd, nothing happens, but it doesn't seem to actually run either. Thanks for any help.
Last edited by Avatar; 04-01-2014 at 08:04 PM.
Reason: added info
Sorry - I edited my previous post to include the information from apcupsd.events, but now that I refresh the page, the edits are gone!
Anyway - I do in fact see apcupsd running in ps. I restarted it a few times for good measure.
"Communications with UPS lost." (every few minutes)
"apcserver: Cannot bind port 3551. ERR=Address already in use" (once an hour. I verified with netstat that nothing is running on 3551).
I have physically gone into the server room and plugged the UPS into the other serial port on the server - didn't help
Sadly, no. This server is .. ahem.. quirky. If something is plugged into a USB port I am not guaranteed that it will boot up successfully after a power outage. (Backups are done over the network now...) My last few (pre-MODBUS) APC UPSes all connected via serial cable and when I bought this one I made sure it had serial too.
Now, if you could get your Smart-UPS connected via serial, I would be very interested in how you did it
Michaelk, yep, I have tried those settings from the manual. I thought it would work better with my actual cable listed but alas, nothing seems to work. As of today I still get "Communications with UPS lost" every 10 minutes in my apcupsd.events file.