Cov txheej txheem:

Yuav Ua Li Cas Txuas ESP32 mus rau IoT Cloud: 8 Kauj Ruam
Yuav Ua Li Cas Txuas ESP32 mus rau IoT Cloud: 8 Kauj Ruam

Video: Yuav Ua Li Cas Txuas ESP32 mus rau IoT Cloud: 8 Kauj Ruam

Video: Yuav Ua Li Cas Txuas ESP32 mus rau IoT Cloud: 8 Kauj Ruam
Video: Digital Potentiometer Control Using Arduino - X9C103 2024, Kaum ib hlis
Anonim
Yuav Ua Li Cas Txuas ESP32 mus rau IoT Cloud
Yuav Ua Li Cas Txuas ESP32 mus rau IoT Cloud

Cov lus qhia no los nyob hauv kab lus ntawm kab lus txuas txuas kho vajtse zoo li Arduino thiab ESP8266 rau huab. Kuv yuav piav qhia koj yuav ua li cas ua rau koj ESP32 nti txuas nrog huab nrog AskSensors IoT kev pabcuam.

Vim li cas ESP32?

Tom qab kev ua tiav loj ntawm ESP8266, ESP32 yog lub nti tshiab los ntawm Espressif uas suav nrog WiFi thiab Bluetooth lub peev xwm tsis muaj peev xwm nrog ob lub CPU cores thiab tsim nyog kho vajtse ib puag ncig teeb tsa.

Koj yuav kawm dab tsi?

Hauv qhov kev qhia no koj yuav kawm:

  • Yuav ua li cas npaj koj li ESP32 nrog Arduino IDE.
  • Yuav xa cov ntaub ntawv los ntawm koj li ESP32 mus rau AskSensors siv HTTP GET thov li cas.
  • Yuav ua li cas kom pom lub sijhawm tiag tiag cov ntaub ntawv ntws hauv huab.

Kauj ruam 1: Yuav tsum tau ua

Yuav tsum muaj
Yuav tsum muaj

Koj Yuav Tsum Tau:

  • ESP32 tus qauv. Kuv siv ESP32 Pico Kit raws li qhia hauv daim duab saum toj no.
  • Lub computer siv Arduino IDE software.
  • Ib lub USB cable txuas ESP32 tus qauv rau lub khoos phis tawj.
  • Ib tus account AskSensors dawb.

Kauj Ruam 2: Vim Li Cas AskSensors?

AskSensors yog IoT platform tsim los ua daim ntawv thov yooj yim tshaj plaws hauv kev ua lag luam, tso cai rau cov neeg siv sib txuas, pom kev thiab txheeb xyuas lawv cov ntaub ntawv ntsuas hluav taws xob hla huab.

Cia peb xav tias peb xav tshuaj xyuas qhov kub thiab txias ntawm ib chav thiab khaws cov txiaj ntsig no nyob ib puag ncig hauv huab kom lawv tuaj yeem piav qhia tom qab. Nov yog qhov xwm txheej tshwm sim uas nws yuav tsum paub xa cov ntaub ntawv los ntawm ESP32 mus rau AskSensors. Tab sis muaj ntau qhov xwm txheej uas qhov kev qhia no tuaj yeem pab tau rau koj.

Yog li nyeem ntxiv;-)

Kauj Ruam 3: Teeb Sensor

  1. Sau npe: Tau txais nyiaj pub dawb hauv ob peb feeb ntawm:
  2. Tau txais koj tus Api Key Hauv: AskSensors nthuav tawm txheej API los ua kom yooj yim cov txheej txheem sib pauv cov ntaub ntawv ntawm koj lub cuab yeej thiab IoT huab. Phau ntawv pib ua no qhia koj yuav ua li cas los tsim lub ntsuas tshiab, thiab teeb nws kom muaj peev xwm xa cov ntaub ntawv mus rau. Luam tawm koj tus Api Key In, peb yuav siv nws hauv cov kauj ruam tom ntej.

Kauj Ruam 4: Nruab ESP32 hauv Arduino IDE

Txhawm rau teeb tsa ESP32 pawg thawj coj hauv koj Arduino IDE, ua raws cov lus qhia hauv qab no:

  1. Koj yuav tsum tau teeb tsa qhov tseeb version ntawm Arduino IDE software (1.8.7 lossis siab dua).
  2. Ua ntej tshaj plaws, qhib lub qhov rai nyiam los ntawm Arduino IDE: File> Preferences
  3. Mus rau "Tus Thawj Saib Xyuas Haujlwm Ntxiv URLs" teb, Nkag mus rau URL hauv qab no:

dl.espressif.com/dl/package_esp32_index.json

Yog tias koj twb muaj ESP8266 cov laug cam URL, cais cov URL nrog tus lej raws li qhia hauv qab no:

dl.espressif.com/dl/package_esp32_index.json, Tam sim no, qhib cov thawj tswj hwm (Cov cuab yeej> Pawg Thawj Coj> Cov Thawj Tswj), tshawb rau ESP32 thiab nyem lub pob teeb tsa rau "ESP32 los ntawm Espressif Systems". Nws yuav siv ob peb feeb.

Kauj ruam 5: Coding

Coding
Coding

Rub tawm qhov demo no los ntawm AskSensors Github nplooj ntawv thiab decompress nws. Txoj cai suav nrog cov tsev qiv ntawv rau ob qho txuas rau WiFi network thiab ua kom HTTP thov.

Koj yuav tsum tau hloov kho cov hauv qab no:

const char* ssid = "……………"; // Wifi SSID

const char* lo lus zais = "……………"; // Wifi Password const char* apiKeyIn = "……………."; // API Ntsiab

Kauj ruam 6: Programming

Programming
Programming
Programming
Programming
  1. Txuas ESP32 tus qauv rau koj lub computer los ntawm USB cable.
  2. Tshaj tawm cov cai nrog Arduino IDE.
  3. Qhib lub davhlau ya nyob twg. Koj yuav tsum tau txais cov txiaj ntsig zoo ib yam li daim duab saum toj no. Nco ntsoov tias peb tau txais ob tus lej:
  • 200: sib raug rau tus lej OK
  • 1: Tus lej ntawm kev hloov pauv tau ua tiav (ib qho qauv hauv peb kis).

Kauj Ruam 7: Pom Koj Cov Ntaub Ntawv

Pom Koj Cov Ntaub Ntawv
Pom Koj Cov Ntaub Ntawv

Lub taub hau mus rau koj lub dashboard sensor. Ntxiv ib daim duab rau koj li Module (Module 1).

Koj yuav tsum tau txais cov ntaub ntawv tsis raug ntawm 10 thiab 100 txhua 20 feeb.

Daim duab saum toj no qhia qhov piv txwv ntawm Bar teeb duab.

Kauj ruam 8: Tsaug

Ua tsaug rau kev nyeem ntawv.

Tshawb nrhiav peb cov kev qhia:

Pom zoo: