[Nut-upsdev] REGRESSION: New "megatec" driver does't work for UPS that was managed by old fentonups driver

Michel Bouissou michel-nut at bouissou.net
Mon May 19 06:06:16 UTC 2008


Hi Carlos,

Le lundi 19 mai 2008, Carlos Rodrigues a écrit :
>
> Can you post the output of "megatec -DDD -a yourups" ?

# /lib/nut/megatec -DDD -a Alpha
Network UPS Tools 2.2.1- - Megatec protocol driver 1.5.13 [megatec]
Carlos Rodrigues (c) 2003-2007

debug level is '3'
Starting UPS detection process...
Asking for UPS status [Q1]...
Q1 => FAILED [timeout]
Asking for UPS status [Q1]...
Q1 => FAILED [timeout]
Asking for UPS status [Q1]...
Q1 => FAILED [timeout]
Asking for UPS status [Q1]...
Q1 => FAILED [timeout]
Asking for UPS status [Q1]...
Q1 => FAILED [timeout]
5 out of 5 detection attempts failed (minimum failures: 2).
Megatec protocol UPS not detected.


...Where the "old" fentonups drivers gives :

# /lib/nut/fentonups -DDD -a Alpha
Network UPS Tools - Fenton UPS driver 1.22 (2.0.5)
This driver is obsolete and has been replaced by the "megatec" driver. It will 
be removed somewhere in the near future.
debug level is '3'
Detected Alpha 500 iC on /dev/ttyS0
dstate_init: sock /var/run/nut/Alpha open on fd 5


This reminds me that the fisrt thing I had ever fixed in the past in the 
fentonups driver was an obscure bug in the RS232 synchronisation protocol: 
the driver was changing port speed then sending the *next* character in the 
init sequence where it should have resent the sequence from start, thus it 
was never seing the UPS. I haven't yet taken a look at the megatec code, 
could there be a similar issue ?

The RS232 init fix to fentonups, by that time, was :

@@ -159,9 +175,9 @@
                        continue;
                }

-               if (temp[i] != '#') {
+               if (temp[0] != '#') {
                        upslogx(LOG_ERR, "Bad UPS info start character [%c]",
-                               temp[i]);
+                               temp[0]);
                        continue;
                }


...but of course I don't know if this can be relevant or not for megatec.

For the time being, should I be able to use the old fentonups driver with the 
new nut package ?

Best regards.

-- 
Michel Bouissou <michel at bouissou.net> OpenPGP ID 0xEB04D09C

ananteperforoculien : mal réveillé



More information about the Nut-upsdev mailing list