CLS.EEDI power control
Send a timed consumption limit through the authenticated gateway, redeliver it, and read the remaining duration over MQTT 5.
Run the exchange
From a workspace checkout, install Rust 1.90 or later, OpenSSL development libraries with Brainpool support, Just, Python 3 and Mosquitto 2 with its command-line tools. On macOS, Homebrew supplies the broker and clients in the mosquitto formula. On Ubuntu, install mosquitto and mosquitto-clients. Run the command as your regular user.
just eedi
The recipe generates fresh HAN and WAN identities and starts a private broker on an ephemeral IPv4 loopback port. It removes the fixture after the run. A successful run prints the verified readback.
4200 W accepted for 60 s. Duplicate acknowledged. 1 equipment dispatch. Readback: 4200 W with 50 s remaining.
Follow the control
- The local device opens an MQTT connection through a loopback adapter. The adapter dials the gateway over HAN mutual TLS using the provisioned SNI
eedi.test. The gateway authenticates the device and route before opening its separately authenticated WAN connection. The market participant forwards MQTT bytes to the broker. - The backend connects directly to that broker. Once both subscriptions are ready, it publishes a 60-second consumption ceiling. The local device sends its application acknowledgement after simulated equipment accepts the request.
- The backend republishes the same command and ID. The device returns the cached acknowledgement. The backend then reads the active limit after ten seconds on the simulated clock. The equipment counter, acknowledgement identity and correlated state read are checked before printing.
For a Rust integration, enable the eedi feature on smgw-cls. Import the backend and local device from smgw_cls::eedi::engine and the MQTT session from smgw_cls::eedi::transport::mqtt.
The broker uses separate backend and device credentials and directional topics. The short plaintext adapters run on the trusted local machine. The exercise covers one active device session with in-memory duplicate tracking. The returned watts describe a configured ceiling. For observed physical power, use the independent measurement bridge. Measurements · Upstream CLS.EEDI library
Run against an existing test PKI
From the workspace root, build the example first. Then pass a directory generated by the PKI tool to the broker fixture.
cargo build --locked -p smgw-cls --features eedi --example eedi_control
python3 xtask/run-eedi.py -- cargo run --locked -p smgw-cls --features eedi --example eedi_control -- target/test-pki
For a missing or expired test identity, run just eedi to provision a new set. For a handshake error, check the OpenSSL provider and the generated roles. TLS troubleshooting