[英]How to store messages in /mosquitto/data MQTT mosquitto?
[英]Orion mosquitto JSON data
我對 Orion Context Broker 有一些問題。 我正在使用樹莓派將 JSON 數據發布到作為 docker 容器運行的蚊子代理。 我可以從發布者那里接收數據,代理應該將數據傳遞給 Orion 上下文代理。 我創建了一個這樣的實體:
curl localhost:1026/v2/entities -s -S -H 'Content-Type: application/json' -d @- <<EOF
{
"id": "SensTemp",
"type": "Sensor",
"temperature": {
"value": 28,
"type": "Float"
}
}
EOF
我可以使用 curl 命令手動更新溫度值而不會出現任何問題。 問題是我的蚊子容器中的數據沒有 go 到 Orion Context Broker。 這是我的 docker 容器:
version: "3.3"
services:
mongo-db:
image: mongo:3.6
hostname: mongo-db
container_name: db-mongo
expose:
- "27017"
ports:
- "27017:27017"
networks:
- default
command: --bind_ip_all --smallfiles
orion:
image: fiware/orion
ports:
- "1026:1026"
networks:
- default
depends_on:
- mongo-db
command: -dbhost mongo-db -logLevel DEBUG
healthcheck:
test: ["CMD", "curl", "-f", "http://0.0.0.0:1026/version"]
interval: 1m
timeout: 10s
retries: 3
mqtt:
image: eclipse-mosquitto:latest
container_name: mqtt
ports:
- "1883:1883"
- "9001:9001"
expose:
- "1883"
- "9001"
volumes:
- /opt/mosquitto/var/run:/var/run
這是我的樹莓派發布者收到的數據的證明:
如何設置 Orion 以從我的 mosquitto 容器中獲取數據?
當您創建設備時,您是否指示了傳輸?
例如
"device_id": "streetLight001",
"entity_name": "urn:ngsi-ld:StreetLight:001",
"entity_type": "StreetLight",
"protocol": "PDI-IoTA-UltraLight",
"transport": "MQTT",
"timezone": "America/Bogota",
當您創建設備時,您是否指明了傳輸和屬性(請參見此圖)? 使用屬性創建實體
問題已解決,問題出在代理中。 我使用的是 Ultralight IOT 代理而不是 JSON 代理
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.