Cov txheej txheem:
- Kauj Ruam 1: Koj Xav Tau Dab Tsi
- Kauj ruam 2: Mus rau Unwired Labs
- Kauj Ruam 3: Sau Npe Kom Tau Txais API Token
- Kauj Ruam 4: Txheeb Koj Tus Email
- Kauj Ruam 5: Cov Tsev Qiv Ntawv Koj Yuav Xav Tau
- Kauj Ruam 6: Ntxiv Code hauv Arduino los Txuas Nrog LocationAPI
- Kauj Ruam 7: Qhib Serial Monitor kom pom yog tias koj txuas nrog
- Kauj Ruam 8: Tau txais Kev Sib Koom Tes
- Kauj ruam 9: Mus rau Google Maps
- Kauj Ruam 10: Xa Qhov Chaw Rau Koj Lub Txawb
Video: Qhov Chaw Taug Qab Nrog NodeMCU ESP8266: 10 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:28
Koj puas xav paub yuav ua li cas koj NodeMCU tuaj yeem taug qab koj qhov chaw nyob? Nws ua tau, txawm tias tsis muaj GPS module thiab tsis muaj zaub. Cov txiaj ntsig yuav yog tswj hwm qhov chaw koj nyob thiab koj yuav pom lawv hauv koj li kev saib xyuas.
Cov teeb tsa hauv qab no tau siv rau NodeMCU 1.0 (ESP-12E Module) nrog Arduino IDE.
- Windows 10
- Arduino IDE v. 1.8.4
Kauj Ruam 1: Koj Xav Tau Dab Tsi
Yam koj xav tau txhawm rau ua raws qhov kev qhia no yog cov hauv qab no:
- Micro USB kab
- NodeMCU ESP8266
Ntxiv mus, koj yuav xav tau:
- Qhov chaw API (los ntawm Cov Xeem Uas Tsis Xav Tau)
- Nkag mus rau wifi lossis hotspot
Kauj ruam 2: Mus rau Unwired Labs
Geolocation los tau yooj yim heev vim tias thaum koj lub GPS poob, koj tseem tuaj yeem siv Geolocation txhawm rau taug qab koj qhov chaw nyob. Peb tus tswv tsev uas muab geolocation, yuav yog https://www.unwiredlabs.com/. Mus rau lub vev xaib ntawd thiab sau npe (khawm txiv kab ntxwv nyob rau sab xis saum toj).
Kauj Ruam 3: Sau Npe Kom Tau Txais API Token
Ntawm nplooj ntawv sau npe, koj yuav tsum sau koj lub npe, email (koj tus lej API yuav xa rau koj tus email) thiab siv rooj plaub (piv txwv li, siv tus kheej). Xaiv koj tus account hom. Cov dawb version yuav ua tau zoo xwb, tab sis nco ntsoov tias koj txwv thiab tsis tuaj yeem taug qab koj qhov chaw 24/7. Cia peb pib!
Kauj Ruam 4: Txheeb Koj Tus Email
Mus rau koj tus email thiab koj yuav pom koj tus lej API. Luam theej API API, vim tias koj xav tau qhov ntawd rau tus lej peb yuav siv. Nov yog qhov email zoo li cas:
Nyob zoo!
Ua tsaug rau npe nrog Unwired Labs LocationAPI! Koj tus lej API yog 'koj tus lej API nyob ntawm no' (tsis hais nqe lus). Qhov no yuav muab 100 qhov kev thov/ hnub pub dawb - mus ib txhis.
Yog tias koj xav taug qab 5 lub cuab yeej pub dawb, thov teb nrog cov lus qhia hauv qab no thiab peb yuav hloov kho koj li nyiaj hauv 12 teev:
1. Kev xa tawm hom (Kho vajtse/ App/ Lwm yam):
2. Txog koj qhov project:
3. Lub Vev Xaib:
Koj tuaj yeem nkag mus rau koj lub dashboard ntawm no: https://unwiredlabs.com/dashboard. Yog tias koj ntsib teeb meem lossis muaj lus nug, teb rau email no thiab kuv yuav pab koj!
Zoo Siab Nrhiav!
Sagar
Lab tsis siv
Kauj Ruam 5: Cov Tsev Qiv Ntawv Koj Yuav Xav Tau
Cov kauj ruam tom ntej yog qhib Arduino thiab mus tswj cov tsev qiv ntawv. Koj yuav tsum teeb tsa lub tsev qiv ntawv ArduinoJson. Lwm lub tsev qiv ntawv twb tau tsim los lawm. Thaum koj npaj tau lawm, koj tuaj yeem pib sau cov cai.
Kauj Ruam 6: Ntxiv Code hauv Arduino los Txuas Nrog LocationAPI
Ua tus kos duab tshiab thiab ntxiv cov cai hauv qab no hauv Arduino. Sau koj tus kheej lub npe wifi/hotspot thiab koj tus password. Muab tshuaj txhuam API token koj tau txais hauv email. Tshaj tawm koj cov cai rau koj li NodeMCU.
#suav nrog
#suav nrog
#suav nrog "ESP8266WiFi.h"
// koj lub network SSID (npe) & tus password network
char myssid = "Koj lub npe wifi/hotspot"; char mypass = "Koj tus password";
// unwiredlabs Hostname & Geolocation Endpoint url
const char* Tus tswv tsev = "www.unwiredlabs.com"; Txoj hlua kawg = "/v2/process.php";
// UnwiredLabs API_Token. Sau npe ntawm no kom tau txais tus lej pub dawb
Txoj hlua token = "d99cccda52ec0b";
Txoj hlua jsonString = "{ n";
// Variables los khaws cov lus teb uas tsis xav tau
ob latitude = 0.0; ob qhov ntev = 0.0; ob qhov tseeb = 0.0;
void teeb tsa () {
Serial.begin (115200);
// Teeb WiFi rau hom chaw nres tsheb thiab txiav tawm ntawm AP yog tias nws tau txuas yav dhau los
WiFi.mode (WIFI_STA); WiFi.disconnect (); Serial.println ("Teeb tsa ua tiav");
// Peb pib los ntawm kev txuas mus rau WiFi network
Serial.print ("Txuas rau"); Serial.println (myssid); WiFi.begin (myssid, mypass);
thaum (WiFi.status ()! = WL_CONNECTED) {
ncua (500); Serial.print ("."); } Serial.println ("."); }
void voj () {
char bssid [6]; DynamicJsonBuffer jsonBuffer;
// WiFi.scanNetworks yuav rov qab pom cov naj npawb ntawm tes hauj lwm
int n = WiFi.scanNetworks (); Serial.println ("ua tiav scan");
yog tias (n == 0) {
Serial.println ("Tsis muaj tes hauj lwm muaj"); } lwm {Serial.print (n); Serial.println ("pom cov network"); }
// tam sim no tsim jsonString…
jsonString = "{ n"; jsonString += "\" token / ": \" "; jsonString += token; jsonString +=" / ", / n"; jsonString += "\" id / ": \" saikirandevice01 / ", / n"; jsonString += "\" wifi / ": [n"; rau (int j = 0; j <n; ++ j) {jsonString += "{ n"; jsonString += "\" bssid / ": \" "; jsonString += (WiFi. BSSIDstr (j)); jsonString +=" / ", / n"; jsonString += "\" teeb liab / ":"; jsonString += WiFi. RSSI (j); jsonString += "\ n"; yog (j <n - 1) {jsonString += "}, / n"; } lwm {jsonString += "} n"; }} jsonString += ("] n"); jsonString += ("} n"); Serial.println (jsonString);
WiFiClientSecure tus neeg siv khoom;
// Txuas rau tus neeg siv khoom thiab ua tus hu api
Serial.println ("Thov URL: https://" + (String) Host + endpoint); yog (client.connect (Tus tswv, 443)) {Serial.println ("Txuas"); client.println ("POST" + endpoint + "HTTP/1.1"); client.println ("Host:" + (String) Host); client.println ("Kev sib txuas: kaw"); client.println ("Cov ntsiab lus-Hom: thov/json"); client.println ("Tus neeg siv-Tus neeg sawv cev: Arduino/1.0"); client.print ("Cov ntsiab lus-Ntev:"); client.println (jsonString.length ()); client.println (); cov. client.print (jsonString); ncua (500); }
// Nyeem thiab txheeb xyuas txhua kab ntawm cov lus teb los ntawm server
thaum (client.available ()) {Txoj kab = client.readStringUntil ('\ r'); JsonObject & hauv paus = jsonBuffer.parseObject (kab); yog (root.success ()) {latitude = root ["lat"]; longitude = hauv paus ["lon"]; raug = paus ["raug"];
Serial.println ();
Serial.print ("Latitude ="); Serial.println (latitude, 6); Serial.print ("Ntev ="); Serial.println (ntev, 6); Serial.print ("Qhov tseeb ="); Serial.println (qhov tseeb); }}
Serial.println ("kaw qhov txuas");
Serial.println (); client.stop (); cov.
ncua (5000);
}
Kauj Ruam 7: Qhib Serial Monitor kom pom yog tias koj txuas nrog
Mus rau cov cuab yeej hauv Arduino thiab qhib qhov saib ua ntej. Txhawm rau saib yog tias koj tau txuas nrog internet, koj yuav tsum pom cov hauv qab no hauv cov ntawv saib xyuas:
Teeb tsa tiav
Txuas rau (koj lub npe wifi)… luam theej duab
Kauj Ruam 8: Tau txais Kev Sib Koom Tes
Yog tias nws ua haujlwm tau zoo, koj yuav tsum pom hauv qab ua tiav tag nrho cov npe ntawm cov ntaub ntawv. Tsuas yog qhov peb xav tau yog tus lej hauv qab qhov thov URL, yog li peb yuav xav tau qhov latitude thiab longitude. Cov no yog cov tswj.
Thov URL:
Txuas
Latitude = 52.385259 TZS
Ntev = 5.196099
Qhov tseeb = 41.00
kaw kev twb kev txuas
Tom qab 5 vib nas this tus lej yuav hloov pauv tas li thiab koj yuav zaum pom qhov latitude, longitude thiab qhov tseeb hloov pauv. Tias yog vim li cas API tau sim nws yog qhov zoo tshaj plaws los taug qab qhov chaw kom raug raws li qhov ua tau.
Kauj ruam 9: Mus rau Google Maps
Mus rau https://www.google.com/maps/ thiab ntaus koj qhov chaw nyob hauv kab ntawv tshawb fawb. Kev tswj hwm yuav tsum tau sau ua raws li hauv qab no: 52.385259, 5.196099. Google Maps yuav tsum qhia qhov chaw koj nyob ntawm daim duab qhia chaw.
Kauj Ruam 10: Xa Qhov Chaw Rau Koj Lub Txawb
Thiab … Koj ua tiav! Yog li, yog tias koj xav xa qhov chaw rau koj lub xov tooj ntawm tes, nws ua tau. Google Maps yuav xa email nrog koj qhov kev tswj hwm yog tias koj xav tau.
Zoo siab nrhiav!
Pom zoo:
Hloov-Hloov Cov Khoom Ua Si: Dej-Taug Kev Taug Kev Zaj Ua Yooj Yim!: 7 Kauj Ruam (nrog Duab)
Hloov-Hloov Cov Khoom Ua Si: Dej-Taug Kev Taug Kev Zaj Ua Yooj Yim!: Qho khoom ua si hloov pauv qhib txoj hauv kev tshiab thiab kho cov kev daws teeb meem kom tso cai rau menyuam yaus uas muaj lub cev muaj peev xwm txwv lossis kev xiam oob khab kev cuam tshuam nrog cov khoom ua si ntawm nws tus kheej. Hauv ntau qhov xwm txheej, cov menyuam yaus uas xav tau cov khoom ua si hloov pauv tsis tuaj yeem nkag mus
Taug qab & taug qab rau Cov Khw Me Me: 9 Kauj Ruam (nrog Duab)
Taug qab & taug qab rau Cov Khw Me Me: Qhov no yog lub kaw lus uas tsim rau cov khw me me uas xav tias yuav nce mus rau e-tsheb kauj vab lossis e-scooters rau kev xa khoom luv luv, piv txwv li cov mov ci uas xav xa cov ncuav qab zib. Track thiab Trace txhais li cas? Taug qab thiab taug qab yog cov kab ke siv los ntawm
DIY Smart Robot Taug Qab Cov Khoom Siv Tsheb Taug Kev Tsheb Photosensitive: 7 Kauj Ruam
DIY Smart Robot Tracking Tsheb Cov Khoom Siv Taug Kev Tsheb Photosensitive: Tsim los ntawm SINONING ROBOTKoj tuaj yeem yuav los ntawm kev taug qab neeg hlau tsheb TheoryLM393 nti sib piv ob lub photoresistor, thaum muaj ib sab photoresistor LED ntawm WHITE sab ntawm lub tshuab yuav nres tam sim ntawd, lwm sab ntawm lub cav tig rov qab, yog li ntawd
RC Taug Qab Neeg Hlau Siv Arduino - Kauj Ruam Ib kauj ruam: 3 Kauj Ruam
RC Tracked Robot Siv Arduino - Kauj Ruam Ib Nrab: Hav guys, Kuv rov qab los nrog lwm tus neeg hlau txias chassis los ntawm BangGood. Vam tias koj tau dhau los ntawm peb cov phiaj xwm yav dhau los - Spinel Crux V1 - Tus Cwj Pwm Tswj Tus Neeg Hlau, Spinel Crux L2 - Arduino Xaiv thiab Muab Neeg Hlau nrog Robotic caj npab thiab Badland Braw
Tsheb kauj vab taug qab System nrog Tuag Tus Txiv Neej Alert Nrog Sigfox: 7 Cov Kauj Ruam (nrog Duab)
Tsheb kauj vab taug qab System Nrog Tuag Tus Txiv Neej Alert Nrog Sigfox: Kev ruaj ntseg rau cov neeg caij tsheb kauj vab nrog taug qab thiab xa cov yam ntxwv ceeb toom. Thaum muaj xwm txheej ceeb toom raug xa nrog GPS txoj haujlwm.Kev ruaj ntseg rau cov neeg caij tsheb kauj vab yog qhov yuav tsum tau, nrog kev tsheb kauj vab lossis tsheb kauj vab roob sib tsoo tshwm sim thiab sai li sai tau thaum muaj xwm txheej ceev