A web-based utility for testing and controlling the Modbus RTU IO 8CH device through a serial connection. This application uses the Web Serial API to communicate directly with the device from a browser.
- Connect to Modbus RTU IO 8CH devices via serial port
- Control individual output channels (ON/OFF/Toggle)
- Control all channels simultaneously
- Read input channel statuses
- Auto-refresh capability for continuous monitoring
- Command logging for debugging
- Responsive design that works on desktop and mobile devices
- Waveshare Modbus RTU IO 8CH
- USB to RS485 adapter
- Computer with Chrome or Edge browser (for Web Serial API support)
- Connect your Modbus RTU IO 8CH device to your computer via a USB to RS485 adapter
- Open the application in a supported browser
- Configure the connection settings (device address, baud rate, and parity)
- Click "Connect to Device"
- Use the interface to control outputs and monitor inputs
This application uses the Web Serial API, which is currently supported in:
- Google Chrome (version 89 or later)
- Microsoft Edge (version 89 or later)
- Opera (version 76 or later)
Firefox and Safari do not currently support the Web Serial API.
The application implements the Modbus RTU protocol as specified in the Waveshare documentation. It supports the following Modbus function codes:
- 0x01: Read Coils (for reading output status)
- 0x02: Read Discrete Inputs (for reading input status)
- 0x05: Write Single Coil (for controlling outputs)
This project uses vanilla JavaScript and does not require any build process. The Web Serial API is used for communication with the hardware device.
/
├── index.html # Main HTML file
├── css/
│ └── styles.css # Styling
└── js/
├── modbus.js # Modbus RTU protocol implementation
└── app.js # Main application logic
The Web Serial API requires user interaction before a page can connect to a device, and connections are only maintained while the page is open.
MIT License