UPS, 2X NAS, USB

From: CHYRON (DSMITHHFX) 2 Dec 2020 14:16
To: ALL1 of 19
We have a NAS appliance (at work) attached to a UPS 'cause it don't like power outs. We bought another NAS, and when I went to add it to the UPS, I realized it (UPS) has only one USB port, the idea being that the attached device will signal other devices over the LAN yadda ... won't work for us because, when the power goes down, so does our LAN. (the good news is: when the NAS's aren't RAID-thrashing, power usage goes down to trickle, and the UPS can comfortably keep both devices powered for an hour)

Soooooo what does teh tech guru(s) think of using a USB hub in this case -- feasible? Problems?
From: william (WILLIAMA) 2 Dec 2020 17:39
To: CHYRON (DSMITHHFX) 2 of 19
It is taking me some time to work out what you are asking. So the UPS uses its USB port to tell some attached computer (NAS) that it's providing power now instead of the wall socket. But the NAS can't signal this news over the LAN because you lose your LAN in a power cut. Don't really see why you are worse off by adding another NAS. The only difference is that you have two boxes that can't use the LAN if the power goes down rather than one.

Edit: or was adding the second NAS what made you spot the issue? Probably not, because if that was the case you wouldn't be asking about a hub. Hmmm.
EDITED: 2 Dec 2020 17:44 by WILLIAMA
From: ANT_THOMAS 2 Dec 2020 20:17
To: CHYRON (DSMITHHFX) 3 of 19
If I'm reading it right, that's not how USB hubs work.
Add a small network switch the UPS power so they can still talk to each other?
From: CHYRON (DSMITHHFX) 3 Dec 2020 11:45
To: william (WILLIAMA) 4 of 19
The idea of the UPS is that with the original NAS, a hard shutdown causes file system errors, not that the NAS is inaccessible over the LAN.

ANT: yes, that is exactly how the USB port works in this case (alternatives are a serial port that does the same thing, BUT you can only use one of the ports at a time).

This is the UPS in question

https://www.cyberpowersystems.com/product/ups/smart-app-sinewave/pr750lcd/

The NASs are different makes/models, but both support detection of the UPS, and setting UPS options (minutes to power down etc) in their respective webmin.

What I'm asking is: would there be a downside to using a hub (aka 'splitter'), so multiple attached devices (in this case two) can receive the same power status signals broadcast by the UPS over ... usb.

As explained, the LAN is out.

Edit: I did open a ticket with Cyberpower on Friday and their response was just as flummoxed. WHY IS THIS SO HARD, PEOPLE?  T_T
EDITED: 3 Dec 2020 12:38 by DSMITHHFX
From: ANT_THOMAS 3 Dec 2020 14:37
To: CHYRON (DSMITHHFX) 5 of 19
I must have misunderstood.

You're trying to connect one USB device (the UPS) to two computers? And they both need to know what the UPS is telling them?
From: ANT_THOMAS 3 Dec 2020 14:38
To: CHYRON (DSMITHHFX) 6 of 19
Is the LAN out if you add a network switch to the UPS?
From: CHYRON (DSMITHHFX) 3 Dec 2020 16:11
To: ANT_THOMAS 7 of 19
Yeah, I don't want to reconfigure the lan, just give the two NAS file servers an opportunity to gracefully shutdown.

I think I'll just stick the hub in there and see if it works. One odd issue: the original NAS still reported the UPS as connected, even after I disconnected it from the usb and rebooted it. Anyhoo, the new NAS detected the UPS usb connection ok.
From: koswix 4 Dec 2020 08:27
To: ALL8 of 19
Does it depend on which device is acting as the host? If it's the UPS then should maybe work, if it's the NAS then you'll have two hosts on one USB and things will cry.
From: william (WILLIAMA) 4 Dec 2020 08:59
To: CHYRON (DSMITHHFX) 9 of 19
Yeah, I understand why you have a UPS, I just didn't get what you were asking. It does look like the common way of doing this is to have one NAS with the USB connection as a primary (Network UPS Server) and then use one of a variety of tools to set the new NAS as a slave to it. But this relies on the network being available - which in your case you won't have. 

I suppose it depends on whether the UPS does some sort of pairing via USB and only allows one pair.
From: Matt 4 Dec 2020 13:07
To: koswix 10 of 19
This.

In my experience, the UPS will be a downstream device (think printer, thumbstick, etc.) and you will optionally have some software (usually built into the OS) that detects the change in power source from the UPS and displays that to the user or logged somewhere.

It's unlikely to work the other way around.
From: ANT_THOMAS 4 Dec 2020 18:24
To: Matt 11 of 19
Glad I'm not going crazy.
From: CHYRON (DSMITHHFX) 4 Dec 2020 20:15
To: Matt 12 of 19
The NAS doesn't talk to the UPS, it's the other way around. The UPS does all the talking, the attached NAS/PC/whatever just listens and reacts to whatever the UPS is telling it. On USB. That's why I suppose a hub might work.
EDITED: 4 Dec 2020 20:15 by DSMITHHFX
From: ANT_THOMAS 5 Dec 2020 16:38
To: CHYRON (DSMITHHFX) 13 of 19
Much like a flatbed scanner talks to a computer and sends the image to the computer and not the other way around, you can't connect the scanner to two computers simultaneously.
Or a mouse, or a keyboard.

It'll still be two way communication. Host (NAS) and Device (UPS).
I'd love to see it work, but my guess is it won't.
From: CHYRON (DSMITHHFX) 5 Dec 2020 17:55
To: ANT_THOMAS 14 of 19
And a printer?
From: ANT_THOMAS 5 Dec 2020 21:02
To: CHYRON (DSMITHHFX) 15 of 19
Plugged into two computers at once over USB? Never seen it.
From: Peter (BOUGHTONP) 5 Dec 2020 22:16
To: ALL16 of 19
What does the UPS use to send the signal?

Can you connect the NASes together via USB and generate the same signal via software?

(Or just attach the switch to the UPS so the network doesn't go down, and you can do it with SSH.)

From: CHYRON (DSMITHHFX) 6 Dec 2020 07:54
To: Peter (BOUGHTONP) 17 of 19
I don't know, I guess whatever bus is in use or it blindly fires away on them all. There might be a way to do what you suggest (chain the devices via usb), but the custom code angle would be beyond my ken. I'll sniff around here http://www.apcupsd.org
From: Matt 6 Dec 2020 20:02
To: CHYRON (DSMITHHFX) 18 of 19
Indeed, but the USB spec doesn't allow what you want to do, even with a hub which itself counts as being a downstream device.

While you can have multiple downstream devices connected to one upstream you cannot have multiple upstream devices connected to one downstream. There are workarounds to this, like USB switches but these still only allow one upstream device. Pushing a button on the switch disconnects one upstream device and connects the other. The two upstream devices are never connected at the same time.

I wouldn't pursue what you're thinking. But what I would look into is having something as an intermediary device (think Raspberry Pi) that can be connected to the NAS and receive it's notifications and then communicate them over ethernet to the two or more upstream devices.
EDITED: 6 Dec 2020 20:03 by MATT
From: CHYRON (DSMITHHFX) 6 Dec 2020 21:34
To: Matt 19 of 19
OK thanks.