Open xxxcrow opened 1 year ago
I guess you need to run socat
to forward the raw UDP data to the terminal first, then connect to it with screen
With that said, I still don't know what you want to do. Could you please describe how you use your serial device more clearly?
Assuming that you need to access the serial device remotely, and you have an Android device, then you can follow these steps:
socat -dd pty,wait-slave udp4:192.168.0.11:18888
. Replace the IP address 192.168.0.11
with your phone's and replace the port with the one you set in step 2. You will see something like socat[xxxx] N PTY is /dev/pts/0
screen /dev/pts/0
. Make sure the /dev/pts/0
matches the path at the end of step 3@wh201906 I have an nrf52840, on desktops I'm using screen to communicate But on android, with some firmwares i'm able to use "serial to telnet" app, but with some it doesn't want to work, so I hope your project can work with the latter
@wh201906 oh, so you're saying this app is for a remote access to the serial
It can be used for accessing the USB serial device on Android too.
Assuming that you need to access the serial device in Termux, then you can follow these steps:
screen
to open a new session, then run socat -dd pty,wait-slave udp4:localhost:18888
. Replace the port with the one you set in step 2. You will see something like socat[xxxx] N PTY is /dev/pts/0
Ctrl + A
then D
to detach the session running socat
, then run screen /dev/pts/0
. Make sure the /dev/pts/0
matches the path at the end of step 3Iād like to promote my project there.
If you don't need a full terminal experience when using the serial device, you should try SerialTest. This app supports Linux and Android. Although it doesn't support USB serial device on Android, you can use SerialPipe as a USB to UDP bridge and open the UDP connection in SerialTest directly, so you don't need socat
to forward the UDP
But on android, with some firmwares i'm able to use "serial to telnet" app
Would you mind telling me what the "serial to telnet" app is? I think the SimpleUsbTerminal might also be helpful for you.
I think the SimpleUsbTerminal might also be helpful for you.
First time I see this app, they are probably not on any of fdroid repos
Would you mind telling me what the "serial to telnet" app is?
https://github.com/ClusterM/usb-serial-telnet-server
Assuming that you need to access the serial device in Termux, then you can follow these steps:
I can try again, but after your first tutorial I already tried this, didn't work š«
First time I see this app, they are probably not on any of fdroid repos
There is a Google Play link in the README. You can still try it if you wish.
I can try again, but after your first tutorial I already tried this, didn't work š«
I only tested it by shorting the Tx pin and Rx pin of a CH340 and checking if my input has echo. It did work as expected.
@wh201906 I don't use google play, it's easier for me to download from a git repo
I tested again, screen connects, socat responds that somebody is connected But screen has no output or input Maybe it would work with other firmwares, but it's like that with the one I tested
I don't use google play, it's easier for me to download from a git repo
You can try some APK downloader like this
I tested again, screen connects, socat responds that somebody is connected
You could add -x
or -v
option in socat
to check if there is data flowing over it.
Is there a way to access this from a port that doesn't need root permissions? I'm using Proot-distro and it's giving me a Permission denied error everytime I try to connect to /dev/pts/0
Hi, it seems like your project is exactly what I was looking for (and gave up looking for š )
I have a serial device, usually I connect to it with
screen /dev/...
But how do I connect to this UDP? Thank you