TCP modem emulator for Modbus polling integration tests
Simulates GPRS modem behavior to validate Modbus polling clients against physical devices via serial or TCP without production modems.
What it is
Modbus Modem Simulator is a standalone Java test harness that emulates GPRS modem behavior for development and integration testing. It runs a TCP server (a configurable port) that pairs incoming Modbus polling client connections with modem emulator threads, routing commands to physical Modbus devices over either RS-485 serial or TCP backends. At startup, it reads the active controller and meter configurations from the platform database, enabling realistic modem simulation for protocol validation without requiring live GPRS infrastructure.
Key benefits
De-risk Modbus polling in test
Validate Modbus polling clients and integration flows against real device backends without production modems. Thread-pairing architecture maintains separate modem and client connections, so your polling logic sees authentic modem state transitions (including simulated 10-minute disconnects).
Dual backend support
Route commands to physical Modbus devices via RS-485 serial (a serial port, 19200 baud) or TCP (localhost:507). Switch backends by changing the communicator class without modifying client code—ideal for lab environments with hardware variation.
Database-driven configuration
Loads controller and meter configs directly from the platform database at startup. No separate config files to maintain—your test harness always reflects live device definitions, reducing setup drift between test and deployment.
Runtime log control
Reconfigure logging (level, path, format, rotation) from the database at startup without recompiling. Useful for QA runs that need different verbosity levels across device types.
Capabilities
- TCP modem emulation on localhost:7777 paired with Modbus polling client connections
- Thread-based connection pairing with modem protocol handshake (FF FF FF FF + serial number detection)
- Dual Modbus backends: TCP (simulated third-party meter simulators on a configurable port) and serial RS-485 (a serial port, 19200 8N1)
- Database-driven startup: reads platform tables, platform tables, and platform tables tables
- Modem disconnection simulation: automatic 10-minute idle disconnect to test polling resilience
- Runtime logging reconfiguration from the platform database (platform tables table)
- Support for MSSQL, SQLite, H2, MySQL, and PostgreSQL backend databases
