How varionix/pycom-modbus works
uModbus is a small MicroPython Modbus client library with TCP and serial RTU transports. A caller selects a transport, invokes read or write operations, and receives decoded values or write-validation status. The example in main.py demonstrates WLAN setup and a TCP multiple-register write. Sampled source shows the transport and encoding paths; no README was provided, so capabilities are based on the exposed methods and source.
Main entry points: tcp.py TCP client · serial.py Serial RTU client · main.py Example script · functions.py PDU encoding
Components 8
Example entry
- Example script
main.py - WLAN network
Modbus protocol
- PDU encoding
uModbus/functions.py - Protocol constants
uModbus/const.py
Transports
- TCP client
uModbus/tcp.py - Serial RTU client
uModbus/serial.py
Other components
- Application caller
- Modbus slave
Connections 12
- Application caller → Example script: runs
- Example script → WLAN network: connects via
- Example script → TCP client: creates and calls
- Application caller → TCP client: calls reads/writes
- Application caller → Serial RTU client: calls reads/writes
- TCP client → PDU encoding: builds and validates
- Serial RTU client → PDU encoding: builds and validates
- PDU encoding → Protocol constants: uses codes
- TCP client → Protocol constants: uses framing constants
- Serial RTU client → Protocol constants: uses RTU constants
- TCP client → Modbus slave: exchanges TCP frames
- Serial RTU client → Modbus slave: exchanges RTU frames