Serial Communication Via USB

I’m trying to recreate this script to work in the Linux Envirnment and Failing. I’m not sure what I am missing

Windows Script

    set a=8
    mode com%a% baud=115200 parity=n data=8 stop=1 to=off xon=off odsr=off octs=off dtr=off rts=off idsr=off
    type program.rec >\\.\COM%a%

What I’ve done so far

chmod a_rw /dev/ttyUSB0
stty -F /dev/ttyUSB0 115200 cs8 -cstopb -parenb
echo program.rec > /dev/ttyUSB0

This is my first time dealing with ports at all in Linux and I feel like I hit a wall. Any tips or direction would be nice. Thank you.

try instead:

chmod a+rw

instead of executing the echo line, provide the output to:

stty --file=/dev/ttyUSB0

:thinking:

I don’t think I understand. How would changing the stdin to the USB, write the send the data to the USB. I would still need an echo or cat command.

the “chmod” error was just a typo in the forum.

Just provide it at the command line and provide the output, and see if you get a prompt please?

[~]$ stty --file=/dev/ttyUSB0
speed 115200 baud; line = 0;
-brkint -imaxbel

Other information that may be helpful
[~]$ lsusb
Bus 002 Device 006: ID 0403:6010 Future Technology Devices International, Ltd FT2232C/D/H Dual UART/FIFO IC

Output after a connect, a disconnect, and a reconnect
[~]$ dmesg | grep tty
[ 1087.680848] usb 2-1.1: FTDI USB Serial Device converter now attached to ttyUSB0
[ 1087.683741] usb 2-1.1: FTDI USB Serial Device converter now attached to ttyUSB1
[ 1643.564219] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[ 1643.564522] ftdi_sio ttyUSB1: FTDI USB Serial Device converter now disconnected from ttyUSB1
[ 1653.544707] usb 2-1.1: FTDI USB Serial Device converter now attached to ttyUSB0
[ 1653.547870] usb 2-1.1: FTDI USB Serial Device converter now attached to ttyUSB1

To any future readers,

I never found a solution. I ended up just using a windows machine.