bridge between UDP and serial doesn't work

The name of the pictureThe name of the pictureThe name of the pictureClash 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| |






share|improve this question





















  • 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 want socatto listen for incoming UDP packets, perhaps replace udp4: with udp4-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














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| |






share|improve this question





















  • 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 want socatto listen for incoming UDP packets, perhaps replace udp4: with udp4-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












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| |






share|improve this question













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| |








share|improve this question












share|improve this question




share|improve this question








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 like udp4: is for sending out data over UDP. Since you want socatto listen for incoming UDP packets, perhaps replace udp4: with udp4-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










  • 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 want socatto listen for incoming UDP packets, perhaps replace udp4: with udp4-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 socatto 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 socatto 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















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















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



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














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













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay