真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

設(shè)備數(shù)據(jù)通過AzureFunctions推送到PowerBI數(shù)據(jù)大屏進(jìn)行展示(1準(zhǔn)備工作)

設(shè)備數(shù)據(jù)通過Azure Functions 推送到 Power BI 數(shù)據(jù)大屏進(jìn)行展示(1準(zhǔn)備工作)

創(chuàng)新互聯(lián)公司專注為客戶提供全方位的互聯(lián)網(wǎng)綜合服務(wù),包含不限于成都網(wǎng)站建設(shè)、網(wǎng)站設(shè)計、曲麻萊網(wǎng)絡(luò)推廣、小程序定制開發(fā)、曲麻萊網(wǎng)絡(luò)營銷、曲麻萊企業(yè)策劃、曲麻萊品牌公關(guān)、搜索引擎seo、人物專訪、企業(yè)宣傳片、企業(yè)代運(yùn)營等,從售前售中售后,我們都將竭誠為您服務(wù),您的肯定,是我們最大的嘉獎;創(chuàng)新互聯(lián)公司為所有大學(xué)生創(chuàng)業(yè)者提供曲麻萊建站搭建服務(wù),24小時服務(wù)熱線:028-86922220,官方網(wǎng)址:www.cdcxhl.com

本案例適用于開發(fā)者入門理解Azure Functions/ IoT Hub / Service Bus / Power BI等幾款產(chǎn)品。

設(shè)備數(shù)據(jù)通過Azure Functions 推送到 Power BI 數(shù)據(jù)大屏進(jìn)行展示(1準(zhǔn)備工作)

主要實(shí)戰(zhàn)的內(nèi)容為:

  1. 將設(shè)備遙測數(shù)據(jù)上傳到物聯(lián)網(wǎng)中心,

  2. 將遙測數(shù)據(jù)路由到消息中間件的Topic中,

  3. 使用Azure Function解析消息中間件Topic中的消息并推送到大屏?。

本文主要是本案例的準(zhǔn)備工作,即(第1條和第2條的內(nèi)容):

1.創(chuàng)建IoT Hub:

https://v.qq.com/x/page/h4031pnaxi8.html

2.創(chuàng)建Service Bus:

https://v.qq.com/x/page/b3031hdv9yk.html

3.?創(chuàng)建IoT Hub 消息路由,將遙測消息路由到Service Bus Topic

https://v.qq.com/x/page/i3031hkec4q.html

本示例中的Python Device 代碼來自于微軟官網(wǎng),請參照:

https://docs.azure.cn/zh-cn/iot-hub/quickstart-send-telemetry-python

#?Copyright?(c)?Microsoft.?All?rights?reserved.#?Licensed?under?the?MIT?license.?See?LICENSE?file?in?the?project?root?for?full?license?information.import?randomimport?timeimport?sys#?Using?the?Python?Device?SDK?for?IoT?Hub:#???https://github.com/Azure/azure-iot-sdk-python#?The?sample?connects?to?a?device-specific?MQTT?endpoint?on?your?IoT?Hub.import?iothub_client#?pylint:?disable=E0611from?iothub_client?import?IoTHubClient,?IoTHubClientError,?IoTHubTransportProvider,?IoTHubClientResultfrom?iothub_client?import?IoTHubMessage,?IoTHubMessageDispositionResult,?IoTHubError,?DeviceMethodReturnValue#?The?device?connection?string?to?authenticate?the?device?with?your?IoT?hub.#?Using?the?Azure?CLI:#?az?iot?hub?device-identity?show-connection-string?--hub-name?{YourIoTHubName}?--device-id?MyNodeDevice?--output?tableCONNECTION_STRING?=?"your?device?conn?string"#?Using?the?MQTT?protocol.PROTOCOL?=?IoTHubTransportProvider.MQTTMESSAGE_TIMEOUT?=?10000#?Define?the?JSON?message?to?send?to?IoT?Hub.TEMPERATURE?=?20.0HUMIDITY?=?60MSG_TXT?=?"{\"temperature\":?%.2f,\"humidity\":?%.2f}"def?send_confirmation_callback(message,?result,?user_context):????print?(?"IoT?Hub?responded?to?message?with?status:?%s"?%?(result)?)def?iothub_client_init():????#?Create?an?IoT?Hub?client????client?=?IoTHubClient(CONNECTION_STRING,?PROTOCOL)????return?clientdef?iothub_client_telemetry_sample_run():????try:????????client?=?iothub_client_init()????????print?(?"IoT?Hub?device?sending?periodic?messages,?press?Ctrl-C?to?exit"?)????????while?True:????????????#?Build?the?message?with?simulated?telemetry?values.????????????temperature?=?TEMPERATURE?+?(random.random()?*?15)????????????humidity?=?HUMIDITY?+?(random.random()?*?20)????????????msg_txt_formatted?=?MSG_TXT?%?(temperature,?humidity)????????????message?=?IoTHubMessage(msg_txt_formatted)????????????#?Add?a?custom?application?property?to?the?message.????????????#?An?IoT?hub?can?filter?on?these?properties?without?access?to?the?message?body.????????????prop_map?=?message.properties()????????????if?temperature?>?30:??????????????prop_map.add("temperatureAlert",?"true")????????????else:??????????????prop_map.add("temperatureAlert",?"false")????????????#?Send?the?message.????????????print(?"Sending?message:?%s"?%?message.get_string()?)????????????client.send_event_async(message,?send_confirmation_callback,?None)????????????time.sleep(3)????except?IoTHubError?as?iothub_error:????????print?(?"Unexpected?error?%s?from?IoTHub"?%?iothub_error?)????????return????except?KeyboardInterrupt:????????print?(?"IoTHubClient?sample?stopped"?)if?__name__?==?'__main__':????print?(?"IoT?Hub?Quickstart?#1?-?Simulated?device"?)????print?(?"Press?Ctrl-C?to?exit"?)????iothub_client_telemetry_sample_run()

設(shè)備數(shù)據(jù)通過Azure Functions 推送到 Power BI 數(shù)據(jù)大屏進(jìn)行展示(1準(zhǔn)備工作)


名稱欄目:設(shè)備數(shù)據(jù)通過AzureFunctions推送到PowerBI數(shù)據(jù)大屏進(jìn)行展示(1準(zhǔn)備工作)
當(dāng)前地址:http://weahome.cn/article/gjjjdg.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部