Cov txheej txheem:
- Khoom siv
- Kauj Ruam 1: Ntsuam Xyuas Koj ESP8266 NodeMCU
- Kauj Ruam 2: Qhib Dawb Twilio Trial Account thiab Tau Txais Koj Tus Xov Tooj
- Kauj Ruam 3: Xa SMS Los Ntawm Koj NodeMCU
- Kauj ruam 4: Khawm kom xa SMS
- Kauj Ruam 5: SMS Los Ntawm NodeMCU Yog Qhov Zoo Tshaj IoT
Video: Xa SMS Siv ESP8266: 5 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:25
Cov lus qhia no coj koj mus dhau cov kauj ruam xa SMS lus hauv is taws nem los ntawm ESP8266 NodeMCU module board, mus rau lub xov tooj ntawm tes. Txhawm rau tuaj yeem xa cov lus koj yuav tsum tau ua los ntawm cov kauj ruam kom tau txais tus lej xov tooj virtual los ntawm Twilio, tuam txhab kev sib txuas lus. Tsis xav tau daim npav rho nyiaj vim tias Twilio muaj kev xaiv pub dawb sim. Tom qab ntawd, koj yuav rub tawm thiab siv tus qauv Arduino IDE program kom xa SMS.
Tus qauv piv txwv hauv cov lus qhia no muaj nuj nqi hu uas ncaj qha rau tom ntej rau theej, muab tshuaj txhuam, kho, thiab siv hauv koj tus kheej cov haujlwm.
Khoom siv
Kuv tab tom siv NodeMCU ESP8266 CH340G ESP-12E Wireless WIFI Internet Development Board. Lawv muag txog $ 3 ntawm eBay los ntawm cov neeg xa khoom Suav.
Kauj Ruam 1: Ntsuam Xyuas Koj ESP8266 NodeMCU
Koj tuaj yeem sim nrog lossis tsis muaj daim ntawv qhia zaub mov. Yog tsis muaj lub khob cij lub teeb ntawm lub nkoj yuav ntsais thiab tawm uas yog qhov ua tau zoo rau kev sim.
Hauv kuv tus qauv, Kuv ntsaws NodeMCU rau hauv Breadboard. Kuv ntsaws qhov tsis zoo ntawm LED mus rau hauv av (G lossis GND) tus pin ntawm NodeMCU. Qhov zoo ntawm LED txuas nrog los ntawm cov neeg tawm tsam (500 txog 5K ohm) rau NodeMCU tus pin D4. Thaum qhov kev zov me nyuam ua haujlwm tiav, ntawm lub rooj tsavxwm LED yuav qhib, sab nrauv LED tawm, tom qab ntawv ntawm lub rooj tsavxwm LED yuav tua, sab nrauv LED qhib. LED teeb yuav hloov pauv thiab tawm.
Rub tawm thiab ua haujlwm qhov kev xeem Arduino yooj yim: nodeMcuTest.ino. Thaum tab tom ua haujlwm, lub teeb LED onboard yuav qhib rau 1 thib ob, tua rau 1 vib nas this, thiab txuas ntxiv mus. Tsis tas li, cov lus tau tshaj tawm uas tuaj yeem pom hauv Arduino IDE Cov Cuab Yeej/Saib Xyuas Ib Leeg.
+++ Teeb tsa.
+ Pib pib ntawm lub rooj tsavxwm LED tus lej pin rau cov zis. LED tawm. ++ Mus rau lub voj. + Loop counter = 1 + Loop counter = 2 + Loop counter = 3…
Thaum koj tau lees paub tias koj li IDE tuaj yeem siv los ua haujlwm rau koj li NodeMCU, txav mus rau theem tom ntej.
Nco tseg hais txog tsev qiv ntawv, Kuv tau teeb tsa rau hauv qab no rau ESP8266 cov haujlwm:
- Arduino WiFi lub tsev qiv ntawv version 1.2.7.
- PubSubClient version 2.7.0, los ntawm Nick O'Leary, rau MQTT kev xa xov. Tsis xav tau rau txoj haujlwm no.
- IRremoteESP8266 version 2.6.3, rau infrared. Tsis xav tau rau txoj haujlwm no.
Yog tias koj muaj cov ntaub ntawv ntau ntxiv ntawm cov tsev qiv ntawv xav tau, thov tawm lus. Qhov laj thawj kuv tsis muaj qhov tshwj xeeb yog tias kuv tsis tau kaw qhov kuv teeb tsa, thov txim.
Txog ESP8266 NodeMCU
Nta,
- 80 MHz moos ceev
- Kev khiav hauj lwm muaj zog: 3.3V
- Cia flash nco: 4 MB, SRAM: 64 KB
- 9 nquag siv digital GPIO pins sau: D0 txog D8.
- Ntawm 9, 4 tus pin tuaj yeem siv rau SPI, thiab 2 tus pin rau I2C.
- Cuam tshuam GPIO pins D0-D8.
- Tsis txhob siv 6 tus pin: CLK, SD0, CMD, SD1, SD2, SD3 (GPIO 6-11), vim tias lawv tau siv.
- Kuaj: khawm nkag siv D0-D02.
- Kuaj: ntsais LED siv D0-D08. Tawm mus rau tus tiv thaiv, rau LED, rau hauv av.
- Yuav tsum ntsuas, UART1 (TX = GPIO2), Cov khoom siv Serial1: D4 lossis D7 thiab D8.
Pin paub meej
NodeMCU Label GPIO tus pin# D0 16 GPIO nyeem/sau, nkaus xwb. Tej zaum yuav tsis muaj kev cuam tshuam. D1 5 Digital GPIO. -------------------- D2 4 Digital GPIO. D3 0 Digital GPIO. ---------- D2 4 I2C: SCL, moos DS3231, PCF8574 input modules D3 0 I2C: SDA ---------- D4 (TX) 2 Ua hauv, ntawm board LED. ---------- 3V 3v tso zis G av -------------------- D5 14 Digital GPIO. D6 12 Digital GPIO. D7 (RX) 13 Ua haujlwm rau cov tswv yim, piv txwv li, infrared tau txais. D8 (TX) 15 Tsis ua haujlwm rau cov tswv yim, piv txwv li, infrared tau txais. ---------- D5 14 SD card: SPI SCK D6 12 SD card: SPI MISO D7 (RX) 13 SD card: SPI MOSI D8 15 SD card: CS rau SPI pab/lov tes taw lub cuab yeej. Muaj peev xwm siv lwm tus pin digital. -------------------- RX 03 System uplod los ntawm IDE, uas ua rau rov pib dua tom qab rub tawm. TX 01 System uplod. G Av 3V 3v tso zis
Kauj Ruam 2: Qhib Dawb Twilio Trial Account thiab Tau Txais Koj Tus Xov Tooj
Twilio yog lub tuam txhab kev sib txuas lus hauv is taws nem. Cov khoom uas tau siv hauv cov lus qhia no yog Twilio Programmable Messaging thiab tus lej xov tooj. Twilio muaj cov khoom lag luam ntawm tus lej xov tooj virtual uas tuaj yeem siv xa thiab tau txais SMS lus rau txhua lub xov tooj ntawm tes.
Hauv theem no, koj yuav:
- Qhib tus lej Twilio, yog tias koj tseem tsis tau muaj. Ib tus lej sim yog pub dawb thiab tsis xav tau daim npav rho nyiaj. Koj tus lej sim yuav muaj qhov kev sib tw sim uas siv los them tus lej xov tooj thiab sib pauv xov tooj nrog xov tooj.
- Yuav tus lej Twilio. Nws yog dawb vim tias nws tau them nyiaj rau siv koj qhov kev sib tw sim.
- Xa lus los ntawm koj lub xov tooj ntawm tes rau koj tus lej xov tooj tshiab.
- Thaum Twilio tau txais koj cov lus, cov lus teb tsis siv neeg tau xa mus rau koj lub xov tooj ntawm tes.
- Siv Twilio Console lub vev xaib thov kom pom koj cov lus sau tseg.
Thawj qhov vis dis aus saum toj no qhia yuav qhib Twilio tus account li cas. Qhov yeeb yaj kiab thib ob qhia yuav ua li cas thiaj yuav tus lej Twilio.
Txuas mus rau Twilio Console lub vev xaib kom qhib tus account.
Txuas mus rau Twilio Console lub vev xaib txhawm rau yuav Twilio tus lej xov tooj.
Koj tus lej Twilio SMS tshiab muaj peev xwm tus lej xov tooj muaj cov lus teb tsis siv neeg twb tau teeb tsa. Raws li kev sim, xa SMS los ntawm koj lub xov tooj ntawm tes rau koj tus lej Twilio. Koj yuav tau txais cov lus hauv qab no:
Ua tsaug rau koj cov lus. Kho koj tus lej SMS URL kom hloov cov lus no. Teb Pab Rau Kev Pab. Teb Nres kom rho npe tawm.
Tam sim no siv Twilio Console los saib koj cov lus teev tseg los ntawm kev xeem saum toj no:
www.twilio.com/console/sms/logs
Xav paub ntau ntxiv txog Kev Siv Twilio
Koj tuaj yeem tsim koj tus kheej kev cai pib teb. Txuas mus rau Studio li cas-ua li cas, yuav ua li cas thiaj li ua tau raws li SMS teb cov lus. Studio yog peb rub thiab tso Twilio Console cuab yeej.
Koj tuaj yeem siv Twilio Console los saib koj cov lus sau thiab rub tawm cov cav ua CVS thiab thauj lawv mus rau hauv daim ntawv nthuav tawm. Koj tuaj yeem xaiv hnub thiab sijhawm ntau, mus thiab los ntawm tus lej xov tooj, thiab xwm txheej xws li: Tsis Xa Ntawv lossis Xa. Koj kuj tseem muaj qhov kev xaiv rub tawm cov cav ua CVS cov ntaub ntawv. Txij li nws muaj qhov txwv ntawm 300 lub cav ib lub sijhawm, koj tuaj yeem txwv qhov xaiv los ntawm hnub tim.
Kev Tsim Kho Txuas
Txuas mus rau cov ntaub ntawv thiab cov qauv kev pab cuam kom xa lus.
Txuas mus rau qhov program piv txwv kom teev cov lus teev tseg.
Txuas mus rau cov txheej txheem cov lus xov xwm. Cov npe khoom uas tau xa hauv HTTP thov.
Txuas mus sau cov npe SMS rau ib lub sijhawm.
Kauj Ruam 3: Xa SMS Los Ntawm Koj NodeMCU
Rub tawm qhov program: HttpTwPost.ino, thiab thauj nws mus rau hauv koj li Arduino IDE. Hauv qhov program nkag mus rau koj li WiFi network ID thiab tus password. Nkag mus rau koj tus kheej Twilio tus lej SID, tus lej cim, thiab tus lej xov tooj. Twilio tus lej SID thiab tus lej cim tau pom los ntawm Twilio Console dashboard. Nyem Auth Token "qhia", txhawm rau saib daim ntawv cim npe.
// Koj lub network SSID thiab passwordconst char* ssid = "YourNetworkId"; const char* password = "YourNetworkPassword"; const char* account_sid = "YourTwilioAccountSID"; const char* auth_token = "YourAuthToken"; String from_number = "+16505551111"; // Tom qab encoding tau ntxiv, ntxiv "+". Txoj hlua rau_number = "+16505552222"; String message_body = "Nyob zoo los ntawm NodeMCU."
Twilio nco tseg, thaum siv tus lej xov tooj nrog Twilio, nws yog qhov zoo tshaj los ua tus lej raws li E.164 tus lej xov tooj. E.164 formatted xov tooj pib nrog "+" thiab lub teb chaws chaws. Tus lej xov tooj tsis muaj qhov chaw, kab zauv, lossis kab zauv. Piv txwv: +16505551111.
Khiav qhov kev pab cuam. Thaum txoj haujlwm pib, nws yuav xa ib tsab ntawv SMS rau koj tus lej xov tooj. Tsis tas li, cov lus tau tshaj tawm uas tuaj yeem pom hauv Arduino IDE Cov Cuab Yeej/Saib Xyuas Ib Leeg. Cov lus saib xyuas suav nrog cov lus teb los ntawm Twilio.
+++ Teeb tsa.+ Txuas rau WiFi. …. + Txuas nrog WiFi, IP chaw nyob: 192.168.1.76 + Siv ntiv tes 'BC B0 1A 32 80 5D E6 E4 A2 29 66 2B 08 C8 E0 4C 45 29 3F D0' + Txuas rau api.twilio.com + Txuas nrog. + Tshaj tawm HTTP xa SMS thov. + Kev sib txuas raug kaw. + Teb: HTTP/1.1 201 CREATED Date: Thu, 16 Jul 2020 20:39:49 GMT Cov ntsiab lus-hom: application/xml Cov ntsiab lus-Ntev: 878 Kev Sib Txuas: kaw Twilio-Concurrent-Requests: 1 Twilio-Request-Id: RQe4fbdd142fca4b2fab24697e74006837 Twilio-Thov-Sijhawm: 0.116 Access-Control-Allow-Origin: * Access-Control-Allow-Headers: Txais, Tso Cai, Ntsiab Lus-Hom, Yog Sib Xws, Yog Hloov Kho-Txij, Yog-Tsis Muaj-Sib Tw, Yog- Tsis hloov kho-Txij li Kev Nkag Mus-Tswj-Tso Cai-Txoj Cai: Tau Txais, Tshaj Tawm, Rho Tawm, Xaiv Xaiv Nkag Mus-Tswj-Tshaj Tawm-Lub Taub Hau: ETag Access-Control-Allow-Credentials: true X-Powered-By: AT-5000 X-Shenanigans: tsis muaj X-Tsev-Cheeb Tsam: us1 X-API-Domain: api.twilio.com nruj-Thauj-Kev Ruaj Ntseg: max-age = 31536000… + Pib lub voj.
Koj tuaj yeem saib Twilio cov lus cav, txhawm rau saib koj cov lus xa tuaj.
Kauj ruam 4: Khawm kom xa SMS
Cov vis dis aus saum toj no qhia txog ESP8266 NodeMCU siv xa xov mus rau lub xov tooj ntawm tes. Hauv daim vis dis aus, NodeMCU twb tau pib thiab txuas nrog WiFi network. Thaum lub khawm raug nias, lub teeb ci ntawm lub teeb mus. SMS thov thov xa mus rau Twilio Kev Xa Ntawv. Qhov kev pabcuam xa SMS rau kuv lub xov tooj ntawm tes. Cov lus tau txais. Cov kev pabcuam tseem teb rau NodeMCU tias cov lus tau raug xa mus ua kab lus. Txog lub sijhawm no, cov lus twb tau txais hauv xov tooj lawm. Tom qab NodeMCU tau txais cov lus teb los ntawm Twilio, lub teeb onboard tawm mus. Lub Circuit Court npaj txhij xa lwm cov lus.
Nram qab no yog yuav ua li cas txhawm rau ua haujlwm hauv daim vis dis aus. Cov kauj ruam no xav tau lub khob cij, khawm thiab xov hlau. Ntxiv ib lub pob rau ntawm lub khob cij. Ib sab ntawm lub pob txuas rau NodeMCU D1 tus pin. Hlau lwm sab ntawm lub pob rau NodeMCU tus pin hauv av (tus pin G ntawm kuv lub rooj tsavxwm).
Rub tawm qhov program: HttpTwSendSms.ino thiab thauj nws mus rau hauv koj li Arduino IDE. Ib yam li hauv cov kauj ruam dhau los, rau hauv qhov program nkag mus rau koj li WiFi network ID thiab tus password. Nkag mus rau koj tus kheej Twilio tus lej SID, tus lej cim, thiab tus lej xov tooj.
Thaum qhov haujlwm tau ua haujlwm NodeMCU yuav txuas rau WiFi network. Thaum lub pob nyem, cov lus tau xa tus lej xov tooj.
Kauj Ruam 5: SMS Los Ntawm NodeMCU Yog Qhov Zoo Tshaj IoT
Tam sim no koj tuaj yeem siv tus lej piv txwv thiab koj li Twilio tus lej xa SMS hauv WiFi.
Nyob zoo, Stacy David
Pom zoo:
Cov Hais Lus Ua Los Ntawm Cov Khoom Siv Rov Los thiab Rov Siv Dua: 6 Cov Kauj Ruam
Cov Hais Lus Ua Los Ntawm Cov Khoom Siv Rov Los thiab Rov Los Siv Rov Los: " Suab paj nruag yog cov lus thoob ntiaj teb ntawm tib neeg. Thiab qhov zoo tshaj plaws-lawv tsis tau them kuv ib dime. Txhua yam nyob rau hauv no pr
Tuchless Hloov rau Cov Khoom Siv Hauv Tsev -- Tswj Koj Cov Khoom Siv Hauv Tsev Tsis Muaj Tuch Ib qho Hloov: 4 Cov Kauj Ruam
Tuchless Hloov rau Cov Khoom Siv Hauv Tsev || Tswj Koj Cov Khoom Siv Hauv Tsev Tsis Muaj Tuch Ib qho Hloov: Nov Yog Qhov Tuchless Hloov Rau Cov Khoom Siv Hauv Tsev. Koj Siv Tau Qhov No Mus Rau Txhua Qhov Chaw Hauv Pej Xeem Kom Pab Tau Tawm Tsam Ib Yam Kab Mob. Lub Circuit Court Raws Li Tsaus Sensor Circuit Ua Los Ntawm Op-Amp Thiab LDR. Qhov Tseem Ceeb Thib Ob Ntawm Qhov Circuit Court SR Flip-Flop Nrog Sequencell
Txawb Xov Tooj Siv Yooj Yim Siv STM32F407 Cov Khoom Siv Tshawb Pom thiab GSM A6 Module: 14 Cov Kauj Ruam (nrog Duab)
Kev Siv Xov Tooj Ntawm Lub Xov Tooj Siv STM32F407 Cov Khoom Siv Tshawb Pom thiab GSM A6 Module: Koj puas tau xav tsim qhov kev ua kom txias txias? Yog tias yog, ua li cas txog kev tsim ib qho ntawm cov neeg nyiam tshaj plaws thiab txhua tus nyiam cov khoom siv xws li Lub Xov Tooj Txawb !!!. Hauv Cov Lus Qhia no, Kuv yuav qhia koj yuav tsim lub xov tooj txawb yooj yim siv STM li cas
Yooj Yim Cov Chaw Siv Cov Ntaub Ntawv Hauv Chaw Siv Hauv / Arduino / PfodApp: 6 Cov Kauj Ruam
Yooj Yim Cov Ntaub Ntawv Tseem Ceeb Siv Hauv Hauv/Arduino/PfodApp: Rau Plotting Cov Ntaub Ntawv tawm tsam Hnub/Sijhawm siv tsuas yog Arduino's millis () pom qhov qhia no Android mobile thiab ntes nws rau
Kev teeb tsa Matrix LED hauv Cov Khoom Siv Hluav Taws Xob qub - Yuav Tsum Tau Cov Khoom Siv: 3 Cov Kauj Ruam (nrog Duab)
Kev teeb tsa Matrix LED hauv Cov Khoom Siv Hluav Taws Xob qub - Yuav Tsum Tau Siv Cov Khoom Siv: Lub teeb pom kev zoo los ntawm lub Windows PC dhau Bluetooth thiab LED cov txheej txheem nthuav tawm Ib co piv txwv ntawm pixel kos duab thiab cov duab ua haujlwm khiav ntawm LED Cov Ntsiab Lus ntawm PIXEL Guts Kit Hauv Cov Lus Qhia no, peb ' yuav