USB Device (Leonics UPS) Loses Connection

Buadhai

macrumors regular
Original poster
Jan 15, 2018
126
48
Korat, Thailand
2017 iMac Running Mojave

I realize that this is a long shot.

I recently purchased a Leonics Green 1200V UPS. The software the vendor offered didn't work with Mojave, so the manufacturer suggested ViewPower HTML which works. Sort of. Unfortunately, every few days the software loses connection with the UPS. It attempts to reconnect, but always fails. Here's a log fragment.

Code:
ID:gnu.io.CommPortIdentifier@38314069
[2019-07-30 11:46:48]----search--USB--Port ID array:
[2019-07-30 11:46:48]----search--COM--Port ID:gnu.io.CommPortIdentifier@9196c38
[2019-07-30 11:46:51]Command:M-----Exception: Receive time out!
[2019-07-30 11:46:52]Command:M-----Exception: Receive time out!
[2019-07-30 11:46:54]Command:M-----Exception: Receive time out!
[2019-07-30 11:46:55]Command:M-----Exception: Receive time out!
The Mac System Report shows that the device is still connected:

Code:
USB to Serial:
Product ID:    0x5161
Vendor ID:    0x0665
Version:    0.02
Speed:    Up to 1.5 Mb/sec
Manufacturer:    INNO TECH
Location ID:    0x14644000 / 16
Current Available (mA):    500
Current Required (mA):    100
Extra Operating Current (mA):    0

The only fix I've discovered is to restart the Mac after which the software communicates with the UPS just fine. Until it doesn't. Resetting the SMC didn't help. I suppose because the hardware does connect with the device.

Any ideas?
 

Buadhai

macrumors regular
Original poster
Jan 15, 2018
126
48
Korat, Thailand
Do you actually need the software?

I'm using an APC UPS and it's just detected by macOS automatically.
Yes. The Mac OS does not detect this UPS. I had high hopes, but they were soon dashed. Nothing in the Energy Saver panel.

Is there anything I can do to help the Mac detect this UPS?
 

Stephen.R

macrumors 65816
Nov 2, 2018
1,377
908
Thailand
Is there anything I can do to help the Mac detect this UPS?
Hmm. Well sawasdee, I didn't even notice your location before!

As for the UPS - I imagine the software that works sporadically runs as a LaunchDaemon, so you could try restarting it. In a console (Terminal.app) try
Code:
launchctl list | cut -f 3 | grep -v 'com.apple' | sort
(this lists third party things started via launchd) and see if you can see their software listed.

Post back with what you find.
 

Buadhai

macrumors regular
Original poster
Jan 15, 2018
126
48
Korat, Thailand
Hmm. Well sawasdee, I didn't even notice your location before!

As for the UPS - I imagine the software that works sporadically runs as a LaunchDaemon, so you could try restarting it. In a console (Terminal.app) try
Code:
launchctl list | cut -f 3 | grep -v 'com.apple' | sort
(this lists third party things started via launchd) and see if you can see their software listed.

Post back with what you find.
Sawasdee and thank you for the suggestion.

The software itself keeps running, it just loses contact with the UPS. As the log file fragment I posted shows, it keeps trying to connect, but fails.

The launchd plist just runs a script which I reproduce here in case it gives any further hints:

Code:
#!/bin/bash
pid=$(netstat -an|grep 51099|awk '{print $4}')
echo $pid
b=''
if [[ $pid = $b ]];then
        echo "no ups have been running!"
        open /Applications/ViewPowerHTML1.02/ViewPower.app/
    else
        echo "a ups monitor have been running!"
        exit 0
fi
All it seems to do is check to see if the port it uses is open. If not it starts the application.

BTW, I live in Korat. And you?