A service that handles (decodes and converts) incoming data from multiple sources.
flowchart LR
mqtt-->handler
converter--rabbitMQ-->iot-core
facade--http-->iot-device-mgmt
iot-device-mgmt--http-->decoder
iot-device-mgmt--http-->converter
subgraph app server
mqtt
end
subgraph iot-agent
handler--http-->api
api-->facade
decoder-->converter
end
Iot-Agent gets sensor uplink messages on subscribed mqtt-topics exposed by application servers. Messages are handled and POSTed to /api/v0/messages
, which is an local http endpoint.
Metadata about the sensor is fetched from iot-device-mgmt, this metadata contains information about which decoder to use to decode the message payload. The metadata also contains information about the converters to use for measurements.
Since application servers such as Chirpstack has different uplink payloads a facade is used to transform the specific payload into an internal format.
Support for Chirpstack v3 payloads.
Support for payloads from netmore
Decoder implementations for sensors
Decoder for Ambiductor Qalcosonic w1 water meters (w1e, w1t, w1h).
- Volume (incl. timestamp)
- Temperature (w1t)
- Status (codes & messages)
- Temperature
- ExternalTemperature
- Vdd
- CO2
- Humidity
- Light
- Motion
- Occupancy
- DigitalInput
- DigitalInputCounter
Depends on the Generic Javascript decoder
- Battery
- Humidity
- SensorStatus
- SnowHeight
- Temperature
- Temperature
- Humidity
- CO2
- Battery
- Temperature
- BatteryLevel
- Temperature
- Humidity
- DoorReport
- DoorAlarm
- Presence
- BatteryVoltage
- Resistances
- SoilMoistures
- Temperature
Converters converts sensor data to lwm2m measurements.
docker build -f deployments/Dockerfile -t diwise/iot-agent:latest .
curl -X POST http://localhost:8080/api/v0/messages
-H "Content-Type: application/json"
-d '{
"deviceName": "mcg-ers-co2-01",
"deviceProfileName": "ELSYS",
"deviceProfileID": "0b765672",
"devEUI": "a1b2c3d4e5f6",
"data": "AQDuAhYEALIFAgYBxAcONA==",
"object": {
"co2": 452,
"humidity": 22,
"light": 178,
"motion": 2,
"temperature": 23.8,
"vdd": 3636
}
}'
"MQTT_DISABLED": "false", # enable/disable mqtt input
"MQTT_HOST": "<broker hostname>",
"MQTT_PORT": "<broker port number>",
"MQTT_USER": "<username>",
"MQTT_PASSWORD": "<password>",
"MQTT_TOPIC_0": "topic-01/#", # configure mqtt topic names
"MQTT_TOPIC_1": "topic-02/#", # it is possible to specify multiple topics
...
"MQTT_TOPIC_n": "topic-n/#",
"RABBITMQ_HOST": "<rabbit mq hostname>",
"RABBITMQ_PORT": "5672",
"RABBITMQ_VHOST": "/",
"RABBITMQ_USER": "user",
"RABBITMQ_PASS": "bitnami",
"RABBITMQ_DISABLED": "false",
"DEV_MGMT_URL": "http://iot-device-mgmt:8080",
"SERVICE_PORT": "<custom service port, default 8080>",
"MSG_FWD_ENDPOINT" : "http://iot-agent:8080/api/v0/messages",
"OAUTH2_TOKEN_URL": "http://keycloak:8080/realms/diwise-local/protocol/openid-connect/token",
"OAUTH2_CLIENT_ID": "diwise-devmgmt-api",
"OAUTH2_CLIENT_SECRET": "<client secret>",
"APPSERVER_FACADE": "<facade>" # configure application server, chirpstack (default) or netmore
none
none
iot-agent on diwise.github.io