Serial Port component and virtual terminal like /dev/pts/12 on linux

Quote from Panda1967 on February 3, 2025, 9:15 amHi. I would like to test the link between a Serial Port component and a window terminal on Linux. I run the terminal with the command:
xterm -baudrate 9600
related with the virtual device /dev/pts/12. I used the same device as port name for the Serial Port. Also I connected the Tx and Rx of the Serial Port with the Rx and Tx of Arduino uno board and opened the Serial Monitor of both the Serial Port and the Arduino. I can open the Serial Port and the Tx and Rx became red but when I start the simulation, nothing appends.
What I am doing wrong?
Massimo
Hi. I would like to test the link between a Serial Port component and a window terminal on Linux. I run the terminal with the command:
xterm -baudrate 9600
related with the virtual device /dev/pts/12. I used the same device as port name for the Serial Port. Also I connected the Tx and Rx of the Serial Port with the Rx and Tx of Arduino uno board and opened the Serial Monitor of both the Serial Port and the Arduino. I can open the Serial Port and the Tx and Rx became red but when I start the simulation, nothing appends.
What I am doing wrong?
Massimo

Quote from arcachofo on February 4, 2025, 9:23 amHi.
I think you can't use the same port in xterm and simulide.
You need to create a link between 2 virtual serial ports and connect each app to one end.
For example in Linux you can use socat:sudo socat PTY,link=/dev/ttyS1,mode=0666 PTY,link=/dev/ttyS2,mode=0666
Then connect xterm to /dev/ttyS1 and simulide to /dev/ttyS2
Hi.
I think you can't use the same port in xterm and simulide.
You need to create a link between 2 virtual serial ports and connect each app to one end.
For example in Linux you can use socat:
sudo socat PTY,link=/dev/ttyS1,mode=0666 PTY,link=/dev/ttyS2,mode=0666
Then connect xterm to /dev/ttyS1 and simulide to /dev/ttyS2

Quote from Panda1967 on February 5, 2025, 2:04 amHola,
I run as root:
socat -v PTY,link=/dev/ttyS1,mode=0666 PTY,link=/dev/ttyS2,mode=0666
I connected
Screen (Linux)-> /dev/ttyS1
screen /dev/ttyS1 38400
I connected:
Serial Port (SimulIDE) -> /dev/ttyS2
I set Baudrate to 38400.
I started simulation and open the Serial Port of SimulIDE.
I verified that both serial port have 38400 baudrate:
root@margherita:/tmp# stty -F /dev/ttyS1
speed 38400 baud; line = 0;
min = 100; time = 2;
-icrnl -imaxbel
-opost -onlcr
-isig -icanon -echo
root@margherita:/tmp# stty -F /dev/ttyS2
speed 38400 baud; line = 0;
min = 0; time = 0;
-brkint -icrnl -imaxbel
-opost
-isig -icanon -iexten -echo
I wrote "Ciao" on the Screen terminal and I read "Ciao" on the right panel of Serial Monitor of SimulIDE. That is OK!
Socat prints:
root@margherita:/tmp# socat -v PTY,link=/dev/ttyS1,mode=0666 PTY,link=/dev/ttyS2,mode=0666
> 2025/02/05 02:54:17.509435 length=1 from=0 to=0
C> 2025/02/05 02:54:18.055627 length=1 from=1 to=1
i> 2025/02/05 02:54:18.199646 length=1 from=2 to=2
a> 2025/02/05 02:54:18.470713 length=1 from=3 to=3
o>
I wrote "Ciao" on the letf panel of Serial Monitor of SimulIDE but NOTHINGS appears on the the Screen terminal. Also socat doesn't print anything. The connection appears to be not bidirectional. Why?
Massimo
Hola,
I run as root:
socat -v PTY,link=/dev/ttyS1,mode=0666 PTY,link=/dev/ttyS2,mode=0666
I connected
Screen (Linux)-> /dev/ttyS1
screen /dev/ttyS1 38400
I connected:
Serial Port (SimulIDE) -> /dev/ttyS2
I set Baudrate to 38400.
I started simulation and open the Serial Port of SimulIDE.
I verified that both serial port have 38400 baudrate:
root@margherita:/tmp# stty -F /dev/ttyS1
speed 38400 baud; line = 0;
min = 100; time = 2;
-icrnl -imaxbel
-opost -onlcr
-isig -icanon -echo
root@margherita:/tmp# stty -F /dev/ttyS2
speed 38400 baud; line = 0;
min = 0; time = 0;
-brkint -icrnl -imaxbel
-opost
-isig -icanon -iexten -echo
I wrote "Ciao" on the Screen terminal and I read "Ciao" on the right panel of Serial Monitor of SimulIDE. That is OK!
Socat prints:
root@margherita:/tmp# socat -v PTY,link=/dev/ttyS1,mode=0666 PTY,link=/dev/ttyS2,mode=0666
> 2025/02/05 02:54:17.509435 length=1 from=0 to=0
C> 2025/02/05 02:54:18.055627 length=1 from=1 to=1
i> 2025/02/05 02:54:18.199646 length=1 from=2 to=2
a> 2025/02/05 02:54:18.470713 length=1 from=3 to=3
o>
I wrote "Ciao" on the letf panel of Serial Monitor of SimulIDE but NOTHINGS appears on the the Screen terminal. Also socat doesn't print anything. The connection appears to be not bidirectional. Why?
Massimo

Quote from arcachofo on February 5, 2025, 12:51 pmNot sure what are you doing exactly.
As I understand you are connecting an Arduino with a terminal app in your computer.
So you need to send data from the Arduino firmware.Also not sure which version of simulide are you using, probably not the last stable.
Not sure what are you doing exactly.
As I understand you are connecting an Arduino with a terminal app in your computer.
So you need to send data from the Arduino firmware.
Also not sure which version of simulide are you using, probably not the last stable.

Quote from Panda1967 on February 5, 2025, 2:43 pmIn my second post I used only the Serial Port with his Serial Monitor for writing and reading. I didn't use arduino. In order to send bytes from SimulIDE to Screen terminal I wrote text into the left panel of the Serial Monitor but nothing appears on the Screen terminal. Instead what I write on the Screen terminal appers on the right panel of the Serial Monitor.
My version of SimulIDE is:
1.1.0 Rev. 2094
17-12-23
Massimo
In my second post I used only the Serial Port with his Serial Monitor for writing and reading. I didn't use arduino. In order to send bytes from SimulIDE to Screen terminal I wrote text into the left panel of the Serial Monitor but nothing appears on the Screen terminal. Instead what I write on the Screen terminal appers on the right panel of the Serial Monitor.
My version of SimulIDE is:
1.1.0 Rev. 2094
17-12-23
Massimo

Quote from arcachofo on February 5, 2025, 3:05 pmOk, I see..
Serial Port component is not meant to send data by itself, just to connect some other component to a serial port in your PC.
About Simulide version:
Maybe you should use the last stable version, seems you are using some older unstable version.
Ok, I see..
Serial Port component is not meant to send data by itself, just to connect some other component to a serial port in your PC.
About Simulide version:
Maybe you should use the last stable version, seems you are using some older unstable version.