I have a data center where we are working to automate PDU (Power Distribution Unit) access to optimize server uptime. Now, the PDU's that we use have some garbage unified web interface but no actual REST API access. The only way to programmatically access and modify the PDU is through a serial CLI (via SSH).

I would like to create an API on an RPi that allows for me to interact with the PDU through the CLI connection. I'm not very worried about actually communicating via serial, I have experience with that.

The question I do have is that we have 32 of these PDUs, each of which has its own serial access. Is there a system that is kind of a "network switch" for serial connections? Ideally one RPi would be able to interact with all 32 and I'm totally okay with synchronous [non-async] access, i.e. one serial conn at a time.

If there is no real serial aggregator, what options do I have to handle this (beyond having 32 RPi's and patching them together)?


Would something like this work?

  • 1
    32 port usb hub with 32 serial to usb converters?
    – CoderMike
    Nov 24 '20 at 19:30
  • Possibly, I think it's possible to just find a 32 hub serial to single serial breakout panel then use a single USB converter for that.
    – Tug Witt
    Nov 24 '20 at 19:32
  • 2
    Interesting question... the 20 port serial switch you've found is the usual solution for serial ports, and there are several similar products. But I'm confused by the SSH part of it... why couldn't you create 32 SSH sessions in screen or tmux - why would that not work?
    – Seamus
    Nov 24 '20 at 20:21
  • Turns out I think that I can just use Telnet on the IP addresses of each PDU, and make some API on my RPi that speaks Telnet to a specific PDU. Their docs are absolutely horrible, I thought serial was the only option.
    – Tug Witt
    Nov 24 '20 at 20:30
  • forget the RPi and develop an interface on your workstation
    – jsotola
    Nov 25 '20 at 0:41

I'm pretty sure that the serial switch you have found will work. After all, from the master side it's just a serial device replying to AT commands.

If the target serial devices you plan to connect are themselves using AT commands, you'll have to be careful about escaping such commands so that the switch doesn't try to process commands you send to target devices.

Also, since on the master side the whole switch is just a single port, there will be no way to talk to several devices at once. If you need that, a multi-port hub with a bunch of USB->UART converters will be needed. Keep in mind that USB communication is polling-based, so the number of devices you can add to a bus before it saturates is limited, and handling 32 UART converters connected to a single Pi will likely be too much.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.