esp8266模塊指導(dǎo)2原廠參考2b-espressif iot demo使用手冊_第1頁
esp8266模塊指導(dǎo)2原廠參考2b-espressif iot demo使用手冊_第2頁
esp8266模塊指導(dǎo)2原廠參考2b-espressif iot demo使用手冊_第3頁
esp8266模塊指導(dǎo)2原廠參考2b-espressif iot demo使用手冊_第4頁
esp8266模塊指導(dǎo)2原廠參考2b-espressif iot demo使用手冊_第5頁
免費(fèi)預(yù)覽已結(jié)束,剩余15頁可下載查看

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

EspressifIoDemoCurrentFeiCompletionJiangangCompletion ] ]INTERNAL[]PUBLIC版本信JiangangFeiFei增加FeiFei增加WEP本文中的信息,包括供參考的URL地址,變更,恕不另行通知在此未以反言或其他方式授予任何知識使用,不管是明示還是暗示。Wi-Fi成員標(biāo)志歸Wi-Fi所有權(quán)歸?2014所有。保留所利。版本信 前 總體介 代碼結(jié) 工作模 調(diào)試工 局域網(wǎng)功 通用功 獲取版本信 設(shè)置連接參 連接模式的切 局域網(wǎng)內(nèi)設(shè)備查 插 獲取插座狀 設(shè)置插座狀 獲取燈狀 設(shè)置燈狀 溫濕 廣域網(wǎng)功 espressif服務(wù)器平 激 認(rèn) 服務(wù) 插 溫濕 用戶自定義反向控 前EspressifIoTSDKIoTDemo中,總體介代碼結(jié) IoTDemouser_webserver.c——提供REST的輕量webserver功能;user_json.c——json包處理功能; includeuser_config.h文件,在該文件中可以對采用平臺,以及具體demo進(jìn)行選擇,具體支持如下例子:LIGHT_DEIC(SNSOR_DVIC(;其中SENSOR_DEVICE又分為HUMITURE_SUB_DEVICE(溫濕度計(jì))和 工作模IoTDemowifisoftAP+stationstation。出廠默sotfAP+station共存的模用戶softAP接口的局域網(wǎng),發(fā)指station接口連接可入的路由(AP用戶可通過向softAP接口發(fā)指令查詢stationsleep)進(jìn)入station模式(指令詳見3.1.2設(shè)置連接參數(shù)。softAP的ESP_XXXXXXXXXXXXMAC地址的后面三個(gè)字節(jié),默認(rèn)加密模式為/2。服務(wù)連接接用調(diào)試工可采用curl命令??稍诟鶕?jù)()進(jìn)行指定版本的,后文中的curl指令請參照“Windowscurl”的示例。Curl局域網(wǎng)功softAPip,stationipesp_iot_sdk\app\include\user_config.hPASSWORD,配置。例如,esp_iot_sdk_v.08定義宏P(guān)ASSWORD為“v*%W>L<@i&Nxe!”,某設(shè)備的softAPMAC地址為:1a:fe:86:90:d5:7b,則連接為:通用{"Version":{"Version":curl-XGET"Device":"Device":"manufacture","manufacture","Espressif}}碼如前述PC側(cè)發(fā)送curl指令來控制設(shè)備。PC發(fā)送下述指令,將設(shè)備連入Linux/Cygwincurlcurl-XPOST-H"Content-Type:application/json"-d .","token":Windowscurlcurl-XPOST-H"Content-Type:application/json"-dken\":上述紅色token字段是個(gè)隨機(jī)的長度為40的16進(jìn)制數(shù)的字符串。設(shè)備后續(xù)curl-XPOST-HContent-Type:application/json-dken":curl-XPOST-HContent-Type:application/json-dken":Windowscurlcurl-XPOST-H"Content-Type:application/json"-d"{\"Request\":{\"Station\ \",\"token\": 7890\"}}}}" curl-XGET curl-XGET curlcurl-XPOST curlcurl-XPOST 、password等Linux/Cygwin Windowscurlcurl-XPOST-H"Content-Type:application/json"-d authmode支持如下模式:OPEN、 password長度需不小于8個(gè)字符。(1)softAPstation(2)APP(或PC)連入ESP8266softAP下指令,讓ESP8266station連接路由。此時(shí)可以查詢station的連接狀態(tài)。softAPstation2由宏定義#defineAP_CACHE控制此功能開關(guān)。局域網(wǎng)內(nèi)設(shè)備查1025UDP廣播包的方法進(jìn)行設(shè)備的查找,發(fā)送I’m燈I’mI’m插curl-Xcurl-XGET {{{:}Linux/Cygwincurlcurl-XPOST-H"Content-Type:application/json"-d' Windows":1}}" 燈curlcurl-XGET {{"rgb":{"red":"green":"blue":}}Linux/Cygwincurlcurl-XPOST-H"Content-Type:application/json"-d Windows"red\":200,\"green\":0,\"blue\":0}}" 溫濕廣域網(wǎng)功espressif服務(wù)器平作及API介紹。PC關(guān)于設(shè)備的espressifespressif服務(wù)器申請masterdevicekey,燒錄到spiflash0x3e000位置。Bin的燒寫順序:blank.bineagle.app.v6.flash.binmaster-device-key.bin時(shí),可以直接eagle.app.v6.flash.bin->eagle.app.v6.irom0text.bin。根據(jù)設(shè)置去連接路由,station接口連上路由后,會(huì)默認(rèn)向服務(wù)器激活設(shè)備。{"path":"/v1/device/activate/","method":"POST","meta":{"Authorization":"tokenHERE_IS_THE_MASTER_DEVICE_KEY"},"body":{"encrypt_method":"IN","b":"18:fe:34:70:12:00","token":" 激活需要往espressif的服務(wù)器,ip地址為7,端口{"path":"/v1/device/activate/","method":"POST","meta":{"Authorization":"tokenHERE_IS_THE_MASTER_DEVICE_KEY"},"body":{"encrypt_method":"IN","b":"18:fe:34:70:12:00","token":" HERE_IS_THE_MASTER_DEVICE_KEYspiflashdevice78903.1.2{"status":200,"device":{"status":200,"device":{device},"key":{key},"token":PCPC側(cè)在配置完設(shè)備的、password及token后需要連接到一個(gè)可上的Linux/Cygwincurlcurl-XPOST-H"Authorization:token12"-d'{"token":"Windowscurlcurl-XPOST-H"Authorization:token12"-d"{\"token\":\"7890\"}"{"status":{"status":200,"key":{"updated":"2014-05-1221:22:03","user_id":1,"product_id":0,"name":"deviceactivatesharetoken","created":"2014-05-1221:22:03","source_ip":"*","visibly":1,"id":149,"datastream_tmpl_id":0,"token":"e474bba4b8e11b97b91019e61b7a018cdbaa3246","access_methods":"*","is_owner_key":1,"scope":3,"device_id":29,"activate_status":1,"datastream_id":0,"expired_at":"2288-02-22cbb6ec4c18fcf3e44ce9955f19fa3ba12為用戶的userkey舉例,實(shí)際需要用戶填入自己的userkey值,獲取方式如下:登陸Espressif服務(wù)器 /,用戶名登陸->右上角用戶名->設(shè)置->開e474bba4b8e11b97b91019e61b7a018cdbaa3246為獲取到的設(shè)備ownerkey址為7,端口為8000,發(fā)送如下格式的的tcp包。,"path":"/v1/device/identify","method":"GET",{"Authorization":"token這個(gè)tcp的包的作用是確認(rèn)設(shè)備自己的,每次設(shè)備重新連接服務(wù)器后的是設(shè)備的devicekey。{"device":{"productbatch_id":0,"last_active":"2014-06-1910:06:58","ptype":12335,"activate_status":1,"serial":"334a8481","id":130,"b ":"18:fe:34:97:d5:33","last_pull":"2014-06-19{"device":{"productbatch_id":0,"last_active":"2014-06-1910:06:58","ptype":12335,"activate_status":1,"serial":"334a8481","id":130,"b ":"18:fe:34:97:d5:33","last_pull":"2014-06-1910:06:58","last_push":"2014-06-1910:06:58","location":"","metadata":"18:fe:34:97:d5:33temperature","status":2,"updated":"2014-06-1910:06:58","description":"device-description-79eba060","activated_at":"2014-06-1910:06:58","visibly":1,"is_private":1,"product_id":1,"name":"device-me-79eba060","created":"2014-05-2817:43:29","is_frozen":0,"key_id":387},"non ,"message":"deviceidentified","status":200}{"path": /","method":"POST","meta":{"Authorization":50sespressif的服務(wù)器,ip地址7{"path": /","method":"POST","meta":{"Authorization":{"status":{"status":200,"message":success","datetime":"2014-06-1909:32:28", {"body":{"body":{},,"is_query_device":true,"get":{},"e474bba4b8e11b97b91019e61b7a018cdbaa3246","meta":{"Authorization":"/v1/datastreams/plug-status/datapoint/","post":{},"method":{"status":{"status":200,"datapoint":{"x":0}, ,"is_query_device":{"body":{"datapoint":{"x":{"body":{"datapoint":{"x":1}},,"is_query_device":true,{},"token":"e474bba4b8e11b97b91019e61b7a018cdbaa3246","meta":"tokene474bba4b8e11b97b91019e61b7a018cdbaa3246"},"path":"/v1/datastreams/plug-status/datapoint/","post":{},"method":"POST","deliver_to_device":true}{"status":{"status":200,"datapoint":{"x":1},,"deliver_to_device":PCplug-curlplug-curl-XGET-H"Content-Type:application/json"-H"Authorization:token{"status":{"status":200, ,"datapoint":{"x":1},"deliver_to_device":Linux/Cygwin4bba4b8e11b97b91019e61b7a018cdbaa3246"–d'{"datapoint":{"x":1}}'Windowscurlcurl-XPOST-H"Content-Type:application/json"-H"Authorization:tokene47//7/v1/datastreams/plug-{"status":{"status":200, ,"datapoint":{"x":1},"deliver_to_device":燈{"body":{},,"is_query_device":{"body":{},,"is_query_device":true,"get":{},e474bba4b8e11b97b91019e61b7a018cdbaa3246"},"path":"/v1/datastreams/light/datapoint/","post":{},"method":"GET"} ,"datapoint":{"x":100,"y":200,"z":0,"k":0,"l":,"/v1/datastreams/light/datapoint/","post":{},"method":"POST" ,"datapoint":{"x":100,"y":200,"z":0,"k":0,"l":o_device":Yred、Zgreen、K表blue。L參數(shù)目前保留。PCcurlcurl-XGET-H"Content-Type:application/json"-H"Authorization:tokenbba4b8e11b97b91019e61b7a018cdbaa3246" ,"datapoint":{"x":100,"y":200,"z":0,"k":0,"l":o_device":Linux/Cygwincurlcurl-XPOST-H"Content-Type:application/json"-H"Authorization:tokene474bba4b8e11b97b91019e61b7a018cdbaa3246"–d'{"datapoint":{"x":100,"y":"z":0,"k":0,"l":50}}Windowscurl-XPOST-H"Content-Type:application/json"-H"Authorization:tokencurl-XPOST-H"Content-Type:application/json"-H"Authorization:tokene474bba4b8e11b97b91019e61b7a018cdbaa3246"–d"{\"datap

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論