- A Raspberry PI Zero or a Raspberry PI 4.
- Using socat, commands we will redirect Serial data received over IP to the Gadget Serial port or data from the on-board UART protocol to the Gadget port. You will find out how to turn your Raspi to a Serial USB Gadget, and how to control what you redirect to the Gadget’s Serial port in order to be available to the machine it will connect to. The current tutorial takes a different approach.
Almost all of those tutorials explain how to setup your Raspberry as a Serial Console, which will act similar to a SSH connection. I've never been known to leave a rabbit hole untill all the rabbits have been "dealt" with, so in a future post I'll try to add some systemd stuff and try to have socat execute CodeConsole instead using the serial connection, as well as trying to have socat execute ssh to setup the far side all in one command (maybe).There are many tutorials explaining how to set up your Raspberry PI as a Serial Device.
There are probably some of you that have improvements to suggest and I welcome those. The above was all tested and found working. Having done that I realize I could then move the FTDI USB to TTL adapter and PanelDue to any machine on my network and bridge the serial port over $ socat /dev/ttyACM0,raw,echo=0,b115200 socat -d -d /dev/ttyUSB1,raw,echo=0,b57600 $ socat -lm -d -d TCP-LISTEN:2323,fork socat -d -d /dev/ttyUSB1,raw,echo=0,b57600 tcp:duet3.local:2323 This got me thinking, we could forward the Duet's serial port to a TCP port, this should give access to the console even if DSF is not $ socat /dev/ttyACM0,raw,echo=0,b115200 $ socat -lm -d -d TCP-LISTEN:23,fork EXEC:/opt/dsf/bin/CodeConsole,su=root,pty,stderr Socat /dev/ttyUSB0,raw,echo=0,b57600 $ socat -lm /dev/ttyUSB0,raw,echo=0,b57600 EXEC:/opt/dsf/bin/CodeConsole,su=root,pty,stderr
dev/USB0 is the (FTDI) USB to TTL, and /dev/ACM0 is the Duet (USB) serial port: After realizing socat didn't care I had beforehand set baud rates with stty it worked just fine. The easy solution would be to glue the two serial ports together. The Pi has both the SPI connection, and the (USB) serial connection. The first scenario was having the PanelDue attached to a USB to TTL adapter on the Raspberry Pi that was connected to the Duet. Anyways, I'll list a few commands below that may or may not be useful to others trying to solve interesting problems in interesting ways. and went down this rabbit hole trying to use a PanelDue with an unsupported Duet3 prototype. Disclaimer I just know enough to be dangerous.