I have a requirement wherein I have a third party device that can connect to my computer either via USB directly, or via a USB-Serial Converter depending on it's mode.
There is a special command I send to the device via serial to make it switch modes.
What I do currently, is switch the devices' mode by sending the appropriate command over PuTTy and then remove the Serial converter and connect it directly via a USB cable.
I was thinking that I could use the Arudino as a sort of intermediary device which will act as a Serial-USB converter (because my Arduino already has an FTDI on-board so I can just make a Soft Serial that mimics all the data that is received on Hardware Serial and vice versa) and when the Arduino sees the specific command being sent (the one that changes modes) it activates a relay or a switch that will change the connection to a direct USB.
I could then use some logic such as check when the device is rebooting to switch back to Serial mode, or even just hit the resest switch on the Arduino.
Questions:
Can the Arduino act as a Serial repeater even at 115200 baud?
Is using relays an effective way to swtich between USB and Serial?
Is there any other (more effective) way to do this?
@septillion:
Well, my 3rd party device acts something like an MTP (Media Transfer Protocol) device when I connect it directly to the PC.
When I connect it to the PC via a USB-Serial Converter, I can use PuTTy to send something like AT commands to change it's configuration.
Right now, when I change the configuration, I manually have to plug OUT the serial converter and plug in the direct USB cable to check if the new configuration works. I am trying to automate this testing, and that's why I want to do this seamlessly.
Do you think it's possible?
@Robin2:
How well do these Hardware serials work in tandem?
Would I be able to use the Arduino as a repeater i.e. Read the incoming data on HWSerial1 and send the same data out on HWSerial2, and vice-versa?