crazy george
Posts: 8
Joined: Fri Sep 27, 2013 3:33 pm

serial port - sending data to a second port from the first

Sun Jul 27, 2014 11:36 pm

Hi

I have been tinkering about with a robot i have that has a linux board. there is a serial communication between the linux board and a motor board. I want to be able to record bothways communication between the boards, while they are working. I have serial connection to the linux board through a different port, but its the serial between the boards that i want to view.

IE currently goes Linuxboard <serial> Motorboard

Can i Go Linux Board <R-PI serial (record or output to terminal ) R-PI serial>motor Board

Ie using the inbuilt and a second usb serial device, can i pass on the communications between these devices

klricks
Posts: 7154
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: serial port - sending data to a second port from the fir

Mon Jul 28, 2014 5:35 am

Yes but remember that the RPi serial port is at 3V3 TTL levels. If your other boards are at 5V TTL then you will need a level converter circuit of some sort between the RPi and the other board.
https://www.sparkfun.com/products/12009
OR
Some people use a resistor network to drop voltage. Should work if the baud rate is not too high.

I am assuming that the ports are all TLL.... If RS232 serial then you will need a 3V3 TTL to RS232 converter (MAX3232) for the RPi.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

User avatar
joan
Posts: 14936
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: serial port - sending data to a second port from the fir

Mon Jul 28, 2014 7:37 am

crazy george wrote:Hi

I have been tinkering about with a robot i have that has a linux board. there is a serial communication between the linux board and a motor board. I want to be able to record bothways communication between the boards, while they are working. I have serial connection to the linux board through a different port, but its the serial between the boards that i want to view.

IE currently goes Linuxboard <serial> Motorboard

Can i Go Linux Board <R-PI serial (record or output to terminal ) R-PI serial>motor Board

Ie using the inbuilt and a second usb serial device, can i pass on the communications between these devices
What speed is the serial link (baud, bits per second)? It may be possible just to sniff incoming and outgoing UART traffic.

crazy george
Posts: 8
Joined: Fri Sep 27, 2013 3:33 pm

Re: serial port - sending data to a second port from the fir

Mon Jul 28, 2014 8:47 pm

Hi

I will check the speeds. The linux board ( freescale mmx ) has an open serial at 115, but i think the connection between the two boards may be 9600, as am assuming the motor board runs at that, or takes commands at that.

I was wandering if i could just sniff it in some way, but i have built a wiring rig to make the connections if needed. the board run at 3.3v, I have a usb serial link that allows 3.3 or 5v,

I can read the commands sent from the freescal board to the motor board, and some of the commands from the motor boards ( only some ), but i need to find the initiation commands/file. When the robot boots, the linux board and the motor board seem to send an initiation commands/files, its that i need to capture, they may be in hex or similar format.

I am hoping if i can identify this command/sequence, i can then port the full system to the PI, and replace the linux board in the robot. I already have a pi strapped onto one, connected through the serial, and if i can replace it, the PI fits in perfectly. Its a top upgrade for a R S MEDIA

I have bothe the main voice controll softwares tested on the pi, just trying to set up LIRC with an igguanaworks usb transever.... tricky.... might just make one, seen some very simple ones for the PI
jester and
voicecommander http://stevenhickson.blogspot.co.uk/201 ... e-and.html
one for offline, one for online Bit tricky to set up but i got there. Very cool when its the robot answering.

I will post up the port description and speed ( the freescale board seem to set a special uart port up at the start of booting )

Thanks for your responce

crazy george
Posts: 8
Joined: Fri Sep 27, 2013 3:33 pm

Re: serial port - sending data to a second port from the fir

Wed Aug 06, 2014 4:02 pm

Just one of them moments

What am i missing.

Am ssh into a raspberry pi from a linux lappy. The RPI is connected through serial to a robot linux board ( freescall mmx ).

When i drop a command in the shell to run a scrip on the bot ( eg /usr/bin/robot/scripts/DefaultBcon.sh 10 ) or try to echo that to the port from the pi, the robot sees the command ( i can see on its console ) but does not carry it out, untill, i iether disconnect, or press any button on the remote. If i do press a button, or shut my lappy down, any commands that i have sent, are then run.

Any suggestions that i could try ( my linux experience is limited but know my way around )

Return to “Beginners”