I have 5 home built LiFePO4 batteries that all use a JBD BMS. The BMS' have a single UART port that is used to connect to either a Bluetooth module or a UART to USB adapter. I currently connect to the Bluetooth module with an iPhone application to read status' and configure the BMS. But I normally only do that sporadically, as needed, and when I happen to be in Bluetooth range. I have also implemented an Arduino (w/Ethernet shield) based reader that connects to the UART port and reads various bits of information from the JBD BMS. This info is logged to a remote RPi based database. And I have a web server running that allows me to remotely view the BMS' current (no pun intended) information. This all works nicely.
But, this set up also means that if I want to log data to the DB or use the Bluetooth app I need to manually switch the device connected to the BMS UART port.
What I'd like to do is come up with an Arduino based way to have both UART devices (Bluetooth dongle and UART to Arduino dongle) connected to the BMS at the same time, and use a toggle switch to switch between them. I would use the switch any time I'm in Bluetooth range and need to do configuration changes. But i'd generally have the Arduino sketch running to read the BMS and log data to the remote RPi based database.
FYI, the 5 batteries (and BMS') are located in different buildings but are all on the same LAN. Because they're all a fair distance apart (one is using a microwave link between building as it's over 1000 feet distant) it is inconvenient to walk around to see the status of each battery back. I already have a NodeMCU device monitoring voltage at each battery back, but being able to read the BMS directly would give me access to LOTS more battery status info.
I was originally looking for a "three way" relay (NO/NC/NO) thinking I could rig up 4 of them, one for each UART line, and then use the Arduino to switch between connected devices, but I don't think they make a relay that will work (at least not that I can find), or not without needing to jerry-rig 8 relays to come up with an equivalent set up. With 5 batteries that a lot of relays!
Anyway, any ideas on a way to get this accomplished at a reasonable cost?