Skip to main content
Topic: Serial sniffing? (Read 4719 times) previous topic - next topic

Serial sniffing?

I am having trouble with a python application running on a PC, it seems incoming characters are lost when received from the virtual serial port.

The setup is as follows:

PC <---USB---> <---USB-to-RS232-converter---> <---RS232-level-shifter---> RF transceiver with serial interface

The use case is:
1. Press "send" on a RF remote control
2. The transceiver receives and decodes the signal, sends information according to a slightly complex protocol (over standard RS232) to the PC.
3. Somewhere along the line characters are lost - most likely this happens in the PC application or buffers.


I'd like to sniff the serial data coming out of the RF transceiver - can this be done with the Bus Pirate?
From reading the docs my understanding is that this is possible - correct?

Thanks,
-Goran

Re: Serial sniffing?

Reply #1
Yes, it is possible, but you can only monitor signal traveling from pc to device _OR_ device to pc. Connect the RX from the buspirate to the line you want to monitor and read it with r in the uart mode. see http://code.google.com/p/the-bus-pirate ... usModeUART for the details on the UART mode.

the other way is using the logic analyzer mode, then you can monitor the two lines the same time. Disadvantage is that you need to assemble the bits to bytes. see http://code.google.com/p/the-bus-pirate ... alyzerMode for more info on the analyzerfunction

Re: Serial sniffing?

Reply #2
Awesome!
I only want to monitor traffic from the device to the PC so that's cool.

An additional thought:
The application level protocol used by the device require certain handshaking between the device and the PC (ACKs etc), meaning that the PC and the device must be connected.
What I really need to do is to attach the Bus Pirate RX input to the TX output on the device, while the TX of the device is also connected to the PC..
Hopefully the device will be able to drive both the serial link to the PC and the Bus Pirate RX input.

Or does anyone have info on that the above won't work?
I'd like to know there is a fair chance of this working before buying a BP..

Cheers

Re: Serial sniffing?

Reply #3
Back in the days i had made an serial sniffer like this:

Code: [Select]

RX ----o------ TX
TX ----+-o---- RX
       | |
RX1----+ |
RX2------+


rx1 goes to com1 and rx2 goes to com2 on the listening PC.

The only thing that could go wrong are voltages. BP only accepts 0 to 5V so you need to attach it on the RF module ( i presume it operates at TTL levels) please double check and also check the pullup resistor guide http://dangerousprototypes.com/2009/07/ ... resistors/ and http://hackaday.com/2009/07/01/mixed-vo ... us-pirate/

Re: Serial sniffing?

Reply #4
You can also use the live UART monitor macro and a terminal like Hercules (http://www.hw-group.com/products/hercules/index_en.html) for a live continuous display of the data on the port. I think it's macro (2) in UART mode.
Got a question? Please ask in the forum for the fastest answers.