检测到您已登录华为云国际站账号,为了您更好的体验,建议您访问国际站服务网站 https://www.huaweicloud.com/intl/zh-cn
不再显示此消息
REGION_CN_NORTH_4 = new Region(REGION_ID, ENDPOINT); public static void main(String[] args) { String ak = "<YOUR AK>"; String sk
-1", "status": "ONLINE" } ], "failed_devices": [ ] } } ] } 在控制台“所有设备”查看两个子设备为在线,表明
ING:转发RocketMQ消息类型。(仅标准版和企业版支持) channel_detail 是 ChannelDetail object 参数说明:通道参数。 表4 ChannelDetail 参数 是否必选 参数类型 描述 http_forwarding 否 HttpForwarding
public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great
行。 Waiting for the device online timeout 等待设备上线超时 请检查设备侧。 Wait for the device to report upgrade result timeout 等待设备上报升级结果超时 请检查设备侧。 Waiting for
public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great
static final String ENDPOINT = "<YOUR ENDPOINT>"; public static void main(String[] args) { // 认证用的ak和sk直接写到代码中有很大的安全风险,建议在配置文件或者环境变量中密文存放,使用时解密,确保安全;
public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great
产品中定义的Topic会被平台拒绝。使用方式可以参考链接使用自定义Topic进行通信的最佳实践。 使用非$oc开头的自定义Topic,如/aircondition/data/up进行消息通信,这类Topic平台不校验Topic权限,根据MQTT协议定义的规则进行Topic的消息上
"IOTDA.XXXXX", "error_msg" : "XXXXX." } } status 执行结果,这里为子任务的状态,支持Success、Fail、Stopped和Removed 表3 非批量任务格式说明 字段 说明 recordTime 日志采集时间,时间格式为yyyy-MM-dd'T'HH:mm:ss
消息体为二进制格式。 物联网平台向应用返回200 OK,携带命令状态为SENT。(如果设备不在线或者设备没收到指令则下发失败,命令状态为FAILED) 设备收到命令后返回ACK响应。 若应用订阅了命令的状态变更通知,物联网平台通过命令状态更新通知接口推送消息给应用,携带命令状态为DELIVERED。消息样例如下:
public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great
huaweicloudsdkcore.auth.credentials import DerivedCredentials if __name__ == "__main__": # 认证用的ak和sk直接写到代码中有很大的安全风险,建议在配置文件或者环境变量中密文存放,使用时解密,确保安全;
REGION_CN_NORTH_4 = new Region(REGION_ID, ENDPOINT); public static void main(String[] args) { String ak = "<YOUR AK>"; String sk
"paras": { "areaIds": [ 1 ] } } 请求参数 paras字段同协议中消息的映射关系 表23 参数描述 字段名 类型 协议字段 参数描述 areaIds stringList 区域ID列表 /
授权项列表 API分组 权限 API 授权项(Action) 产品管理 创建产品 POST /v5/iot/{project_id}/products iotda:products:create 查询产品列表 GET /v5/iot/{project_id}/products i
ent的publish(String topic,MqttMessage message)方法向平台上报设备属性值。 查看上报数据 运行main方法成功启动后,即可在设备详情页面查看上报的设备属性数据。详细接口信息请参考设备属性上报。 图8 查看上报数据-luminance 如果
public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great
网关上报子设备属性 接口说明 用于批量设备上报属性数据给平台。网关设备可以用此接口同时上报最多50个子设备的属性数据。 URI 请求方法 POST URI /v5/devices/{device_id}/sys/gateway/sub-devices/properties/report
网关批量设备属性上报 功能介绍 用于批量设备上报属性数据给平台。网关设备可以用此接口同时上报多个子设备的属性数据。网关与子设备关系,请查看网关与子设备。 属性上报和消息上报的区别,请查看消息通信说明。 网关批量设备属性上报,单批次最多可上报100个子设备的属性数据。如果子设备数量超过100个,建议分不同批次进行上报。