<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>

新聞中心

EEPW首頁(yè) > 嵌入式系統 > 設計應用 > 運用DragonBoard 410c開(kāi)發(fā)板接入物聯(lián)網(wǎng)云服務(wù)

運用DragonBoard 410c開(kāi)發(fā)板接入物聯(lián)網(wǎng)云服務(wù)

作者: 時(shí)間:2017-10-11 來(lái)源:網(wǎng)絡(luò ) 收藏

前段時(shí)間入手一臺Dragon Board410c的開(kāi)發(fā)板。雖然功能強大,而且還是高通自家產(chǎn)品,無(wú)線(xiàn)基帶很是不錯, 但是由于自己對這網(wǎng)絡(luò )與運維理解不是很透徹,所以還是沒(méi)辦法完全發(fā)揮其全部的實(shí)力。 去年有申請了云服務(wù)器試用。 離試用期結束還有一個(gè)多月的時(shí)間,剛好發(fā)現在官網(wǎng)提供了IoT設備的云服務(wù), 經(jīng)過(guò)了解于是打算將自己的410c開(kāi)發(fā)板連接到云服務(wù)上,測試一下410c的網(wǎng)絡(luò )功能與吞吐能力。

本文引用地址:http://dyxdggzs.com/article/201710/365527.htm

首先介紹一下需要的設備吧: DragonBoard 410c一塊 + 云服務(wù)器

第一步: 準備云服務(wù)

首先我們需要在平臺服務(wù)實(shí)例中創(chuàng )建一個(gè)新的實(shí)例:

添加設備

接下來(lái)我們需要創(chuàng )建一個(gè)OrganizaTIon,也就是410c的設備集群。當我們通過(guò)Bluemix創(chuàng )建好組織后, 我們就可以注冊并添加設備

- 首先在物聯(lián)網(wǎng)服務(wù)組織的dashboard上點(diǎn)擊Add a your device按鈕

- 然后根據屏幕上的提示進(jìn)行設置

在注冊設備的時(shí)候我們還需要編寫(xiě)如下的設備信息:

- 組織ID

- 設備種類(lèi)ID

- 設備ID

- 認證方法

- 認證口令

第二部:配置DragonBoard 410c

在410c中下載一個(gè)MQTT-client應用

為了安裝物聯(lián)網(wǎng)平臺的客戶(hù)端庫以及MQTT-client應用,我們需要按照下面的步驟進(jìn)行安裝:

首先是安裝最新版本的庫, 在命令行中輸入如下指令:

[root@localhost ~]# git clone https://github.com/ibm-messaging/iotf-embeddedc.git

從下載后的壓縮文件中提取出代碼

cd iotf-embeddedc

tar xvzf org.eclipse.paho.mqtt.embedded-c-1.0.0.tar.gz

客戶(hù)端代碼的結構如下所示

|-lib - contains all the dependent files

|-samples - contains the helloWorld and sampleDevice samples

|-sample device.c - sample device implementaTIon

|-helloworld.c - quickstart applicaTIon

|-README.md

|-Makefile

|-build.sh

|-iotfclient.c - Main client file

|-iotfclient.h - Header file for the client

搭建MQTT-client應用

首先進(jìn)入到案例目錄下并執行Make指令

cd iotf-embeddedc/samples

make

屏幕上可看到如下的輸出

cc sampleDevice.c -I ./https://developer.ibm.com/recipes/ -I ./https://developer.ibm.com/recipes/lib ./https://developer.ibm.com/recipes/iotfclient.c ./https://developer.ibm.com/recipes/lib/MQTTClient.c ./https://developer.ibm.com/recipes/lib/MQTTLinux.c ./https://developer.ibm.com/recipes/lib/MQTTFormat.c ./https://developer.ibm.com/recipes/lib/MQTTPacket.c ./https://developer.ibm.com/recipes/lib/MQTTDeserializePublish.c ./https://developer.ibm.com/recipes/lib/MQTTConnectClient.c ./https://developer.ibm.com/recipes/lib/MQTTSubscribeClient.c ./https://developer.ibm.com/recipes/lib/MQTTSerializePublish.c ./https://developer.ibm.com/recipes/lib/MQTTConnectServer.c ./https://developer.ibm.com/recipes/lib/MQTTSubscribeServer.c ./https://developer.ibm.com/recipes/lib/MQTTUnsubscribeServer.c ./https://developer.ibm.com/recipes/lib/MQTTUnsubscribeClient.c -o sampleDevice

strip sampleDevice

配置MQTT-client應用的連接參數

為了能讓MQTT-client應用能夠連接到Watson物聯(lián)網(wǎng)服務(wù)中, 我們需要將步驟一中的參數傳遞給連接參數。 連接參數可以通過(guò)命令行進(jìn)行修改,或者直接在設備配置文件中進(jìn)行修改:

打開(kāi)設備配置文件:iotf-embeddedc/samples/device.cfg

nano iotf-embeddedc/samples/device.cfg

添加第一部中我們設置好的參數

org=$orgId

type=$myDeviceType

id=$myDeviceId

auth-method=$token

auth-token=$token

啟動(dòng)案例MQTT-client應用

啟動(dòng)應用后,我們就可以連接到服務(wù),而且我們能夠看到如下的輸出

ConnecTIng to registered service with org your org>

Publishing the event stat with rc 0

Publishing the event stat with rc 0

Publishing the event stat with rc 0

...

最后一步:在物聯(lián)網(wǎng)平臺的DashBoard上認證連接設備

一旦Client-app啟動(dòng),我們就可以在IoT的DashBoard上配置設備并且驗證連接與數據了:

首先登陸到賬號并開(kāi)啟IoT的DashBoard

我們能在Board上看到傳輸來(lái)的JSON信息

總結

這次實(shí)驗演示了:MQTT-client應用的發(fā)布以及設備上IoT云服務(wù)的開(kāi)啟。 接下來(lái)我們就可以基于410c與平臺進(jìn)行擴展與開(kāi)發(fā)應用了。

我聯(lián)想到了多種可能的方案,以供參考:

1、擴展MQTT-client應用,從而訪(fǎng)問(wèn)DragonBoard硬件

- 讀取的硬件狀態(tài)

- 讀取所連接的傳感器的值

- 控制所連接的運動(dòng)器(如LED、馬達等

2、通過(guò)結合云服務(wù)與其他應用來(lái)擴展云端的容量,并與其他設備進(jìn)行互動(dòng)

- 數據可視化

- 數據存儲

- 數據分析



評論


相關(guān)推薦

技術(shù)專(zhuān)區

關(guān)閉
国产精品自在自线亚洲|国产精品无圣光一区二区|国产日产欧洲无码视频|久久久一本精品99久久K精品66|欧美人与动牲交片免费播放
<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>