Cov txheej txheem:

Pib Nrog Amazon Amazon AWS IoT thiab ESP8266: 21 Cov Kauj Ruam
Pib Nrog Amazon Amazon AWS IoT thiab ESP8266: 21 Cov Kauj Ruam

Video: Pib Nrog Amazon Amazon AWS IoT thiab ESP8266: 21 Cov Kauj Ruam

Video: Pib Nrog Amazon Amazon AWS IoT thiab ESP8266: 21 Cov Kauj Ruam
Video: ntoo qaib tuag aws 2024, Kaum ib hlis
Anonim
Pib Nrog Amazon Amazon AWS IoT thiab ESP8266
Pib Nrog Amazon Amazon AWS IoT thiab ESP8266

Txoj haujlwm no qhia koj yuav ua li cas coj ESP8266 module thiab txuas ncaj qha rau AWS IOT siv Mongoose OS. Mongoose OS yog qhov qhib kev ua haujlwm rau microcontrollers uas hais txog huab sib txuas. Nws tau tsim los ntawm Cesanta, Dublin-based embedded software tuam txhab thiab thaum kawg ntawm txoj haujlwm, koj yuav tsum muaj peev xwm ntsuas qhov ntsuas kub thiab qhov av noo los ntawm DHT11 ntsuas kub thiab tshaj tawm nws ntawm AWS IOT platform.

Rau qhov haujlwm no, peb yuav xav tau:

 Ib pawg ESP8266-based NodeMCU

HT DHT 11 ntsuas kub

 Mongoose OS flashing cuab yeej

 USB cable txuas NodeMCU board rau computer

 Jumber xov hlau

Account AWS tus account uas koj npaj siab siv

Kauj Ruam 1: ESP8266-based NodeMCU Board

ESP8266-based NodeMCU Board
ESP8266-based NodeMCU Board

ESP8266 yog lub npe ntawm micro tswj tsim los ntawm Espressif Systems. ESP8266 nws tus kheej yog tus kheej muaj Wi-nkaus kev sib tham daws teeb meem raws li tus choj los ntawm cov tswj hwm micro uas twb muaj lawm rau Wi Fi thiab tseem muaj peev xwm khiav cov ntawv thov tus kheej. Cov qauv no los nrog ua hauv USB txuas thiab kev nplua nuj ntau ntawm tus pin-outs. Nrog lub micro USB cable, koj tuaj yeem txuas NodeMCU devkit rau koj lub laptop thiab nyem nws yam tsis muaj teeb meem, ib yam li Arduino

Kev qhia tshwj xeeb

• Voltage: 3.3V.

• Wi-Fi Direct (P2P), mos-AP.

• Kev siv tam sim no: 10uA ~ 170mA.

• Flash nco tau: 16MB max (512K ib txwm).

• Kev koom ua ke ntawm TCP/IP raws tu qauv.

• Tus Txheej Txheem: Tensilica L106 32-ntsis.

• Txheej txheem ceev: 80 ~ 160MHz.

• RAM: 32K + 80K.

• GPIOs: 17 (sib npaug nrog lwm cov haujlwm).

• Analog rau Digital: 1 lub tswv yim nrog 1024 qib kev daws teeb meem.

• +19.5dBm tso zis hluav taws xob hauv 802.11b hom

• 802.11 kev txhawb nqa: b/g/n.

• Kev sib txuas ntau tshaj TCP sib txuas: 5

Kauj ruam 2: Pin Diagram

Pin Diagram
Pin Diagram

Kauj Ruam 3: DHT11 - Vaum thiab Kub Sensor

DHT11 - Vaum thiab Kub Sensor
DHT11 - Vaum thiab Kub Sensor

DHT11 yog qhov pib, tus nqi qis digital ntsuas kub thiab av noo. Nws siv lub ntsuas hluav taws xob ntsuas hluav taws xob thiab lub ntsuas cua ntsuas cua ib puag ncig, thiab ntuav tawm lub teeb liab digital ntawm cov ntaub ntawv tus pin (tsis xav tau cov tswv yim sib txuas pins xav tau). Tsuas yog qhov tsis zoo ntawm qhov ntsuas no yog koj tsuas tuaj yeem tau txais cov ntaub ntawv tshiab los ntawm nws ib zaug txhua 2 vib nas this

Nta

 Puv ntau yam kub tau them

 Txheeb ze cov av noo thiab ntsuas kub

 Calibrated cov teeb liab

 Koj lub sijhawm ntev ruaj khov

Components Tsis xav tau cov khoom ntxiv

 Ntev kis nrug

 Tsawg zog siv

Txheej Txheem Kev Sib Txuas Lus (Tib-Hlau Ob Txoj Kev)

Qhov txaus siab hauv qhov qauv no yog cov txheej txheem uas siv los hloov cov ntaub ntawv. Txhua qhov ntsuas ntsuas tau xa los siv ib lub npav npav uas txo tus nqi thiab txuas ntxiv qhov deb. Txhawm rau xa cov ntaub ntawv hla lub npav koj yuav tsum piav qhia txoj hauv kev yuav xa cov ntaub ntawv li cas, yog li tus xa xov thiab tus txais tuaj yeem nkag siab qhov uas hais ib leeg. Nov yog yam txheej txheem ua. Nws piav qhia txog txoj kev xa cov ntaub ntawv. Ntawm DHT-11 lub 1-xaim cov ntaub ntawv tsheb npav tau rub nrog tus tiv thaiv rau VCC. Yog li yog tias tsis muaj dab tsi tshwm sim qhov hluav taws xob ntawm lub npav yog sib npaug rau VCC. Com Kev Sib Tham tuaj yeem sib cais ua peb theem

1) Thov

2) Teb

3) Kev Nyeem Cov Ntaub Ntawv

Kauj Ruam 4: Taw qhia rau Mongoose OS

Mongoose OS yog qhov ua haujlwm qhib rau cov kab ke me me. Nws tau tsim los ua haujlwm ntawm cov cuab yeej xws li cov tswj hwm micro, uas feem ntau txwv nrog kev nco ntawm qhov kev txiav txim siab kaum tawm kilobytes, thaum nthuav tawm lub program interface uas muab kev nkag tau rau APIs niaj hnub ib txwm pom ntawm cov cuab yeej muaj zog dua. Ib lub cuab yeej khiav Mongoose OS muaj kev nkag mus rau cov haujlwm ua haujlwm xws li cov ntaub ntawv kaw lus thiab kev sib tham, ntxiv rau software qib siab xws li lub cav JavaScript thiab huab nkag APIs.

Mongoose OS Flashing cuab yeej

Lub teeb nyem yog siv los nyem Mongoose OS hauv ESP8266. Ua ntej, tau txais ib qho ntawm cov laug cam txhawb nqa, zoo li ESP8266 NodeMCU, thiab txuas nws mus rau koj lub computer, tom qab ua raws cov theem no:

 Nkag mus rau Mongoose OS rub tawm lub vev xaib thiab rub tawm Mos tool. (Tab sis hauv Txoj Haujlwm no, peb yuav siv qhov qub ntawm Mongoose OS)

 Khiav Mos (Mongoose OS) teeb tsa cov ntaub ntawv thiab ua raws cov txheej txheem teeb tsa:

Kauj ruam 5: Mongoose Setup Wizard

Mongoose Teeb Wizard
Mongoose Teeb Wizard
Mongoose Teeb Wizard
Mongoose Teeb Wizard
Mongoose Teeb Wizard
Mongoose Teeb Wizard

Kauj Ruam 6: Cov Txheej Txheem Ntaus Ntawv - Online

Cov xwm txheej ntaus ntawv - Online
Cov xwm txheej ntaus ntawv - Online

Tom qab ua tiav peb qib, koj yuav tau txais cov lus hauv qab no thiab Cov cuab yeej xwm txheej dhau los online. Tam sim no peb ESP8266 Module tuaj yeem sib txuas lus nrog cov khoom siv nyob deb

Kauj Ruam 7: Muab Cov Khoom Siv ntawm AWS IOT

Provision Device on AWS IOT
Provision Device on AWS IOT

Ua ntej peb tuaj yeem xa cov xwm txheej mus rau AWS peb yuav tsum muaj peev xwm ua kom muaj kev sib txuas ruaj ntseg rau AWS IOT. Txhawm rau ua li ntawd peb yuav tsum tau muab ESP nrog AWS daim ntawv pov thawj. Hauv Mongoose OS teeb wizard xaiv Cov Khoom Siv Khoos phis tawj ces xaiv thaj tsam AWS uas tsim nyog thiab AWS txoj cai rau koj ib puag ncig AWS. Nyem qhov Kev Pabcuam nrog AWS IOT khawm. Cov cuab yeej yuav teeb tsa nrog cov ntaub ntawv raug los txuas rau AWS kev pabcuam. Cov ntawv pov thawj yuav raug teeb tsa cia.

Nco tseg:

Tus neeg siv tuaj yeem xaiv thaj tsam AWS uas tsim nyog thiab AWS txoj cai hauv peb qhov xwm txheej, peb xaiv thaj tsam AWS ua ap-southeast-1 thiab AWS txoj cai raws li mos-default

Tom qab ua tiav cov khoom siv ntawm AWS IOT, tam sim no tus esp8266 Wi -Fi module tuaj yeem sib tham nrog AWS -IOT

Kauj Ruam 8: Thauj Cov Qauv Qauv Rau Hauv NodeMCU Pawg Thawj Coj

Loading Tus Qauv Cai Rau Hauv NodeMCU Pawg Thawj Coj
Loading Tus Qauv Cai Rau Hauv NodeMCU Pawg Thawj Coj

Tom qab koj khiav Mongoose teeb wizard, yog tias koj nyem lub tshuab ntaus ntawv cov ntawv qhia zaub mov, muaj cov ntawv hu ua init.js. Inside cov ntawv ntawd muaj cov qauv piv txwv. Yog koj nyem qhov Save +Reboot khawm, cov qauv piv txwv yuav raug thauj thiab cov zis tuaj yeem pom los ntawm Cov Ntawv Teev Npe

Kauj Ruam 9: Pib Nrog AWS Account

AWS yog dab tsi?

Amazon Web Services (AWS) yog tus muab kev pabcuam huab los ntawm Amazon, uas muab cov kev pabcuam hauv daim ntawv ntawm kev tsim cov tsev, cov tsev tsim no tuaj yeem siv los tsim thiab xa tawm txhua hom kev thov hauv huab. Cov kev pabcuam no lossis cov tsev tsim khoom tau tsim los ua haujlwm ib leeg, thiab ua rau cov ntawv thov siv tau yooj yim thiab muaj peev xwm ua haujlwm tau zoo.

Yuav teeb li cas?

Muaj ob txoj hauv kev los teeb tsa AWS cov kev pabcuam

 Siv AWS CLI cov kab hais kom ua hluav taws xob

 Siv AWS GUI

Kauj Ruam 10: AWS CLI Command Line Utility (Tsis teb los tau)

Ua ntej peb yuav tsum teeb tsa AWS CLI. AWS CLI yog kab hais kom ua cov cuab yeej uas muab cov lus txib rau cuam tshuam nrog AWS cov kev pabcuam. Nws ua rau koj siv lub luag haujlwm uas muab los ntawm AWS Management Console los ntawm lub davhlau ya nyob twg. Mongoose siv cov cuab yeej no los muab Cov IOT ntaus ntawv ntawm AWS IOT. AWS CLI xav tau koj daim ntawv pov thawj thiaj li tuaj yeem txuas rau AWS. Txhawm rau teeb tsa khiav aws teeb tsa los ntawm kab hais kom ua thiab nkag mus rau koj cov ntaub ntawv nkag mus (koj li ntaub ntawv pov thawj). Hauv cov lus yooj yim, koj tuaj yeem nkag mus thiab tswj hwm Amazon Cov Kev Pabcuam Web los ntawm kev yooj yim thiab nkag siab web-based cov neeg siv sib cuam tshuam. Yog tias koj qhov kev txhawj xeeb tau nkag mus rau qee cov yam ntxwv siv xov tooj ntawm tes, ces AWS Console mobile app cia koj saib cov peev txheej sai sai.

Kauj Ruam 11: Amazon Web Services (GUI)

Amazon Web Services (GUI)
Amazon Web Services (GUI)

Tom qab muab nrog AWS, peb tuaj yeem nkag mus rau hauv AWS tswj kev tswj hwm, hauv qab cov kev pabcuam tab peb muaj pawg sib txawv. Ua ntej peb pib tshawb xyuas cov yam ntxwv ntawm lub console no, koj yuav tsum tsim ib tus as khauj ntawm AWS. Rau cov tib neeg uas tsis muaj tus lej tuaj yeem mus ntsib AWS lub vev xaib thiab tsim tus as khauj dawb. Koj yuav tsum sau koj cov ntsiab lus credit/debit card. AWS yuav tsis them nyiaj rau koj thaum koj tso npe dawb yog tias koj siv cov kev pabcuam raws li qhov txwv tshwj xeeb.

Kauj Ruam 12: AWS IOT Core

AWS IOT Core
AWS IOT Core

Tom qab nkag mus, koj yuav raug coj mus rau nplooj ntawv hauv qab no thiab hauv Is Taws Nem ntawm yam khoom xaiv IOT core

Kauj Ruam 13: AWS IOT - Saib Xyuas

AWS IOT - Monitor
AWS IOT - Monitor

Thaum koj xaiv IOT core nplooj ntawv saum toj no yuav tshwm sim tom qab ntawv xaiv cov ntawv qhia zaub mov

Kauj Ruam 14: AWS IOT - Kev tso npe

AWS IOT - Subscriptions
AWS IOT - Subscriptions

Tom qab xaiv Cov ntawv qhia zaub mov koj yuav raug coj mus rau Kev Sau Npe. Hauv cov npe teev npe teev tseg lub ncauj lus tsim nyog uas koj tab tom siv thiab nyem rau Subscribe rau lub ncauj lus khawm

Kauj Ruam 15: Tshaj Tawm Cov Lus Tsis Txaus Siab

Tshaj Tawm Txoj Xov Zoo
Tshaj Tawm Txoj Xov Zoo

Tom qab ntawd koj yuav raug coj mus rau nplooj ntawv saum toj no. Yog tias koj nyem Tshaj tawm rau lub ncauj lus, peb yuav muaj cov lus piv txwv uas yuav tshwm ntawm no los ntawm lub neej ntawd

Nco tseg: Yog tias koj xav sau tus lej tshiab thiab ntsaws rau hauv NodeMCU pawg thawj coj (Cov cai uas peb sau yuav tsum tau muab tso rau hauv tus ntaus ntawv tus thawj tswj ntaub ntawv> init.js cov ntaub ntawv ces koj yuav tsum suav lub ntsiab lus lub npe., koj yuav tsum siv tib lub ntsiab lus lub npe hauv ntu kev tso npe txhawm rau txhawm rau tshaj tawm cov ntawv tso tawm

Kauj Ruam 16: Tshaj Tawm Cov Khawm Nyem Xov Xwm

Luam tawm Cov Khawm Nyem Xov Xwm
Luam tawm Cov Khawm Nyem Xov Xwm

Kauj Ruam 17: Tshaj Tawm Qhov Kub thiab Vaum Qhov Zoo rau AWS IOT Platform

Tshaj Tawm Qhov Kub thiab Vaum Qhov Zoo rau AWS IOT Platform
Tshaj Tawm Qhov Kub thiab Vaum Qhov Zoo rau AWS IOT Platform

Kauj Ruam 18: Ua Haujlwm

Onnect Txuas lub Circuit Court raws li qhia hauv qab no

 Flash mongoose OS ntawm ESP8266 tus qauv

 Muab khoom siv ntawm AWS IOT

 Thauj cov txheej txheem sau rau hauv NodeMCU pawg thawj coj

 Txheeb xyuas qhov tso tawm hauv lub cav ntaus ntawv (saib daim duab 9)

 Nkag mus rau hauv tus as khauj AWS

 Xaiv IOT core sub menu

 Xaiv Qhov Kev Xeem los ntawm MQTT cov neeg siv khoom

 Qhia meej cov ncauj lus tsim nyog hauv cov ntawv sau npe

 Nyem qhov tshaj tawm rau lub ncauj lus khawm

 Nco ntsoov tias thaum twg koj nias lub pob nyem koj tau txais qhov kub thiab txias, qhov txiaj ntsig zoo li cov lus

Pom zoo: