Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6136

Emulate ttyS0 on Ubuntu 22 or link it to ttyUSB0 [closed]

$
0
0

I have a JAVA code that checks if ttyS0 is present:

OpenJDK Server VM warning: You have loaded library /home/alex/MYSRT3/lib/libLinuxSerialParallel.so which might have disabled stack guard. The VM will try to fix the stack guard now.It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.Exception in thread "main" java.lang.RuntimeException:   Error opening "/dev/ttyS0"  tcgetattr(): Input/output error    at com.sun.comm.LinuxDriver.getCommPort(LinuxDriver.java:66)    at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:369)    at sport.<init>(sport.java:41)    at srt.main(srt.java:152)

My laptop doesn't have it. How do I emulate this port, eg. using socat or screen or anything else? I tried a few things I found, but the code still cant find it.

This is what is not working for me:

tio /dev/ttyS0sudo busybox microcom -t 2400 /dev/ttyS0socat PTY,link=ttyS0,raw,echo=0 -sudo socat stty -f /dev/ttys0 2400

Or maybe there is a way to link ttyS0 to ttyUSB0? This would also do, since our device is connected to USB via USB/RS232 adapter.


Viewing all articles
Browse latest Browse all 6136

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>