Cov txheej txheem:
- Kauj Ruam 1: Arduino Ethernet Shield
- Kauj Ruam 2: Cov Khoom Peb Xav Tau
- Kauj ruam 3: Teeb AskSensors
- Kauj ruam 4: Coding
- Kauj ruam 5: Programming
- Kauj Ruam 6: Khiav Txoj Cai
- Kauj Ruam 7: Pom Cov Ntaub Ntawv
- Kauj ruam 8: Ua tau zoo
Video: Yuav Ua Li Cas Xa Cov Ntaub Ntawv mus rau Huab nrog Arduino Ethernet: 8 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:25
Cov lus qhia no qhia koj yuav ua li cas tshaj tawm koj cov ntaub ntawv rau AskSensors IoT Platform siv Arduino Ethernet Shield. Ethernet Shield ua rau koj Arduino txuas nrog huab tau yooj yim, xa thiab tau txais cov ntaub ntawv nrog kev siv internet.
Peb yuav kawm dab tsi:
Peb yuav kawm paub pib ntawm kev txuas Arduino Ethernet daim thaiv rau AskSensors lub web server, thiab xa cov ntaub ntawv dag dhau HTTP thov. Thaum kawg, yuav pom cov ntaub ntawv nyob hauv cov huab AskSensors.
Vim li cas HTTP thiab tsis yog
AskSensors txhawb nqa HTTPS, txawm li cas los xij, MCUs tau teeb tsa ntawm Arduinos tsis tswj hwm HTTPS kev sib txuas. Vim li no peb yuav siv HTTP hloov chaw
Nco tseg: Yog tias koj xav tau MQTT raws tu qauv, thov mus saib nplooj ntawv no: Txuas Arduino Ethernet Kom Nug Tus Kws Tshaj Lij Tshaj MQTT
Kauj Ruam 1: Arduino Ethernet Shield
Kho vajtse nta:
- Yuav tsum muaj Arduino board.
- Kev siv hluav taws xob 5V, muab los ntawm Arduino Board.
- Ethernet Controller: Wiznet Ethernet maub los W5100 nrog sab hauv 16K tsis
- Wiznet W5100 muab lub network (IP) pawg muaj peev xwm ntawm TCP thiab UDP.
-
Kev sib txuas ceev: txog 10/100Mb
- Kev sib txuas nrog Arduino ntawm SPI chaw nres nkoj: Nws siv ICSP header pins thiab tus pin 10 ua tus xaiv xaiv rau SPI txuas rau Ethernet tus tswj nti.
- Qhov kho tshiab kawg ntawm Ethernet Shield suav nrog daim npav micro-SD daim npav ntawm lub rooj tsavxwm, uas tuaj yeem siv los khaws cov ntaub ntawv rau kev ua haujlwm thoob plaws lub network.
- Ethernet Module muaj tus txheej txheem txuas RJ45, nrog cov kab hloov pauv ua ke.
- Kev sib txuas rau lub network tau ua nrog RJ45 Ethernet cable.
Software Library:
Cov ntaub thaiv npog Ethernet tso siab rau Arduino Ethernet lub tsev qiv ntawv
Lub tsev qiv ntawv los ua ke nrog Arduino IDE
Peb yuav xav hloov qee qhov chaw teeb tsa hauv lub program kom sib haum rau peb lub network.
Cov ntaub ntawv qhia txog LEDs:
Tom qab ntawd, koj yuav tsum tau txheeb xyuas qhov xwm txheej Ethernet siv cov ntaub ntawv qhia LEDs:
- PWR: qhia tias lub rooj tsavxwm thiab daim thaiv npog tau siv
- LINK: qhia tias muaj kev sib txuas hauv network thiab nyem thaum daim ntaub thaiv xa tawm lossis tau txais cov ntaub ntawv
- Puv: qhia tias kev sib txuas hauv network yog duplex
- 100M: qhia tias muaj 100 Mb/s network sib txuas (tsis zoo li 10 Mb/s)
- RX: flashes thaum daim ntaub thaiv tau txais cov ntaub ntawv
- TX: flashes thaum daim ntaub thaiv xa cov ntaub ntawv
- COLL: taws thaum pom kev sib tsoo hauv network
Kauj Ruam 2: Cov Khoom Peb Xav Tau
Cov cuab yeej xav tau rau qhov kev qhia no yog:
- Lub computer siv Arduino IDE software.
- Ib pawg Arduino xws li Arduino Uno.
- Arduino Ethernet ntaub thaiv npog.
- Ib USB cable rau kev txhawb zog thiab ua haujlwm rau Arduino.
- Ethernet cable, txuas rau koj lub network router.
Kauj ruam 3: Teeb AskSensors
AskSensors xav tau cov hauv qab no:
- Tsim tus lej siv: Koj tuaj yeem tau txais ib qho dawb (https://asksensors.com)
- Tsim lub Sensor: Lub ntsuas cua yog kev sib txuas lus nrog lub cim tshwj xeeb Api qhov twg AskSensors sau thiab khaws cov neeg siv cov ntaub ntawv.
Txhua lub Sensor muab ob peb Cov Qauv uas tus neeg siv tuaj yeem xa cov ntaub ntawv rau lawv cais. Tus neeg siv kuj tseem tuaj yeem pom cov ntaub ntawv khaws tseg ntawm txhua tus qauv hauv kab duab. AskSensors muab ntau txoj kev xaiv ntawm kab suav nrog Kab, Bar, Scatter thiab ntsuas.
Kauj ruam 4: Coding
Yog li tam sim no peb tau tuaj yeem sau npe Sensor tshiab hauv AskSensors platform, Tam sim no peb tab tom yuav sau qee cov cai hauv Arduino rau nws txuas rau lub platform. Muaj ntau pua qhov kev qhia qhia txog kev txuas Arduino rau lub vev xaib los ntawm Ethernet Shields, yog li kuv yuav tsis piav qhia qhov no.
Rub tawm qhov piv txwv Arduino kos duab los ntawm github. Txoj cai siv DHCP thiab DNS rau tus neeg rau zaub mov thiab yuav tsum ua haujlwm tam sim nrog qee qhov kev hloov pauv:
- Yog tias koj siv ntau dua ib daim thaiv Ethernet ntawm lub network, nco ntsoov tias txhua daim thaiv Ethernet ntawm lub network yuav tsum muaj qhov chaw nyob tshwj xeeb mac.
- Hloov tus IP chaw nyob hauv daim duab qhia kom phim tus IP chaw nyob ntawm koj lub network.
- Teeb tsa Api Key In ntawm koj lub ntsuas (muab los ntawm AskSensors hauv qib dhau los)
- Teem koj cov ntaub ntawv dummy.
// MAC OS
byte mac = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; // Teeb tsa tus IP chaw nyob kom siv yog DHCP ua tsis tiav IPAddress ip (192, 168, 1, 177); // ASKSENSORS teeb tsa. const char* apiKeyIn = "MTWN7AQOLWJNEIF8RGMAW5EGKQFAHN2K"; // Hloov nws nrog koj qhov API KEY IN // dummy data int dumData = 100; // teeb tsa koj cov ntaub ntawv
Kauj ruam 5: Programming
- Txuas Ethernet daim thaiv rau hauv Arduino Uno board.
- Txuas Ethernet daim thaiv rau koj lub router/network los ntawm Ethernet cable.
- Txuas Arduino rau lub khoos phis tawj los ntawm USB cable. Lub zog yuav muab rau ob lub laug cam ntawm USB cable.
- Qhib koj cov cai hauv Arduino IDE, Xaiv qhov tseeb Arduino board thiab COM chaw nres nkoj. Tom qab ntawd, xa cov cai rau koj pawg Arduino. nco ntsoov tias cov cai tau muab tso ua tiav.
Kauj Ruam 6: Khiav Txoj Cai
- Rov Pib dua: Koj tuaj yeem siv khawm rov pib dua ntawm daim ntaub thaiv kom rov pib dua tus Ethernet Controller thiab Arduino board.
- Khiav cov cai: Tom qab rov pib dua/qhib lub zog, qhib lub davhlau ya nyob twg, koj yuav tsum pom Arduino luam tawm cov xwm txheej txheej txheem: arduino txuas rau lub network (siv sijhawm ob peb feeb), tom qab ntawd xa cov ntaub ntawv dummy mus rau AskSensors hla HTTP tau thov.
- Cov Lus Teb: Tom qab tau txais qhov kev thov sau cov ntaub ntawv mus rau qhov tshwj xeeb Sensor los ntawm cov neeg siv khoom, tus neeg rau zaub mov ua ntej xa HTTP cov lus teb qhia tus lej ntawm cov qauv kho tshiab ua tiav ('1' hauv peb kis).
Kauj Ruam 7: Pom Cov Ntaub Ntawv
Tam sim no koj cov ntaub ntawv tau tshaj tawm zoo rau AskSensors huab. Koj tuaj yeem pom cov ntaub ntawv no hauv kab lossis xa nws mus rau CSV cov ntaub ntawv.
Txhua lub Sensor muaj nws tus kheej lub dashboard uas tam sim no tso cai saib xyuas nws lub xeev nyob rau lub sijhawm tiag (hnub hloov tshiab zaum kawg, lub xeev sib txuas..)
Nyem koj lub Sensor los ntawm cov npe, teeb duab rau koj tus qauv (Qauv 1). Cov duab saum toj no qhia qhov piv txwv ntawm kev tso saib siv hom ntsuas kab.
Kauj ruam 8: Ua tau zoo
Ua tsaug rau koj nyeem. koj tuaj yeem pom ntau cov lus qhia ntawm no.
Yog tias koj muaj lus nug, koom nrog AskSensors zej zog!
Pom zoo:
Ua Cov Phiaj Xwm Zoo Los Ntawm Cov Ntaub Ntawv Nyob Arduino (thiab Txuag Cov Ntaub Ntawv rau Excel): 3 Cov Kauj Ruam
Ua Cov Phiaj Xwm Zoo Los Ntawm Cov Ntaub Ntawv Nyob Arduino (thiab Txuag Cov Ntaub Ntawv rau Excel): Peb txhua tus nyiam ua si nrog peb tus lej L … cov ntsiab lus tau ntxiv thiab nws tsis tshwj xeeb rau lub qhov muag. Arduino IDE cov phiaj xwm tsis
Yuav Ua Li Cas Vaum Thiab Kub Tiag Tiag Cov Ntaub Ntawv Teev Npe Nrog Arduino UNO thiab SD-Card - DHT11 Cov ntaub ntawv-logger Simulation hauv Proteus: 5 Cov Kauj Ruam
Yuav Ua Li Cas Vaum Thiab Kub Tiag Tiag Cov Ntaub Ntawv Teev Npe Nrog Arduino UNO thiab SD-Card | DHT11 Cov ntaub ntawv-logger Simulation hauv Proteus: Taw qhia: nyob zoo, qhov no yog Liono Maker, ntawm no yog YouTube txuas. Peb tab tom tsim txoj haujlwm muaj tswv yim nrog Arduino thiab ua haujlwm ntawm cov kab ke. Cov ntaub ntawv-Logger: Cov ntaub ntawv logger (tseem cov ntaub ntawv-logger lossis cov ntaub ntawv kaw) yog cov cuab yeej siv hluav taws xob uas sau cov ntaub ntawv dhau sijhawm
Yuav Tshaj Tawm Li Cas ESP32 Cov Ntaub Ntawv Nrog NTP Lub Sijhawm mus rau IoT Huab: 5 Kauj Ruam
Yuav Ua Li Cas Tshaj Tawm ESP32 Cov Ntaub Ntawv Nrog NTP Lub Sijhawm mus rau IoT Cloud: Hauv ntau daim ntawv thov, cov neeg siv yuav tsum xa lawv cov ntaub ntawv nrog rau nws lub sijhawm timestamp hauv zos ntawm qhov muaj txiaj ntsig kom xa hauv kev them nyiaj mus rau AskSensors IoT huab. Lub sijhawm timestamp yog UNIX Lub Sijhawm Sijhawm: tus naj npawb ntawm milliseconds uas tau dhau mus txij li Lub Ib Hlis
RAWS LI COV NTAUB NTAWV NTSEEG NTAWV NTAWV MUAJ NTAWV TSHUAJ NTAWV TSO CAI RAU RASPBERRY PI: 6 Kauj Ruam (nrog Duab)
RAWS LI COV NTAUB NTAWV NTAWV MUAJ NTAWV TSHUAJ NTXIV RAU RASPBERRY PI: Hauv qhov haujlwm no, peb yuav txuas peb ntawm Atlas Scientific's EZO sensors (pH, yaj cov pa thiab kub) mus rau Raspberry Pi 3B+. Hloov chaw ntawm txuas cov kab hluav taws xob mus rau Raspberry Pi, peb yuav siv Whitebox Labs Tentacle T3 daim ntaub thaiv. T
Yuav Nyuaj Li Cas Koj Psp Backups 'ISO Cov Ntaub Ntawv rau hauv CSO Cov Ntaub Ntawv kom Txuag Chaw: 4 Kauj Ruam
Yuav Nyuaj Li Cas Koj Psp Backups 'ISO Cov Ntaub Ntawv rau hauv CSO Cov Ntaub Ntawv kom Txuag Chaw.: Hauv qhov kev qhia no Kuv yuav qhia koj yuav ua li cas thiaj li nrawm koj li psps' thaub qab los ntawm ISO rau CSO kom txuag chaw ntawm koj lub cim xeeb lo, siv tsuas yog ib qho ntawm cov software uas yog siv tau nrog Wine Hauv Ubuntu. Koj tseem yuav xav tau CFW (Cusstom Firm-Ware) psp los ua