NUT + Opti-UPS VS575C + CH341 USB-Serial Stale data

  • The UPS I am using has a 9-pin serial port and it is connected to the PC using a CH341 chipset USB-Serial adapter. This PC has been running NUT successfully on Ubuntu 14.04 LTS so I am confident I don't have a hardware fault.

    pfSense 2.2.1 doesn't have a CH341 driver module so I compiled the module on another FreeBSD 10.1 host. and copied the uchcom.ko to /boot/kernel.

    I load the module on startup using uchcom_load="YES" in /boot/loader.conf.

    On start-up, NUT recognizes the UPS and puts it into a short battery test for a few seconds. The pfSense GUI for NUT shows the battery charge and load bar chart and reports on the input and output voltages. However, in the time it takes to click 'Status', 'Dashboard' and back to NUT, the GUI reports 'Stale data!' and it wont report on data from the UPS again unless the service is restarted.

    I have run upsc ups@localhost on the console immediately after the battery test and got a result page, but the last line of the results show:-

    ups.status: OB TEST

    If I try the command again, I get Stale data as the result.

    I have tried various combinations of
    pollinterval between 2 and 15
    MAXAGE 20 to 25
    DEADTIME 20 to 25
    But all this appears to do is vary the amount of time that the initial data can be reported on by upsc, stale data still results when the set timings elapse.

    I'm not sure what else to try at this point. I suspect that the difference in behaviour between pfSense 2.2.1 and Ubuntu 14.04 with this kit is down to how USB is handled in the kernel. I might put Debian KFreeBSD on the same PC to see if this has the same problem as pfSense.

    The PC does have an available 9-pin RS232 serial port but I don't have a serial cable for the UPS or a pin out table/diagram with the information to make one.

    Possible solutions:-

    1. Buy the OPTI branded USB-Serial adapter - but this may be no better with pfSense.
    2. Buy the OPTI branded serial cable.
    3. Try a few serial cable types or a breakout box to find the pinout by trial and error.
    4. Try to find the root cause of the problem and fix the code - usb - powercom - uchcom?

    I don't want to restart NUT every 5 seconds using cron as this will force the battery to discharge and the repeated relay switching in the UPS isn't going to do it any good.
    Any other suggestions?

  • I have been unsuccessful finding any information on the serial cable pinout required for this UPS. However, I had an idea and have sorted my list with new priorities.

    1. Ask the manufacturer or the local agent for the pinout (waiting for reply)
    2. Try a PL chipset USB-Serial adapter (waiting to arrive by post).
    3. Connect the USB lead to another host running NUT that doesn't have this problem and get it to signal NUT on pfSense over the network instead.
    4. Use a LED serial port tester and breakout box to find the required serial cable pinout for a homemade UPS cable.
    5. Buy the OPTI branded serial cable (Tried and failed!)
    6. Try to find the root cause of the problem and fix the code - usb - powercom - uchcom?

    Opti-UPS online store serves US customers only. I found this cable but they wont ship to the UK.

  • I am still waiting for a reply from my local Opti-UPS agent although I probably don't need it now anyway. I tried a serial cable that I had for a CyberPower Systems UPS which is wired straight for all pins and it works perfectly with the Opti-UPS VS575C.

    The cable is plugged into the first serial port (COM1 in BIOS) and NUT is configured to use the 'Powercom Various' driver on device /dev/cuau0.

    Additional config for ups.conf is as follows:-

    linevoltage = 230;
    manufacturer = Opti-UPS;
    modelname = "VS575C";
    serialnumber = unknown;
    type = OPTI;
    numOfBytesFromUPS = 16;
    methodOfFlowControl = no_flow_control;
    validationSequence = {{5,0xFF},{7,0},{8,0}};
    shutdownArguments = {{1,30},y};
    desc = "Opti-UPS VS575C";

    I am waiting for a PL chipset USB-Serial adapter to arrive and I will report back on how that works after I have tested it. I am probably going to leave this UPS using a real serial cable as I have a spare COM port on the host.