[Nut-upsdev] Megatec driver : Definitely a serial com setup issue !

Carlos Rodrigues cefrodrigues at mail.telepac.pt
Sat Jun 28 18:50:51 UTC 2008


On Tue, May 27, 2008 at 8:03 AM, Arjen de Korte <nut+devel at de-korte.org> wrote:
>>> Try if setting the lines
>>> ser_set_dtr(upsfd, 0);
>>> ser_set_rts(upsfd, 1);
>>> in upsdrv_initups() in 'megatec.c' helps.
>>
>> Thank you Arjen, it solves the issue and the Megatec driver immedately
>> sees my
>> UPS with this.
>>
>> Strange enough, the original megatec.c had exactly the (not working)
>> contrary :
>>
>> ser_set_dtr(upsfd, 1);
>> ser_set_rts(upsfd, 0);
>>
>> ...a bug ?
>
> These lines are used for cable power. Since there is no standard defined
> by the megatec protocol, anything goes here (so technically speaking, this
> is not a bug). Different vendors will implement this in sometimes
> incompatible manner, especially if they also support 'dumb' contact
> closure interfaces (see for examples the genericups driver). Having said
> this, we should probably make this configurable to allow users to override
> the default setting (cablepower = RTS -DTR).

I've added two parameters ("dtr" and "rts") do do this. Can someone
please test if it is enough?


-- 
Carlos Rodrigues



More information about the Nut-upsdev mailing list