Lightweight DLMS meter simulator for poller validation
Standalone Java simulator for end-to-end testing of DLMS TCP pollers against a virtual meter, eliminating the need for physical hardware during development and integration testing.
What it is
DLMS TCP Server Simulator is a pure-Java TCP server that emulates a DLMS/COSEM energy meter, enabling system integrators and QA teams to validate the DLMS TCP Client Service poller without physical hardware. It implements the full DLMS/COSEM protocol (LN referencing, WRAPPER/TCP) with a minimal but realistic object set: a clock synchronized to system time, a fixed serial number, and an energy register that increments by 0.1 kWh on each read to help test harnesses confirm fresh data is being fetched. Each client connection runs in its own execution context with independent session state, preventing cross-client contamination. Runs standalone on the standard DLMS port (4059) or a custom port of your choice.
Key benefits
Eliminate hardware dependencies
Test poller logic, connection retry, error handling, and multi-meter orchestration without accessing real meters or modems. Spin up as many concurrent test instances as needed on different ports.
Deterministic energy values
Energy counter increments by exactly 0.1 kWh per read, making it trivial to detect fresh data vs. cached responses and verify correct fetch cycles.
Low operational overhead
No database, no external daemons, no native dependencies—only Java runtime and the simulator jar. Starts in milliseconds and consumes minimal memory per concurrent client.
Stateless per-connection design
Each client gets its own virtual-threaded instance with independent AARQ counters and sequence numbers, so stress testing with hundreds of concurrent connections does not require connection pooling tuning.
Capabilities
- DLMS/COSEM protocol (LN referencing mode, WRAPPER/TCP encapsulation)
- Authentication: NONE or LOW (password: '12345678'); HIGH and GMAC variants rejected
- COSEM objects: association, TCP setup, clock, serial number ('WIZSIM00001'), energy register (0.1 kWh increments)
- Per-connection lightweight concurrency for lightweight concurrent client handling
- Custom port binding via command-line flag (default: a configurable port)
- Configurable meter behavior via test-time dependency injection for behavior overrides
- Standalone executable generation for containerized or CI/CD deployments
