Dick Fagan
Posts: 1
Joined: Tue Dec 12, 2017 12:59 pm

Listen into serial communication between sensor and PC

Tue Dec 12, 2017 2:49 pm

Hi,

I am working on a project measuring several parameters, which needs to be synchronized with a computer. The PC is already getting its position and exact time via a GPS device (Garmin GPS19x HVS) over the NMEA 0182 standard which is currently running over an RS-422 connection. My plan is to listen to this communication with the Raspberry Pi (with Raspbian) without interfering with it.

My problems are:
1) Hardware:
Can I simply create a 'T' connection from the Tx and Rx lines to the Raspberry Pi, or do I need to seperate the Raspberry Pi (e.g. with optocouplers) in order not to interfere? I am using an 8 port serial to usb adapter with the Raspberry.

2) Software:
Until now I only used the Serial Python library with:

Code: Select all

raw_data = ser.read(ser.inWaiting())
with

Code: Select all

ser
as the serial port. But that way, everytime I read the data, I empty the buffer of the GPS and the PC can´t get the same data anymore. All I would need, is to 'spy' on the communication.

I know I could connect the Raspi to the PC and synchronize the clock that way and send the GPS position, but as the PC is part of a seperate measuring device that someone created once with LabView, I am trying to avoid having another Python skript running on there.

If anybody has an idea how to solve it,
Thank You!
J.

pbreneman
Posts: 23
Joined: Thu Jun 07, 2012 12:31 pm

Re: Listen into serial communication between sensor and PC

Wed Dec 13, 2017 5:33 pm

Dick Fagan wrote:
Tue Dec 12, 2017 2:49 pm
If anybody has an idea how to solve it,
Thank You!
There are several notes on the bottom example on this page:
http://ctrlterm.com/custom.htm

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

Re: Listen into serial communication between sensor and PC

Wed Dec 13, 2017 5:39 pm

You should be able to passively sniff the TX/RX traffic provided it is 19.2k baud or less.

See http://abyz.me.uk/rpi/pigpio/pigs.html#SLRO and http://abyz.me.uk/rpi/pigpio/pigs.html#SLR

Return to “Automation, sensing and robotics”

Who is online

Users browsing this forum: No registered users and 7 guests