A Python-based UART (Universal Asynchronous Receiver-Transmitter) sniffer application built with PySide6/Qt6. This tool allows you to monitor and capture serial communication data from two separate UART channels simultaneously.
- Dual UART Monitoring: Monitor both TX (transmit) and RX (receive) channels independently
- Real-time Display: Live monitoring of UART data with hexadecimal output
- Multi-tab Interface:
- Separate tabs for TX data, RX data, and combined TX/RX view
- Clean, organized data presentation
- Flexible Configuration:
- Configurable COM ports (1-99)
- Multiple baudrate options (4800 to 921600 bps)
- Individual enable/disable for TX and RX channels
- Data Logging: Save captured data to timestamped log files
- Threading Support: Non-blocking UI with threaded UART reading
The application features a modern Qt interface with:
- Tabbed display for different data views
- Control buttons with custom SVG icons
- Real-time configuration options
- Start/Stop/Save controls
- Python 3.7+
- PySide6
- pyserial
- Clone this repository:
git clone https://github.com/yourusername/Uart_Sniffer.git
cd Uart_Sniffer- Install required dependencies:
pip install PySide6 pyserialpython sniffer_app.py-
TX Channel Setup:
- Check "Use TX" to enable TX monitoring
- Select COM port number
- Choose baudrate from dropdown
-
RX Channel Setup:
- Check "Use RX" to enable RX monitoring
- Select COM port number
- Choose baudrate from dropdown
-
Start Monitoring:
- Click the play button to start capturing
- Data will appear in real-time in the respective tabs
-
Stop and Save:
- Click the stop button to halt monitoring
- Click the save button to export captured data to log file
- TX Tab: Shows only transmit data
- RX Tab: Shows only receive data
- TX and RX Tab: Shows combined data with channel labels (TX: or RX:)
All data is displayed in uppercase hexadecimal format.
- Logs are automatically saved to a
logs/directory - Filename format:
log_YYYY_MM_DD_HH_MM_SS.txt - Contains combined TX/RX data with channel labels
- 4800
- 9600
- 19200
- 38400
- 57600
- 115200
- 230400
- 460800
- 921600
Uart_Sniffer/
├── sniffer_app.py # Main application logic
├── ui_sniffer_uart.py # Qt UI definitions (auto-generated)
├── resources/
│ ├── __init__.py
│ └── resourcer_rc.py # Qt resource file with icons
├── logs/ # Generated log files (created automatically)
└── README.md
- Main Application:
UserInterfaceclass inherits fromQMainWindow - Signal System: Uses Qt signals for thread-safe UI updates
- Threading: Separate threads for TX and RX UART reading
- Error Handling: Graceful handling of COM port connection errors
UserInterface: Main application window and logicUartSignals: Qt signal definitions for data communicationUi_MainWindow: Auto-generated UI layout (from Qt Designer)
The application uses daemon threads for UART reading to prevent blocking the UI:
- One thread per active UART channel
- Thread-safe communication via Qt signals
- Proper cleanup on application exit
-
COM Port Not Found:
- Verify the COM port exists and is not in use by another application
- Check Windows Device Manager or use
modecommand to list available ports
-
Permission Denied:
- Ensure the application has permission to access serial ports
- On Linux/Mac, you may need to add your user to the dialout group
-
No Data Appearing:
- Verify correct baudrate settings
- Check that the device is actually transmitting data
- Ensure proper wiring connections
This project is licensed under the MIT License - see the LICENSE file for details.
Note: This application is designed for Windows COM ports. For Linux/Mac compatibility, modify the serial port naming convention in configure_uart() method.

