Skip to content

๐Ÿ ModbusSniffer โ€“ Free Modbus RTU Analyzer with GUI (Python / PyQt6)

A lightweight and user-friendly Modbus RTU sniffer tool with a graphical interface.
Easily analyze and debug communication between PLCs, HMIs, and other Modbus RTU devices via serial ports.

GitHub release License: MIT

Demo

๐Ÿš€ Why ModbusSniffer (This Fork)?

๐Ÿ” General Highlights

  • ๐Ÿงฐ Sniffs raw Modbus RTU frames from serial ports (RS-485, USB)
  • ๐Ÿ–ฅ๏ธ Graphical User Interface (PyQt6) โ€” no terminal needed
  • ๐Ÿ“‹ Frame table: Real-time view with decoded address, function code, and data
  • ๐ŸŒˆ Live Logging: Color-coded requestโ€“response pairs, unmatched requests highlighted
  • ๐ŸชŸ Cross-platform: Windows & Linux
  • ๐Ÿ†“ Free & Open Source (MIT license)

๐Ÿ› ๏ธ Why This Fork (What's New)

  • ๐Ÿ’ป Modular code refactor โ€” clear separation into modules and classes
  • ๐Ÿง  Rewritten Modbus parser (ModbusParser class) with clean structure
  • ๐Ÿ–ฅ๏ธ Fully integrated GUI (previously only CLI)
  • ๐Ÿ”„ All command-line functionality preserved and upgraded into the GUI

๐Ÿงฐ Easy Installation (Pre-built Binaries or Install Scripts for Windows and Linux)

You don't need to build anything manually!
This project uses GitHub Actions (GHA) to automatically build and publish verified binaries for each release.
Pre-built versions for Windows and Ubuntu are available under the Releases tab.

For custom builds and automatic shortcut setup, see the ๐Ÿ› ๏ธ Build & Install section below.


๐Ÿ› ๏ธ Build & Install

1. General Requirements

- Python 3 installed

- pip3 installed

๐Ÿง Linux

sudo apt install python3-pip

๐ŸชŸ Windows

python -m ensurepip --upgrade

2. Clone the Repository

git clone https://github.com/niwciu/ModbusSniffer.git
cd ModbusSniffer/install_scripts

3. Build Executable (for Ubuntu and Windows)

Note: If you only want to run the app and not build it, skip this step and go to โ–ถ๏ธ Running GUI app without build.

๐Ÿง Linux

sudo chmod +x build.sh
./build.sh

This script: * Cleans previous build files (build/, dist/, .spec, __pycache__) * Creates a virtual environment and installs dependencies * Uses PyInstaller to build the app * Adds Start Menu and desktop shortcuts

๐ŸชŸ Windows

./build.bat

This script: * Cleans previous build files * Sets up a virtual environment and installs dependencies * Builds a standalone .exe using PyInstaller * Adds desktop and Start Menu shortcuts


โ–ถ๏ธ Running GUI App (installed via pip)

1. Clone repository

git clone https://github.com/niwciu/ModbusSniffer.git
cd ModbusSniffer

2. Create and Activate Virtual Environment

๐Ÿง Linux

python3 -m venv .venv
source .venv/bin/activate

๐ŸชŸ Windows (PowerShell)

python -m venv .venv
.\.venv\Scripts\Activate.ps1

3. Install package and development tools

pip install -e .[dev]

4. Run GUI app ๐ŸŽ›๏ธ ๐Ÿงฉ

modbus-sniffer-gui

Note: virtual environment (.venv) must be active

5. Deactivate Virtual Environment

deactivate

๐ŸŽฎ Running the CLI App (installed via pip)

1. Clone repository

git clone https://github.com/niwciu/ModbusSniffer.git
cd ModbusSniffer

2. Create and Activate Virtual Environment

๐Ÿง Linux

python3 -m venv .venv
source .venv/bin/activate

๐ŸชŸ Windows (PowerShell)

python -m venv .venv
.\.venv\Scripts\Activate.ps1

3. Install package and development tools

pip install -e .[dev]

3. Run CLI Help ๐Ÿ–ฅ๏ธ

modbus-sniffer -h

Note: virtual environment (.venv) must be active.

4. Example of usage ๐Ÿงช

Run modbus-sniffer CLI app on port USB0 with baud 115200 and parity=none

modbus-sniffer -p /dev/ttyUSB0 -b 115200 -r none

Note: virtual environment (.venv) must be active.

4. Deactivate Virtual Environment

deactivate

โ–ถ๏ธ Running GUI App without installation

1. Clone repository

git clone https://github.com/niwciu/ModbusSniffer.git
cd ModbusSniffer

2. Create and Activate Virtual Environment

๐Ÿง Linux

python3 -m venv .venv
source .venv/bin/activate

๐ŸชŸ Windows (PowerShell)

python -m venv .venv
.\.venv\Scripts\Activate.ps1

3. Install requirements

pip install -r ./install_scripts/requirements.txt

4. Run GUI app ๐ŸŽ›๏ธ ๐Ÿงฉ

cd src/modbus_sniffer
python gui.py

Note: virtual environment (.venv) must be active

5. Deactivate Virtual Environment

deactivate

๐ŸŽฎ Running the CLI App without installation

1. Clone repository

git clone https://github.com/niwciu/ModbusSniffer.git
cd ModbusSniffer

2. Create and Activate Virtual Environment

๐Ÿง Linux

python3 -m venv .venv
source .venv/bin/activate

๐ŸชŸ Windows (PowerShell)

python -m venv .venv
.\.venv\Scripts\Activate.ps1

3. Install requirements

pip install -r ./install_scripts/requirements.txt

3. Run CLI Help ๐Ÿ–ฅ๏ธ

cd src/modbus_sniffer
python cli.py -h

Note: virtual environment (.venv) must be active.

4. Example of usage ๐Ÿงช

Run modbus-sniffer CLI app on port USB0 with baud 115200 and parity=none

cd src/modbus_sniffer #optional - if running from project main folder
python cli.py -p /dev/ttyUSB0 -b 115200 -r none

Note: virtual environment (.venv) must be active.

4. Deactivate Virtual Environment

deactivate

๐Ÿ†• Whatโ€™s New

See the full CHANGELOG.md for details.


๐Ÿ”ง ToDo

  • Improve GUI with:
  • Add frame filtering
  • Add posibility to set log files path

๐Ÿ“š Documentation & Support

  • Detailed documentation will be available in the docs/ folder soon.
  • Questions or issues? Open an issue or join the Discussions.

๐Ÿค Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature-name)
  3. Commit your changes (git commit -m "Add feature")
  4. Push to branch (git push origin feature-name)
  5. Open a Pull Request

After cloning the repository and setting up a virtual environment, you can install all development tools (used in CI/CD pipeline and for local testing, linting, and packaging) with:

pip install -e .[dev]
This includes formatters, linters, type checkers, test runners, and build tools.


๐Ÿ“œ License

This project is licensed under the MIT License โ€” see the LICENSE file.

This project is a fork of BADAndrea ModbusSniffer
Fork maintained by niwciu with enhancements described above.


โค๏ธ Thank you for using this version of ModbusSniffer!

--- myEmbeddedWayBanerWhiteSmaller ---