Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ build/
*.egg-info/
.venv/
logs/
.coverage
.coverage
site/
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

# v1.0.4 – What’s Changed 🚀

## 🚀 Feature Enhancements
- 📶 Extended baudrate options in GUI combo box to include 230400, 460800, and 921600

## 📚 Documentation Updates
- 📝 Improved Polish documentation pages with standardized emojis and added UI section
- 🖼️ Added application screenshots and fixed main icon references
- 🔄 Reorganized and fixed Polish index page structure
- 📖 General documentation improvements and updates

## 🧪 Test Suite Fixes
- 🐛 Fixed AttributeError in ModbusParser by initializing `bufferIndex` in `__init__`
- 🔧 Updated GUI tests to use correct imports (QStyleOptionViewItem from QtWidgets)
- 🛠️ Added proper mocking for serial.Serial in tests to prevent real hardware access
- ✅ Fixed assertions in parser tests and GUI add_parsed_data method to use safe dict access
- ⚙️ Configured pytest for source coverage instead of installed package

**Full Changelog**: https://github.com/niwciu/ModbusSniffer/compare/v1.0.3...v1.0.4


# v1.0.3 – What’s Changed 🚀

## ⚙️ CI/CD Improvements
Expand Down
273 changes: 29 additions & 244 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Easily analyze and debug communication between PLCs, HMIs, and other Modbus RTU
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

<div align="center">
<img src="https://github.com/niwciu/ModbusSniffer/blob/main/doc/gui.gif?raw=true" alt="Demo" />
<img src="https://niwciu.github.io/ModbusSniffer/gui.gif" alt="ModbusSniffer GUI demo" />
<p><em>Live preview of ModbusSniffer GUI in action</em></p>
</div>

---
Expand All @@ -33,267 +34,44 @@ Easily analyze and debug communication between PLCs, HMIs, and other Modbus RTU

---

## 🧰 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](https://github.com/niwciu/ModbusSniffer/releases) tab.
## 🆕 What’s New

For custom builds and automatic shortcut setup, see the **🛠️ Build & Install** section below.
See the full [CHANGELOG.md](https://github.com/niwciu/ModbusSniffer/blob/main/CHANGELOG.md) for details.

---

## 🛠️ Build & Install

### 1. General Requirements

#### - Python 3 installed
#### - pip3 installed

#### 🐧 Linux
```bash
sudo apt install python3-pip
```

#### 🪟 Windows
```powershell
python -m ensurepip --upgrade
```

### 2. Clone the Repository

```bash
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

```bash
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

```powershell
./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

---
## 🔧 ToDo
- Improve GUI with:
- Add frame filtering
- Add posibility to set log files path

## ▶️ Running GUI App (installed via pip)
### 1. Clone repository
## 🗺️ Roadmap
- Support for Modbus TCP
- Custom function code decoding
- Advanced filtering and analysis tools
- Plugin system for extensions

```bash
git clone https://github.com/niwciu/ModbusSniffer.git
cd ModbusSniffer
```
## 📚 Documentation & Support

### 2. Create and Activate Virtual Environment
#### 🐧 Linux
```bash
python3 -m venv .venv
source .venv/bin/activate
```
- Detailed documentation will be available in the `docs/` folder soon.
- Questions or issues? Open an [issue](https://github.com/niwciu/ModbusSniffer/issues) or join the [Discussions](https://github.com/niwciu/ModbusSniffer/discussions).

#### 🪟 Windows (PowerShell)
```powershell
python -m venv .venv
.\.venv\Scripts\Activate.ps1
```
## 🧪 Testing

### 3. Install package and development tools
Run tests with pytest:

```bash
pip install -e .[dev]
pytest
```

### 4. Run GUI app 🎛️ 🧩
Coverage report:
```bash
modbus-sniffer-gui
```
> Note: virtual environment (.venv) must be active

### 5. Deactivate Virtual Environment
```bash
deactivate
pytest --cov=modbus_sniffer
```

---

## 🎮 Running the CLI App (installed via pip)
### 1. Clone repository
```bash
git clone https://github.com/niwciu/ModbusSniffer.git
cd ModbusSniffer
```
### 2. Create and Activate Virtual Environment

#### 🐧 Linux
```bash
python3 -m venv .venv
source .venv/bin/activate
```

#### 🪟 Windows (PowerShell)
```powershell
python -m venv .venv
.\.venv\Scripts\Activate.ps1
```

### 3. Install package and development tools

```bash
pip install -e .[dev]
```

### 3. Run CLI Help 🖥️

```bash
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
```bash
modbus-sniffer -p /dev/ttyUSB0 -b 115200 -r none
```
> Note: virtual environment (.venv) must be active.

### 4. Deactivate Virtual Environment

```bash
deactivate
```

## ▶️ Running GUI App without installation
### 1. Clone repository

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

### 2. Create and Activate Virtual Environment
#### 🐧 Linux
```bash
python3 -m venv .venv
source .venv/bin/activate
```

#### 🪟 Windows (PowerShell)
```powershell
python -m venv .venv
.\.venv\Scripts\Activate.ps1
```

### 3. Install requirements

```bash
pip install -r ./install_scripts/requirements.txt
```

### 4. Run GUI app 🎛️ 🧩
```bash
cd src/modbus_sniffer
python gui.py
```
> Note: virtual environment (.venv) must be active

### 5. Deactivate Virtual Environment
```bash
deactivate
```

---

## 🎮 Running the CLI App without installation
### 1. Clone repository
```bash
git clone https://github.com/niwciu/ModbusSniffer.git
cd ModbusSniffer
```
### 2. Create and Activate Virtual Environment

#### 🐧 Linux
```bash
python3 -m venv .venv
source .venv/bin/activate
```

#### 🪟 Windows (PowerShell)
```powershell
python -m venv .venv
.\.venv\Scripts\Activate.ps1
```

### 3. Install requirements

```bash
pip install -r ./install_scripts/requirements.txt
```

### 3. Run CLI Help 🖥️

```bash
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
```bash
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

```bash
deactivate
```

---

## 🆕 What’s New

See the full [CHANGELOG.md](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](https://github.com/niwciu/ModbusSniffer/issues) or join the [Discussions](https://github.com/niwciu/ModbusSniffer/discussions).

---

## 🤝 Contributing

Contributions are welcome!
Expand All @@ -313,9 +91,16 @@ This includes formatters, linters, type checkers, test runners, and build tools.

---

## 🤝 Acknowledgments

Thanks to the original author [BADAndrea](https://github.com/BADAndrea) for the initial ModbusSniffer implementation.
Special thanks to all contributors and the open-source community for feedback and improvements.

---

## 📜 License

This project is licensed under the MIT License — see the [LICENSE](LICENSE) file.
This project is licensed under the MIT License — see the [LICENSE](https://github.com/niwciu/ModbusSniffer/blob/main/LICENSE) file.

This project is a fork of [BADAndrea ModbusSniffer](https://github.com/BADAndrea/ModbusSniffer)
Fork maintained by **niwciu** with enhancements described above.
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Easily analyze and debug communication between PLCs, HMIs, and other Modbus RTU

[![GitHub release](https://img.shields.io/github/v/release/niwciu/ModbusSniffer)](https://github.com/niwciu/ModbusSniffer/releases)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/niwciu/ModbusSniffer)](https://github.com/niwciu/ModbusSniffer/stargazers)
[![GitHub issues](https://img.shields.io/github/issues/niwciu/ModbusSniffer)](https://github.com/niwciu/ModbusSniffer/issues)

<div align="center">
<img src="https://niwciu.github.io/ModbusSniffer/gui.gif" alt="Demo" />
Expand Down Expand Up @@ -33,7 +35,7 @@ pip install modbus-sniffer
```
or download Binary files for Ubuntu and Windows from [here](https://github.com/niwciu/ModbusSniffer/releases).

You can also build and install app from sourcess. [Click here](CONTRIBUTING.md#%EF%B8%8F-build--install) for deatails about it.
You can also build and install app from sourcess. [Click here](docs/installation.md) for deatails about it.


---
Expand Down Expand Up @@ -65,7 +67,7 @@ For more usage options, development guide, and installation from source, visit t
---
## 🤝 Contributing

Please see [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and contribution guidelines.
Please see [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md) for development setup and contribution guidelines.

---

Expand Down
Loading