- Overview
- Quickstarts
- Build a sensor publisher
Build a sensor publisher
Use this quickstart to give a sensor one canonical UUID, publish its typed entity event, and attach a location, including Position Location Information (PLI). In three steps, you will validate the examples, choose a durable identity, and publish the sensor and its position.
Before you begin, complete installation and have two shells available for the mock broker and publisher.
Run profile: offline model check and loopback mock. The publication commands are staging- and production-oriented only for a sensor integration whose broker ACLs authorize the exact entity and location publications. Live use changes ECN-visible state.
Shell labels (A, B) mark blocks that must run concurrently. Each block inlines the loopback-mock connection variables; for a live ECN, replace them with the authentication block.
1. Validate the examples offline
Section titled “1. Validate the examples offline”python examples/publish_entity.py --checkpython examples/publish_location.py --checkThese checks validate the example inputs without connecting to a broker.
2. Choose one durable identity
Section titled “2. Choose one durable identity”Generate a UUID once for the sensor and persist it in your own configuration. Reuse that UUID across JSON or protobuf entity events, ordinary location updates, PLI, and any task targeting for the same physical or logical sensor.
3. Publish the entity and position
Section titled “3. Publish the entity and position”Shell A — mock broker (leave running):
picogrid-mock-ecn --mqtt-port 1883Skip Shell A if you are targeting a live ECN.
Shell B — publisher:
export ECN_HOST=127.0.0.1export ECN_MQTT_PORT=1883export ECN_INTEGRATION_NAME=example-integrationexport ECN_BEARER_TOKEN=mock-full-accessexport ECN_ALLOW_INSECURE=1
export ECN_ENTITY_ID=00000000-0000-4000-8000-000000000001export ECN_ENTITY_CATEGORY=SENSORexport ECN_ENTITY_TYPE=weather-stationexport ECN_ENTITY_NAME=synthetic-sensorpython examples/publish_entity.py
export ECN_LATITUDE=0export ECN_LONGITUDE=0python examples/publish_location.pyEach command is a mutation and must be authorized by the broker ACL. A publication receipt reports the MQTT operation; it does not promise persistence or downstream processing.
Your next step is the sensor integration guide, where you can choose update cadence, wire format, QoS, and lifecycle behavior.
Version 0.2.0 · branch main
