diff --git a/examples/sensor_e53_ia1_e2e_demo/e53_ia1_e2e_demo_config.h b/examples/sensor_e53_ia1_e2e_demo/e53_ia1_e2e_demo_config.h index 7a3d2cc3..a6887e4b 100644 --- a/examples/sensor_e53_ia1_e2e_demo/e53_ia1_e2e_demo_config.h +++ b/examples/sensor_e53_ia1_e2e_demo/e53_ia1_e2e_demo_config.h @@ -7,6 +7,6 @@ #define MQTT_USR_NAME "U1BZWHF7F9dev_01;12010126;O3I57;1611533066" #define MQTT_PASSWORD "6ebcf20c9f7f725b5bcf18a85cc7a49479f489eea65946f92ba18a51a135c89e;hmacsha256" #define MQTT_SUBSCRIBE_TOPIC "U1BZWHF7F9/dev_01/data" -#define MQTT_PUBLISH_TOPIC "$shadow/operation/U1BZWHF7F9/dev_01" +#define MQTT_PUBLISH_TOPIC "$shadow/operation/U1BZWHF7F9/dev_01" // $shadow/operation/{MQTT_PRODUCT_ID}/{MQTT_DEV_NAME} #endif diff --git a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/README.md b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/README.md index 93c7a088..9ce07efb 100644 --- a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/README.md +++ b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/README.md @@ -1,4 +1,28 @@ -### 小程序云开发DEMO -1. 说明 -本示例小程序配合TencentOS_tiny开发板智慧农业传感器扩展板使用 -TencentOS-tiny/examples/sensor_e53_ia1_e2e_demo +### 小程序云开发DEMO-智慧农业 + +本示例小程序配合 TencentOS_tiny开发板 + 智慧农业传感器扩展板(E53-IA1) 使用 + ++ 设备端 + + 示例代码路径 + TencentOS-tiny/examples/sensor_e53_ia1_e2e_demo + + + 配置信息 e53_ia1_e2e_demo_config.h +```c +#define MQTT_PRODUCT_ID "U1BZWHF7F9" +#define MQTT_DEV_NAME "dev_01" +#define MQTT_CLIENT_ID "U1BZWHF7F9dev_01" +#define MQTT_USR_NAME "U1BZWHF7F9dev_01;12010126;O3I57;1611533066" +#define MQTT_PASSWORD "6ebcf20c9f7f725b5bcf18a85cc7a49479f489eea65946f92ba18a51a135c89e;hmacsha256" +#define MQTT_SUBSCRIBE_TOPIC "U1BZWHF7F9/dev_01/data" +#define MQTT_PUBLISH_TOPIC "$shadow/operation/U1BZWHF7F9/dev_01" // $shadow/operation/{MQTT_PRODUCT_ID}/{MQTT_DEV_NAME} +``` + 在 腾讯云控制台-物联网通信-产品-设备-设备信息-设备密钥中 获取 + + ![设备密钥](./miniprogram/images/mp_iothub_secret.png) + ++ 云开发 + + 云函数说明 + + iothub-shadow-query 调用接口:物联网通信-设备影子相关接口-获取设备影子 + + iothub-publish 调用接口:物联网通信-消息相关接口-发布消息 + + 云函数开发指引参考: + + [doc/17.Mini_Program_Quick_Start.md](https://github.com/Tencent/TencentOS-tiny/blob/master/doc/17.Mini_Program_Quick_Start.md) - 云开发方式(云函数) \ No newline at end of file diff --git a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/iothub-publish/index.js b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/iothub-publish/index.js index 298668c9..8ca1c66d 100644 --- a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/iothub-publish/index.js +++ b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/iothub-publish/index.js @@ -7,7 +7,7 @@ const Credential = tencentcloud.common.Credential; const ClientProfile = tencentcloud.common.ClientProfile; const HttpProfile = tencentcloud.common.HttpProfile; -let cred = new Credential("AKIDxZ2LTTi84eaR3OfS8hnfxd4JHzQatFpF", "UigMrA9rJXUCeoiBQP8dsJuJ6sYzmNjs"); +let cred = new Credential("AKIDDDzjIeENdhosOg9T0LRXabO0B7pHhzQe", "f6IqCUirpeF1gLn3f0IWosjOqjOyTq2r"); let httpProfile = new HttpProfile(); httpProfile.endpoint = "iotcloud.tencentcloudapi.com"; let clientProfile = new ClientProfile(); diff --git a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/iothub-shadow-query/index.js b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/iothub-shadow-query/index.js index 4a7dc6b8..33a93865 100644 --- a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/iothub-shadow-query/index.js +++ b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/iothub-shadow-query/index.js @@ -7,7 +7,7 @@ const Credential = tencentcloud.common.Credential; const ClientProfile = tencentcloud.common.ClientProfile; const HttpProfile = tencentcloud.common.HttpProfile; -let cred = new Credential("AKIDxZ2LTTi84eaR3OfS8hnfxd4JHzQatFpF", "UigMrA9rJXUCeoiBQP8dsJuJ6sYzmNjs"); +let cred = new Credential("AKIDDDzjIeENdhosOg9T0LRXabO0B7pHhzQe", "f6IqCUirpeF1gLn3f0IWosjOqjOyTq2r"); let httpProfile = new HttpProfile(); httpProfile.endpoint = "iotcloud.tencentcloudapi.com"; let clientProfile = new ClientProfile(); diff --git a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/images/mp_iothub_secret.png b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/images/mp_iothub_secret.png new file mode 100644 index 00000000..f8315ec9 Binary files /dev/null and b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/images/mp_iothub_secret.png differ