[Nut-upsdev] Driver for Powercom BNT/KIN/IMP/IMD series

Dan Mahoney, System Admin danm at prime.gushi.org
Tue Jan 22 12:48:19 UTC 2008


On Tue, 22 Jan 2008, Michael Tokarev wrote:

I make this offer frequently, and will make it again here...if anyone 
needs access to a development system on public-net connected to one of 
these UPSes *OR* if someone would like a free "sample" of one of these 
models (in the interests of improving the driver, in either case) please 
contact me off-list.

I'm more than willing to ship out one of my spares, but would prefer to 
send it "empty" and leave it to whomever to pick up the batteries (since 
they're the heavy part to ship).

I don't grok C, but will help out any way I can.  :)

-Dan

> Charles Lepple wrote:
>> On Jan 9, 2008 5:08 AM, Alexey Sidorov <alex at reutman.ru> wrote:
>>> Alexey Sidorov ?????:
>>>> renew http://www.reutman.ru/files/powercom.tar.bz2
>>>> - fix detection of KIN-2200AP (was can detected as KIN-2500AP)
>>>> - add patch for drivers/Makefile.* ( add -lm)
>>>> - add patch for data/driver.list
>>>> - add patch for man/powercom.8
>>>>
>>> attached powercom.tar.bz2
>>
>> Thanks, committed to the SVN trunk as r1236. Sorry for the delay.
>
> Ughrm... That driver is very poorly written and needs quite
> some work before it will be acceptable... ;)  I already sent
> some notes to Alexey, but he didn't reply.  Here are some
> notes:
>
> o code like this is everywhere:
>
>        if ( types[type].name=="BNT") ...
>
> it works only with recent GCC which places identical string
> literals into the same place in memory.  There's no word in
> C standards that this construct will work or not - the behavior
> is undefined.
>
> o variables defined in powercom.h file.  (By the way, why .h
>  files are used here in the first place?  E.g. powercom.h is
>  only included by powercom.c - ditto for many other pairs).
>
> o obvious error:
>
>        if ( types[type].name=="BNT" || types[type].name=="KIN"){
>                statINV=raw_data[STATUS_A] & ONLINE;
>                statAVR=raw_data[STATUS_A] & AVR_ON;
>                statAVRMode=raw_data[STATUS_A] & AVR_MODE;  <====
>        }
>        if ( types[type].name=="BNT"){
>                if (statINV==0) {
>                        if (statAVR==0){
>                                tmp=2.2*raw_data[OUTPUT_VOLTAGE]-24;
>                        } else {
>                                if (statAVRMode==1)
>                                    ^^^^^^^^^^^^^^
>                                        tmp=(2.2*raw_data[OUTPUT_VOLTAGE]-24)*31/27;
>                                else
>                                        tmp=(2.22*raw_data[OUTPUT_VOLTAGE]-24)*27/31;
>                        }
>
>  AVR_MODE is a constant, =8, so statAVRMode will either be 0 or 8,
>  but not 1.
>
> o the whole logic - calculating voltages etc - seems to be quite
>  suspicious, -- needs some explanations, probably excerpts from
>  the original docs.
>
> There were several more points, but I don't remember which ones
> offhand...
>
> /mjt
>
> _______________________________________________
> Nut-upsdev mailing list
> Nut-upsdev at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/nut-upsdev

--

<Gushi> And hello kitty does not have a mouth.
<bizzy> . o O ( oh yes she does )

EfNet #macintosh, 2/21/01, some ridiculous hour of the morning

--------Dan Mahoney--------
Techie,  Sysadmin,  WebGeek
Gushi on efnet/undernet IRC
ICQ: 13735144   AIM: LarpGM
Site:  http://www.gushi.org
---------------------------




More information about the Nut-upsdev mailing list