[Nut-upsuser] Patches for NUT 2.2.2: APC SmartUPS-900

Arnaud Quette arnaud.quette at free.fr
Tue May 5 13:32:41 UTC 2009


2009/5/4 Konstantin 'Kastus' Shchuka <kastus at epocrates.com>

> Hi Arnaud,
>

Hi Kastus,

 As you are patching apcsmart.h, can you also apply my patch that I sent
> back in November last year for 2.2.1 for the old SU600 model to the upsdev
> list?
>
> I am attaching my original post.
>

thanks for the reminder. it seems that I've been reseted at some point in
time...
I've just applied your patch to the trunk.

thanks for your contrib.
Arnaud
-- 
Linux / Unix Expert R&D - Eaton - http://www.eaton.com/mgeops
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.free.fr/

 On Mon, May 04, 2009 at 10:32:23AM +0200, Arnaud Quette wrote:
> > 2009/5/3 Thomas Juerges
> >
> > > -----BEGIN PGP SIGNED MESSAGE-----
> > > Hash: SHA1
> > >
> > > Hi Arnaud,
> > >
> >
> > Hi Thomas,
> >
> >
> > > I just checked the 2.4.1 version of nut and found that you forgot to
> add
> > > my old UPS model (APC Smart-UPS 900).  I guess it is because you were
> > > busy at the time when I sent you the patch.  So here it goes again. :)
> > >
> >
> > uh, right sorry.
> > I was pretty sure I applied it, but seems not.
> > it's now done and commited to the Development tree.
> >
> > I've left your below information about older SmartUPS and Mac os tweaks
> > since I'm sure people will be interested in...
> >
> > thanks a lot for your contrib and reminder ;-)
> >
> > cheers,
> > Arnaud
> > --
> > Linux / Unix Expert R&D - Eaton - http://www.eaton.com/mgeops
> > Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
> > Debian Developer - http://www.debian.org
> > Free Software Developer - http://arnaud.quette.free.fr/
> >
> >  Arnaud Quette wrote:
> > > > Hi Thomas,
> > > >
> > > > just to ack your mails. I'm currently on trip, at the FossCamp /
> > > > Ubuntu Developer Summit.
> > > > I'll really reply to you soon.
> > > >
> > > > thanks for your contrib and feedback.and see you soon.
> > > > -- Arnaud
> > > >
> > > > 2008/12/6 Thomas Juerges <thomas at sokrates.homelinux.net>:
> > > > Hi Arnaud,
> > > >
> > > > I am not sure if the message which I sent to you via your free.fr
> > > > account could reach you.  Therefore i have attached it here and send
> > > > this one to both email addresses.  In the case that you receive both,
> > > > please accept my apologies.
> > > >
> > > > Anyway, I have two patches for you which make the APC SmartUPS-900
> work
> > > > (did already before) and report all of its status information (did
> not
> > > > do that before).  I have attached two patches for inclusion into the
> > > > next release for your convenience.
> > > >
> > > > The mentioned patches are as well a reply for the question asked on
> the
> > > > NUT mailing list when somebody asked why an older SmartUPS would not
> > > > provide the same information as under apcupsd.  Simple reason is that
> > > > the older SmartUPSes (at least mine, SmartUPS-900 w. 7TD firmware) do
> > > > not respond to the ^Z, a or b commands which are used to inquire what
> > > > they support.
> > > >
> > > >
> > > > I hope you'll find this useful.  Cheers,
> > > >        Thomas Juerges
> > > >
> > > >
> > > > -------- Original Message --------
> > > > Subject: Restarting Power Macs after power loss
> > > > Date: Fri, 05 Dec 2008 08:48:02 -0700
> > > > From: Thomas Juerges <thomas at sokrates.homelinux.net>
> > > > To: arnaud.quette at free.fr
> > > >
> > > > Hi Arnaud,
> > > >
> > > > first thanks for yor nice piece of software.  I am using it on my Mac
> > > > Mini G4 since I installed Gentoo on it and I am quite happy with it
> > > > [https://www.sokrates.homelinux.net/nut/].  There are a few quirks
> but,
> > > > well, that's life.  No free lunch. :)
> > > >
> > > > All right.  Now for the more important things:  I write to you in
> > > > response to your comment in  this question in the NUT FAQ:
> > > >
> > > > Q: My PowerMac G4 won't power back up by itself (into Linux) after
> the
> > > >    UPS shuts down.  What can I do about this?
> > > >
> > > > [...]
> > > > Unfortunately, the hardware has evolved and there is no good
> > > >    equivalent for this hack on today's systems.
> > > > [...]
> > > >
> > > > Here is what you have to do nowadays on Linux (Kernel 2.6.x).
> > > > Unfortunately this setting is not stored in NVRAM so you'll better
> have
> > > > it somewhere in rc.local or any other script that gets run every time
> > > > during a boot up.
> > > >
> > > > echo "server_mode=1" > /proc/pmu/options
> > > >
> > > > This will let the PowerMac restart every time after the power was
> lost -
> > > > as far as I can tell.  I've got only one. :)
> > > >
> > > > Cheers,
> > > >        Thomas
> > > >>
> > > - --- nut-2.2.2/drivers/apcsmart.c        2007-12-12 13:34:51.000000000
> > > -0700
> > > +++ nut-2.2.2-r1/drivers/apcsmart.c     2008-12-06 03:24:36.000000000
> -0700
> > > @@ -536,6 +536,7 @@
> > >               /* found one, force the model information */
> > >               if (!strcmp(buf, "6QD") || /* (APC600.) */
> > >                               !strcmp(buf, "8QD") || /* (SmartUPS 1250,
> > > vintage 07/94.) */
> > > +                               !strcmp(buf, "7TD") || /* (SmartUPS
> 900,
> > > vintage 11/94.) */
> > >                               !strcmp(buf, "6TI") || /* (APC600.) */
> > >                               !strcmp(buf, "6QI")) { /* (APC600.) */
> > >                       upsdebugx(1, "Found Smart-UPS");
> > > >>
> > > - --- nut-2.2.2/drivers/apcsmart.h        2007-12-12 13:34:51.000000000
> > > -0700
> > > +++ nut-2.2.2-r1/drivers/apcsmart.h     2008-12-06 03:00:48.000000000
> -0700
> > > @@ -261,6 +261,8 @@
> > >       { "D6",         "789ABCEFGKLMNOPQRSUVWXYZ", 0 },
> > >       { "D5",         "789ABCEFGKLMNOPQRSUVWXYZ", 0 },
> > >       { "D4",         "789ABCEFGKLMNOPQRSUVWXYZ", 0 },
> > > +       /* SmartUPS 900 */
> > > +       { "7TD",        "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0
> },
> > >       /* SmartUPS 1250. */
> > >       { "8QD",        "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0 },
> > > >>
> > > >>
> > > >>
> > >
> > > -----BEGIN PGP SIGNATURE-----
> > > Version: GnuPG v2.0.11 (GNU/Linux)
> > > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> > >
> > > iEYEARECAAYFAkn+AowACgkQMiyRSD9s+zV0oQCffFhtV0zs2InekhBrVey+fQ6o
> > > EW0An12lictuhgsldN/Yhfh2oVeTxmeP
> > > =9+Pn
> > > -----END PGP SIGNATURE-----
>
>
> ---------- Message transféré ----------
> From: "Konstantin 'Kastus' Shchuka" <kastus at epocrates.com>
> To: nut-upsdev at lists.alioth.debian.org
> Date: Thu, 27 Nov 2008 19:16:52 -0800
> Subject: Re: [Nut-upsdev] patch for old APC Smart-UPS 600
> I am sorry to return to this old issue again.
>
> I discovered that my venerable SU-600 sometimes responds with other D codes
> than I added to compat_tab already. I had to add 3 more codes there to
> make it recognized properly by NUT.
>
> Here is the diff:
>
> --- nut-2.2.1.orig/drivers/apcsmart.h    2007-12-17 07:13:09.000000000
> -0800
> +++ nut-2.2.1/drivers/apcsmart.h  2008-11-27 18:56:36.292018933 -0800
> @@ -258,6 +258,9 @@
>        /* CS 350 */
>        { "5.4.D",      "\1ABPQRSUYbdfgjmnx9",  0 },
>        /* Smart-UPS 600 */
> +       { "D9",         "789ABCEFGKLMNOPQRSUVWXYZ", 0 },
> +       { "D8",         "789ABCEFGKLMNOPQRSUVWXYZ", 0 },
> +       { "D7",         "789ABCEFGKLMNOPQRSUVWXYZ", 0 },
>        { "D6",         "789ABCEFGKLMNOPQRSUVWXYZ", 0 },
>        { "D5",         "789ABCEFGKLMNOPQRSUVWXYZ", 0 },
>        { "D4",         "789ABCEFGKLMNOPQRSUVWXYZ", 0 },
>
> Thanks,
> -Kastus
>
> On Fri, Nov 24, 2006 at 08:43:09PM -0800, Konstantin 'Kastus' Shchuka
> wrote:
> > Hi there,
> >
> > I am using an old (really old) APC Smart-UPS 600. It worked fine
> > under apcupsd but when I tried NUT it did not work.
> >
> > The error I was getting was:
> >
> > sudo /lib/nut/apcsmart -DDD /dev/ttyS1
> > Network UPS Tools (version 2.0.4) - APC Smart protocol driver
> >         Driver version 1.99.8, command table version 2.0
> > debug level is '3'
> > Attempting firmware lookup
> > Firmware: [D4]
> > Not found in table - trying normal method
> > APC - Attempting to find command set
> > APC - Parsing out command set
> > Unable to split APC version string
> > Bailing out
> >
> > I tried running commands manually from minicom, and indeed, the UPS
> > was returning D6, D5, or D4 in response to "b" command. I still do not
> > understand the inconsistency, but I have observed these 3 strings at
> least.
> >
> > I came up with the following patch to apcsmart.h:
> >
> > --- nut-2.0.4.orig/drivers/apcsmart.h
> > +++ nut-2.0.4/drivers/apcsmart.h
> > @@ -254,6 +254,10 @@
> >         /* APC600 */
> >         { "6QD",        "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0 },
> >         { "6TI",        "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0 },
> > +       /* Smart-UPS 600 */
> > +       { "D6",         "789ABCEFGKLMNOPQRSUVWXYZ", 0 },
> > +       { "D5",         "789ABCEFGKLMNOPQRSUVWXYZ", 0 },
> > +       { "D4",         "789ABCEFGKLMNOPQRSUVWXYZ", 0 },
> >         /* CS 350 */
> >         { "5.4.D",      "\1ABPQRSUYbdfgjmnx9",  0 },
> >
> > I understand that it is a clumsy way to make it work but it was the
> easiest
> > for me.
> >
> > I am not sure how many more old Smart-UPS 600 are still in use and if
> it's
> > worth including into NUT.
> >
> > Thanks,
> > --
> > Kastus Shchuka
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20090505/8b8011f1/attachment.htm>


More information about the Nut-upsuser mailing list