Protocol simulator

CoAP Simulator

Use SPX to simulate CoAP server endpoints with realistic resource trees and observable attributes for IoT integration testing.

Why CoAP simulation matters

Constrained IoT devices use CoAP (Constrained Application Protocol) to exchange data over UDP with minimal overhead. Integration testing against real constrained devices is difficult because hardware is often prototype-stage, network conditions vary, and LwM2M/CoAP stacks behave differently across implementations.

SPX closes that gap by simulating CoAP server endpoints with realistic resource trees, observable attributes, and deterministic responses. Teams can validate IoT clients, LwM2M integrations, and constrained device behavior without waiting on hardware.

IoT problem

Constrained devices are prototype-stage and hard to test

CoAP devices are often sensors or edge nodes that exist only as prototypes, making integration testing slow and hardware-dependent.
Protocol problem

CoAP resource trees and observe patterns need validation

IoT clients expect predictable CoAP resources, GET/PUT semantics, and observe subscriptions that behave like real constrained devices.
Observability problem

UDP exchanges and resource state are hard to inspect

Debugging CoAP interactions over UDP against physical devices provides limited visibility into message flow and resource state.
SPX approach

Simulate CoAP servers with controllable resources

SPX exposes CoAP server endpoints backed by twin attributes, so teams can test GET, PUT, and observe flows with deterministic behavior.

What SPX simulates

SPX provides a CoAP server adapter (coap_server) that exposes resources over UDP and maps requests onto twin attributes using resource and binding definitions. The adapter supports GET, PUT, and observe methods.

CoAP server

Resource trees with GET, PUT, and observe

Expose CoAP resources that respond to standard methods with JSON or CBOR payloads backed by twin attributes.
LwM2M integration

Works with LwM2M device models

CoAP resources integrate with LwM2M environment sensors and constrained device models for full IoT stack testing.
Runtime control

Change resource values and observe behavior at runtime

Modify attribute values behind CoAP resources while the twin is running to test client observe subscriptions and polling.
Scenarios

Reproducible constrained device scenarios

Script sensor value changes, observe notification bursts, and abnormal conditions as repeatable test cases.

Core capabilities

CoAP simulation in SPX is designed for IoT integration testing, embedded firmware validation, and LwM2M stack verification.

Resource mapping

Map CoAP resources to twin attributes

Define CoAP resources with path routing and bind them to attributes for GET responses, PUT writes, and observe notifications.
Runtime control

Steer sensor values and observe behavior

Change temperature, humidity, pressure, or any attribute value while CoAP clients are subscribed and watching.
CI/CD

Run CoAP integration tests in Docker

CoAP twins run in containers alongside LwM2M and MQTT services for automated IoT integration validation.
Observability

Inspect CoAP requests and resource state

See incoming CoAP requests, response payloads, and attribute changes from one runtime view.

Example models

SPX ships with CoAP-compatible environment sensor models that work with LwM2M stacks and raw CoAP clients.

Developer path

CoAP simulation connects directly to the model catalog, Embedded & Lab Pack, and IoT workflows.

Next step

Test CoAP integrations without constrained hardware

Run CoAP server twins locally, validate resource trees and observe flows, and automate IoT regression tests.