bridge between UDP and serial doesn't work
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I've created a bridge between UDP and serial port using socat
. Here is what I have
socat -xv udp4:localhost:54321 open:/dev/ttyUSB1,rawer,lockfile=/tmp/s1.locak,echo=1,b115200,crnl
To monitor data I run
tcpdump -i any -vnn port 54321
To send data I run
echo -n "hello world" | nc -4u -w1 localhost 54321
I do see data going into UDP but I don't see anything coming out of serial. Shouldn't socat
options -x
and -v
display the data? If I understand it correctly, socat
doesn't display any data because there is not data flowing from UDP to serial.
Just to make sure that I'm not missing anything, I actually connected an oscilloscope to the serial lines to monitor the data physically. But I didn't see anything.
Has anyone had any experience bridging UDP and serial? I would really appreciate any help with this. Maybe there is another way of doing what I'm doing? Any help is appreciated.
EDIT
Here is what I want to do
Device | Serial | PC
|------------------|
Map Network to| | Map network to Serialport
Serial Port| | SerialPort
| |
SerialPort| |
serial-port udp socat
add a comment |Â
up vote
1
down vote
favorite
I've created a bridge between UDP and serial port using socat
. Here is what I have
socat -xv udp4:localhost:54321 open:/dev/ttyUSB1,rawer,lockfile=/tmp/s1.locak,echo=1,b115200,crnl
To monitor data I run
tcpdump -i any -vnn port 54321
To send data I run
echo -n "hello world" | nc -4u -w1 localhost 54321
I do see data going into UDP but I don't see anything coming out of serial. Shouldn't socat
options -x
and -v
display the data? If I understand it correctly, socat
doesn't display any data because there is not data flowing from UDP to serial.
Just to make sure that I'm not missing anything, I actually connected an oscilloscope to the serial lines to monitor the data physically. But I didn't see anything.
Has anyone had any experience bridging UDP and serial? I would really appreciate any help with this. Maybe there is another way of doing what I'm doing? Any help is appreciated.
EDIT
Here is what I want to do
Device | Serial | PC
|------------------|
Map Network to| | Map network to Serialport
Serial Port| | SerialPort
| |
SerialPort| |
serial-port udp socat
Related - this shows a TCP to serial connector - stackoverflow.com/questions/22624653/â¦. I'd start with this and confirm that it works, and then mix in the UDP.
â slmâ¦
Jul 11 at 20:43
Another related - stackoverflow.com/questions/29207980/â¦.
â slmâ¦
Jul 11 at 20:46
2
It looks likeudp4:
is for sending out data over UDP. Since you wantsocat
to listen for incoming UDP packets, perhaps replaceudp4:
withudp4-listen:
.
â telcoM
Jul 11 at 20:47
1
@slm I have a different structure. Will edit the post to show what I mean
â flashburn
Jul 11 at 20:53
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I've created a bridge between UDP and serial port using socat
. Here is what I have
socat -xv udp4:localhost:54321 open:/dev/ttyUSB1,rawer,lockfile=/tmp/s1.locak,echo=1,b115200,crnl
To monitor data I run
tcpdump -i any -vnn port 54321
To send data I run
echo -n "hello world" | nc -4u -w1 localhost 54321
I do see data going into UDP but I don't see anything coming out of serial. Shouldn't socat
options -x
and -v
display the data? If I understand it correctly, socat
doesn't display any data because there is not data flowing from UDP to serial.
Just to make sure that I'm not missing anything, I actually connected an oscilloscope to the serial lines to monitor the data physically. But I didn't see anything.
Has anyone had any experience bridging UDP and serial? I would really appreciate any help with this. Maybe there is another way of doing what I'm doing? Any help is appreciated.
EDIT
Here is what I want to do
Device | Serial | PC
|------------------|
Map Network to| | Map network to Serialport
Serial Port| | SerialPort
| |
SerialPort| |
serial-port udp socat
I've created a bridge between UDP and serial port using socat
. Here is what I have
socat -xv udp4:localhost:54321 open:/dev/ttyUSB1,rawer,lockfile=/tmp/s1.locak,echo=1,b115200,crnl
To monitor data I run
tcpdump -i any -vnn port 54321
To send data I run
echo -n "hello world" | nc -4u -w1 localhost 54321
I do see data going into UDP but I don't see anything coming out of serial. Shouldn't socat
options -x
and -v
display the data? If I understand it correctly, socat
doesn't display any data because there is not data flowing from UDP to serial.
Just to make sure that I'm not missing anything, I actually connected an oscilloscope to the serial lines to monitor the data physically. But I didn't see anything.
Has anyone had any experience bridging UDP and serial? I would really appreciate any help with this. Maybe there is another way of doing what I'm doing? Any help is appreciated.
EDIT
Here is what I want to do
Device | Serial | PC
|------------------|
Map Network to| | Map network to Serialport
Serial Port| | SerialPort
| |
SerialPort| |
serial-port udp socat
edited Jul 11 at 20:56
asked Jul 11 at 19:11
flashburn
16919
16919
Related - this shows a TCP to serial connector - stackoverflow.com/questions/22624653/â¦. I'd start with this and confirm that it works, and then mix in the UDP.
â slmâ¦
Jul 11 at 20:43
Another related - stackoverflow.com/questions/29207980/â¦.
â slmâ¦
Jul 11 at 20:46
2
It looks likeudp4:
is for sending out data over UDP. Since you wantsocat
to listen for incoming UDP packets, perhaps replaceudp4:
withudp4-listen:
.
â telcoM
Jul 11 at 20:47
1
@slm I have a different structure. Will edit the post to show what I mean
â flashburn
Jul 11 at 20:53
add a comment |Â
Related - this shows a TCP to serial connector - stackoverflow.com/questions/22624653/â¦. I'd start with this and confirm that it works, and then mix in the UDP.
â slmâ¦
Jul 11 at 20:43
Another related - stackoverflow.com/questions/29207980/â¦.
â slmâ¦
Jul 11 at 20:46
2
It looks likeudp4:
is for sending out data over UDP. Since you wantsocat
to listen for incoming UDP packets, perhaps replaceudp4:
withudp4-listen:
.
â telcoM
Jul 11 at 20:47
1
@slm I have a different structure. Will edit the post to show what I mean
â flashburn
Jul 11 at 20:53
Related - this shows a TCP to serial connector - stackoverflow.com/questions/22624653/â¦. I'd start with this and confirm that it works, and then mix in the UDP.
â slmâ¦
Jul 11 at 20:43
Related - this shows a TCP to serial connector - stackoverflow.com/questions/22624653/â¦. I'd start with this and confirm that it works, and then mix in the UDP.
â slmâ¦
Jul 11 at 20:43
Another related - stackoverflow.com/questions/29207980/â¦.
â slmâ¦
Jul 11 at 20:46
Another related - stackoverflow.com/questions/29207980/â¦.
â slmâ¦
Jul 11 at 20:46
2
2
It looks like
udp4:
is for sending out data over UDP. Since you want socat
to listen for incoming UDP packets, perhaps replace udp4:
with udp4-listen:
.â telcoM
Jul 11 at 20:47
It looks like
udp4:
is for sending out data over UDP. Since you want socat
to listen for incoming UDP packets, perhaps replace udp4:
with udp4-listen:
.â telcoM
Jul 11 at 20:47
1
1
@slm I have a different structure. Will edit the post to show what I mean
â flashburn
Jul 11 at 20:53
@slm I have a different structure. Will edit the post to show what I mean
â flashburn
Jul 11 at 20:53
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f454769%2fbridge-between-udp-and-serial-doesnt-work%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Related - this shows a TCP to serial connector - stackoverflow.com/questions/22624653/â¦. I'd start with this and confirm that it works, and then mix in the UDP.
â slmâ¦
Jul 11 at 20:43
Another related - stackoverflow.com/questions/29207980/â¦.
â slmâ¦
Jul 11 at 20:46
2
It looks like
udp4:
is for sending out data over UDP. Since you wantsocat
to listen for incoming UDP packets, perhaps replaceudp4:
withudp4-listen:
.â telcoM
Jul 11 at 20:47
1
@slm I have a different structure. Will edit the post to show what I mean
â flashburn
Jul 11 at 20:53