Hello, ? I'm trying to configure my system such that I have a TCP port listening which will send all data it receives to a serial port. ie:?? tcp/2112? -->? /dev/ttyS0 My goal would be to be able to: Use netcat to create the listen and redirect to a serial port: ? $ nc -l 2112 > /dev/ttyS0 Then in another window, run minicom at /dev/ttyS0 Then in a 3rd window, ? $ telnet localhost 2112 ?"Type things, hello world" But, I can never get the text to show up in the minicom window. I read different variations on the netcat command, including: $ nc -l 2112 <> /dev/ttyS0 or $ nc -l 2112 > /dev/ttyS0 < /dev/ttyS0 But none seem to do the trick. Anyone have any ideas on what I'm missing here? Any help would be great. Thanks! ? If life gives you lemons, keep them-- because hey.. free lemons. "~heart~ Sticker"? fixer:? http://microflush.org/stuff/stickers/heartFix.html
On 12/20/2013 04:13 PM, Joseph Spenner wrote:> Use netcat to create the listen and redirect to a serial port: > $ nc -l 2112 > /dev/ttyS0 > > Then in another window, run minicom at /dev/ttyS0Is this on the same machine? I.e. you have only one machine and one serial port? Do you have some sort of loopback cable connected to the serial port? If it is on two different machines I would check handshaking settings on the serial ports. Mogens -- Mogens Kjaer, mk at lemo.dk http://www.lemo.dk
On 20.12.2013 15:13, Joseph Spenner wrote:> Hello, > ? I'm trying to configure my system such that I have a TCP port > listening which will send all data it receives to a serial port. > >Check out socat, http://www.dest-unreach.org/socat/ -- Sent from the Delta quadrant using Borg technology! Nux! www.nux.ro
On 12/20/2013 08:13, Joseph Spenner wrote:> > But, I can never get the text to show up in the minicom window.You know the aphorism about hammers and nails? minicom is an awesome hammer, and here you are, presenting a problem that calls for a ratcheting box wrench. minicom is great for interactive use. When you want to do something programmatically, there's always a better way. Nux's suggestion, socat, looks like a much better choice here. I found a blog post that tells you how to create virtual serial ports connected to TCP listeners, here: http://justcheckingonall.wordpress.com/2009/06/09/howto-vsp-socat/