0

I have two micro-controllers which are connected to my computer(ubuntu 12.04) through serial-USB cables. One of the controllers (ttyUSB0) is programmed such that it sends data serially and another (ttyAMC0) is programmed to receive data serially.

So please any one could guide on achieving a link(send the data available at ttyUSB0 to ttyAMC0 ) between these two hardware ports.

Thanks in advance.

3
  • What about a very simple cat </dev/ttyUSB0 >/dev/ttyAMC0? Commented Apr 22, 2015 at 16:24
  • Yes I tried but no use... my controllers had been programmed to send and receive data at speed of 9600.. So should I again set speed of those ports using terminal commands??.. if yes how can I set speed n other configurations of the ports (ttyUSB0 n ttyACM0)... Commented Apr 23, 2015 at 7:15
  • You can set speed and other parameters with stty. Commented Apr 23, 2015 at 13:34

2 Answers 2

1

Well, the obvious way is to connect the two ports to each other, using a serial cable, without the two USB/serial adapters. Since you're not doing that, I presume its because you want the computer to do something—for example, this would be a reasonably common setup for reverse-engineering the protocol between the two devices.

Snooper is a program for just that: forward data between two serial ports, monitoring the communication.

4
  • Hello... Thank you for your reply .... but it is not working (I mean not able to receive data ), is there any other way to make this possible.... Commented Apr 29, 2015 at 16:20
  • @VishnuKanth it's been a while since I've used the program, but please confirm all your serial settings are correct (bit rate, flow control, parity, etc.). Have you confirmed the parts work independently? (E.g., with minicom or whatever). Commented Apr 29, 2015 at 16:37
  • Thank you .... Its working now... made a silly mistake earlier... now its totally fine.... Commented May 1, 2015 at 7:11
  • @VishnuKanth glad to hear that. You might want to consider accepting this answer; see the Help Center's What should I do when someone answers my question? Commented May 1, 2015 at 16:15
1

Not sure if this is going to help... but I found this: https://superuser.com/questions/403331/how-do-i-link-two-serial-ports-in-gnu-linux

It suggest the use of socat with a link to this page: http://technostuff.blogspot.be/2008/10/some-useful-socat-commands.html

The command is on top:

socat /dev/ttyS0,raw,echo=0,crnl /dev/ttyS1,raw,echo=0,crnl 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.