A simple Flask-based web app that connects to a Modbus TCP server (running locally via pymodbus), reads Coils, Discrete Inputs, Holding Registers, and Input Registers, and displays them in a web UI.
- Modbus TCP client using pyModbusTCP
- Embedded Modbus TCP server using pymodbus
- Flask REST API and frontend
- Docker support for deployment
- GitHub Actions CI/CD pipeline with testing
Build and run the container:
docker build -t modbus-app .
docker run -p 5000:5000 -p 1502:1502 modbus-appOr using Docker Compose:
docker-compose upVisit: http://localhost:5000
Locally:
pytest test_modbus.pyInside Docker container:
docker exec modbus-test pytest test_modbus.pyTests are also automatically executed on push using GitHub Actions.
- Python 3.12+
- Flask
- pyModbusTCP
- pymodbus==2.5.3
- pytest
Install locally:
pip install -r requirements.txt