调用已配置LoRaWAN设备命令时Orion Context Broker返回NotFound
Orion Context Broker返回NotFound错误:通过PATCH请求调用执行器命令失败
在IoT Agent中配置了一台执行器设备,尝试通过PATCH请求向该执行器发送命令时,Orion Context Broker返回NotFound错误,但直接调用IoT Agent的v2/op/update接口可以正常执行命令。
设备配置信息
{ "devices": [ { "device_id": "actuator-testing", "entity_name": "bell002", "entity_type": "notifier", "timezone": "America/Santiago", "endpoint": "http://localhost:4061/v2/notify", "attributes": [ { "object_id": "t1", "name": "temperature_1", "type": "Number" } ], "commands": [ {"object_id": "ring", "name": "ring", "type": "command" } ], "internal_attributes": { "lorawan": { "application_server": { "host": "au1.cloud.thethings.network", "username": "temp-sensorss@ttn", "password": "NNSXS.EXA3TWFPPGZ32GDCMWMWQWYPGJ3SI6OQMYNGNJI.3IMRDQHLOQCM5SMOHXQLZU2B7MXNMQYBSKTJX3OLOT4VVH6H2JWQ", "provider": "TTN" }, "dev_eui": "70B3D57ED007082D", "app_eui": "1231314133224231", "application_id": "temp-sensorss@ttn", "application_key": "CE9CA5D1665846B6B5355C809E0F8FC5", "data_model": "application_server" } } } ] }
发送的PATCH请求
curl http://{{URL}}:1026/v2/entities/bell002/attrs?type=notifier \ -d { "ring": { "type": "command", "value": "" } }
错误响应
{ "error": "NotFound", "description": "The requested entity has not been found. Check type and id" }
容器配置
orion-v2: image: quay.io/fiware/orion:4.1.0 hostname: orion container_name: fiware-orion depends_on: - mongo-db networks: default: ipv4_address: 172.18.1.9 expose: - "${ORION_PORT}" ports: - "${ORION_PORT}:${ORION_PORT}" # localhost:1026 #command: -logLevel DEBUG -noCache -dbhost mongodb -corsOrigin __ALL command: -dbURI mongodb://mongo-db -logLevel DEBUG iot-agent: image: fiware/iotagent-ul:3.7.0-distroless hostname: iot-agent container_name: fiware-iot-agent depends_on: - mongo-db - orion-v2 networks: default: ipv4_address: 172.18.1.100 ports: - "${IOTA_NORTH_PORT}:${IOTA_NORTH_PORT}" # localhost:4041 - "${IOTA_SOUTH_PORT}:${IOTA_SOUTH_PORT}" # localhost:7896 environment: - IOTA_CB_HOST=orion - IOTA_CB_PORT=${ORION_PORT} # port the context broker listens on to update context - IOTA_NORTH_PORT=${IOTA_NORTH_PORT} - IOTA_REGISTRY_TYPE=mongodb #Whether to hold IoT device info in memory or in a database - IOTA_LOG_LEVEL=DEBUG # The log level of the IoT Agent - IOTA_TIMESTAMP=true # Supply timestamp information with each measurement - IOTA_CB_NGSI_VERSION=v2 # use NGSIv2 when sending updates for active attributes - IOTA_AUTOCAST=true # Ensure Ultralight number values are read as numbers not strings - IOTA_MONGO_HOST=mongo-db # The host name of MongoDB - IOTA_MONGO_PORT=${MONGO_DB_PORT} # The port mongoDB is listening on - IOTA_MONGO_DB=iotagentjson # The name of the database used in mongoDB - IOTA_HTTP_PORT=${IOTA_SOUTH_PORT} # The port used for device traffic over HTTP - IOTA_PROVIDER_URL=http://iot-agent:${IOTA_NORTH_PORT} - IOTA_AUTH_ENABLED=true - IOTA_AUTH_TYPE=oauth2 - IOTA_AUTH_HEADER=Authorization - IOTA_AUTH_HOST=keyrock - IOTA_AUTH_PORT=${KEYROCK_PORT} - IOTA_AUTH_URL=http://keyrock:${KEYROCK_PORT} - IOTA_AUTH_CLIENT_ID=tutorial-dckr-site-0000-xpresswebapp - IOTA_AUTH_CLIENT_SECRET=tutorial-dckr-site-0000-clientsecret - IOTA_AUTH_PERMANENT_TOKEN=true - IOTA_AUTH_TOKEN_PATH=/oauth2/token
可正常执行的请求(直接调用IoT Agent接口)
curl http://iot-agent-host:4041/v2/op/update \ -d { "actionType": "update", "entities": [ { "id": "bell002", "type": "notifier", "ring": { "type": "command", "value": {""} } } ] }
该请求可正常更新ringStatus和ringInfo。
内容的提问来源于stack exchange,提问作者Ramona IOT
相关产品推荐
相关产品推荐

