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

Arjen de Korte nut+devel at de-korte.org
Tue May 27 07:03:57 UTC 2008


>> 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).

Best regards, Arjen




More information about the Nut-upsdev mailing list