A CPE simulator for TR-069 protocol. It supports both TR-098 and TR-181 datamodel formats.
Warning
This project is under active development.
All required TR-069 operations are implemented. Current work focuses on optimizations and compatibility.
Give it a serial number, point to a datamodel file and the ACS and it should work out of the box.
See server/config.go
for available configuration options.
Add a service to the docker-compose.yml
file:
services:
tr069sim:
image: ghcr.io/localhots/simulatr69:latest
volumes:
- /path/to/datamodel.csv:/app/datamodel.csv
- sim_state:/state
ports:
- 7547
environment:
SERIAL_NUMBER: G3000E-9799109101
DATAMODEL_PATH: /app/datamodel.csv
STATE_PATH: /state/state.json
ACS_URL: http://myisp/acs
LOG_LEVEL: debug
volumes:
sim_state:
All required methods are supported and should behave realistically, except Upload currently don't do anything. There are quirks though.
Datamodel files are provided in CSV format similar to the one used by GenieACS simulator.
It is possible to fake parameter values using parameter noise generators, e.g.:
Parameter,Object,Writable,Value,Type
Device.DeviceInfo.ProcessStatus.CPUUsage,false,true,"perlinNoise(offset=50, alpha=2, beta=2, scale=40) as xsd:int",sim:generator
NORMALIZE_PARAMETERS
when set to true
will make the simulator attempt to
normalize datamodel parameters. Normalization will bring parameter types to
common xsd:
prefixed format with values checked against their types: negative
unsigned integer numbers will be corrected to zeroes, boolean "yes" will be
normalized to "true".
Default is false
.
Simulator can accept connection requests made over UDP and HTTP. If the ACS will set the following parameter values they will be respected:
ManagementServer.ConnectionRequestUsername
ManagementServer.ConnectionRequestPassword
The simulator supports firmware upgrades in a simple JSON format:
{"version": "123.45"}
If the provided URL can't be loaded or if the firmware file has a different format the simulator will respond with a fault.
If everything is fine the simulator will change DeviceInfo.SoftwareVersion
parameter value in its state and pretend to take time to upgrade and reboot.