Emulate GPRS modem behavior for DNP3 testing
Standalone protocol bridge that simulates realistic GPRS modem connect/disconnect cycles for DNP3 GPRS controller testing without hardware.
What it is
DNP3 Modem Simulator is a Java test utility that bridges a test harness to a GPRS server, faithfully emulating modem behavior. It reads active DNP3 GPRS controller configurations from the platform database, spawns a communicator thread per modem, and simulates realistic connection cycles: 5 minutes connected, 1 minute sleep, then reconnect. Each modem thread handles bidirectional protocol data forwarding, modem identification, and graceful disconnect/reconnect. Intended for development and integration testing of DNP3 GPRS polling logic without requiring physical GPRS hardware.
Key benefits
Realistic Modem Simulation
Emulates authentic GPRS modem behavior with configurable connect cycles, allowing you to test DNP3 GPRS polling logic against realistic connection patterns (disconnects, reconnects, timing) in a lab environment.
Data-Driven Configuration
Reads active controller configurations directly from the platform database. No simulator-specific configuration files—test the exact modem setup that will run in production.
Multi-Modem Concurrency
Spawns independent communicator threads per modem, simulating multiple simultaneous GPRS connections and testing your GPRS polling service under realistic load.
Bidirectional Protocol Bridging
Transparently forwards DNP3 protocol data between a test harness and GPRS server socket, letting you inspect, modify, or validate protocol traffic without instrumenting production code.
Capabilities
- Spawns one communicator thread per configured DNP3 GPRS modem/meter pair
- Simulates 5-minute connect + 1-minute disconnect cycles per modem
- Queries platform database for active controllers and modem settings (meter serial, device ID, server address, port)
- Initializes logging from database (platform tables table) with rolling file writer
- Bidirectional socket proxying between test harness and GPRS server
- Modem identification handshake (4-byte prefix + meter serial number)
- Synchronous thread-safe pairing mechanism for linking modem threads to test harness connections
- Standalone Gradle build (not part of main multi-project; run independently)
- Hardcoded network endpoints (test harness at localhost:20000, GPRS server at 127.0.0.1:8086; modify via static fields as needed)
