Cov txheej txheem:

Yuav Tshaj Tawm Li Cas ESP32 Cov Ntaub Ntawv Nrog NTP Lub Sijhawm mus rau IoT Huab: 5 Kauj Ruam
Yuav Tshaj Tawm Li Cas ESP32 Cov Ntaub Ntawv Nrog NTP Lub Sijhawm mus rau IoT Huab: 5 Kauj Ruam

Video: Yuav Tshaj Tawm Li Cas ESP32 Cov Ntaub Ntawv Nrog NTP Lub Sijhawm mus rau IoT Huab: 5 Kauj Ruam

Video: Yuav Tshaj Tawm Li Cas ESP32 Cov Ntaub Ntawv Nrog NTP Lub Sijhawm mus rau IoT Huab: 5 Kauj Ruam
Video: phuab vang / hlub li ca yuav li ntawv. 2024, Kaum ib hlis
Anonim
Yuav Tshaj Tawm Li Cas ESP32 Cov Ntaub Ntawv Nrog NTP Lub Sijhawm mus rau IoT Huab
Yuav Tshaj Tawm Li Cas ESP32 Cov Ntaub Ntawv Nrog NTP Lub Sijhawm mus rau IoT Huab

Hauv ntau daim ntawv thov, cov neeg siv yuav tsum xa lawv cov ntaub ntawv nrog rau nws lub sijhawm sijhawm hauv zos ntawm qhov txiaj ntsig kom xa hauv qhov them nyiaj mus rau AskSensors IoT huab.

Lub sijhawm teev sijhawm yog UNIX Lub Sijhawm Sijhawm: tus naj npawb ntawm cov milliseconds uas tau dhau mus txij li Lub Ib Hlis 1, 1970 (ib tag hmo UTC/GMT)

Cov ntawv qhia no nthuav qhia yuav ua li cas txuas koj li ESP32 mus rau NTP cov servers, ntsuas lub sijhawm, thiab tshaj tawm cov kev ntsuas no nrog lub sijhawm cim rau huab dhau

Kauj ruam 1: Yam yuavtsum tau kawm uantej

  • Active AskSensors tus account: Sau npe yuav 15 hnub pub dawb sim (Yooj yim, PRO lossis GURU).
  • Ua raws cov lus qhia pib sai no los tsim lub cuab yeej ntsuas tshiab thiab tau paub nrog AskSensors.
  • Txuas ESP32 mus rau AskSensors Cloud raws li qhia hauv phau ntawv qhia no.

Kauj Ruam 2: Cov Khoom Koj Xav Tau

  • ESP32 pawg thawj coj loj.
  • Khoos phis tawj siv software Arduino (version 1.8.7 lossis siab dua).
  • USB micro cable txuas ESP32 pawg thawj coj saib mus rau lub khoos phis tawj.

Kauj ruam 3: Software

  • Nruab NTP Client library rau Arduino IDE: Nkag mus rau Sketch> suav nrog Tsev Qiv Ntawv> Tswj Tsev Qiv.
  • Nrhiav NTPClient los ntawm Fabrice Weinberg. Nyem rau ntawm qhov nkag ntawd, thiab tom qab ntawd xaiv Nruab.
  • Rub tawm qhov kev nthuav qhia no los ntawm AskSensors Github nplooj ntawv.

Hloov kho cov hauv qab no:

const char* wifi_ssid = "………."; // SIB

const char* wifi_password = "………."; // WIFI

const char* apiKeyIn = "………."; // API KEY IN

const unsigned int sauInterval = 25000; // sau luv (hauv ms)

Kauj Ruam 4: Khiav Koj Qhov Kev Xeem

  • Txuas koj ESP32 pawg thawj coj saib mus rau lub khoos phis tawj ntawm cov lej/USB thiab xa cov cai siv Arduino IDE.
  • Qhib lub davhlau ya nyob twg. Nws yuav tsum qhia koj li ESP32 txuas nrog NTP server, timestamp cov ntaub ntawv thiab xa nws mus rau AskSensors IoT huab.
  • Rov qab mus rau AskSensors App thiab tshawb xyuas koj cov ntaub ntawv sensor ntws.

Kauj Ruam 5: Qhia Koj Li Kev Paub

Cov ntaub ntawv ntxaws ntxaws rau txuas cov cuab yeej rau AskSensors muaj nyob ntawm no.

Koj zoo siab koom nrog AskSensors zej zog, thiab qhia koj cov kev paub.

Pom zoo: