Cov txheej txheem:
- Kauj Ruam 1: Qhov Chaw
- Kauj Ruam 2: Tus Muab Kev Pabcuam SMS
- Kauj Ruam 3: Txuas Nws
- Kauj ruam 4: Txoj Cai
- Kauj ruam 5: Nyem rau Code
- Kauj Ruam 6: Nias Lub Khawm
Video: Yuav Ua Li Cas Xa Ntawv SMS Los Ntawm Koj Arduino ESP Project: 6 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Cov lus qhia no qhia yuav ua li cas xa SMS cov ntawv los ntawm koj txoj haujlwm arduino siv ESP8266 lub cuab yeej thiab txuas WiFi. Vim li cas siv SMS? * SMS kuj tseem tuaj yeem tau txais qhov sib txuas ntawm cov ntaub ntawv xov tooj tsis muaj * Tsis muaj daim ntawv thov thib peb yuav tsum tau teeb tsa ntawm lub xov tooj ntawm tes. * SMS yog qhov tseem ceeb rau cov lus siv tseem ceeb. rau ESP ntaus ntawv. Rau koj qhov phiaj xwm no tuaj yeem ua rau qee qhov cuam tshuam lossis xwm txheej xwm txheej
Kauj Ruam 1: Qhov Chaw
Rau qhov kev ua yeeb yaj kiab no, koj yuav xav tau:* ESP8266 ntaus ntawv. Kuv xaiv ESP-01 pob, tab sis lwm yam ESP pob/ntaus ntawv yuav tsum ua haujlwm ib yam nkaus.* 3.3v muab* WiFi txuas* Kapow SMS account* Arduino IDE* ESP8266 Programming module.
Kauj Ruam 2: Tus Muab Kev Pabcuam SMS
Hauv txoj haujlwm no, SMS cov lus tau xa los ntawm SMS rooj vag hauv internet. Rau qhov no koj yuav tsum tau sau npe mus rau tus muab kev pabcuam SMS. Cov neeg siv npe ib txwm raug them nqi ntawm ib nqe lus hauv xov tooj. Kuv xaiv tus muab kev pabcuam SMS yog KAPOW. Kuv pom tias feem ntau cov chaw muab SMS hauv tebchaws Askiv tsuas yog cuam tshuam nrog Cov Tuam Txhab Txwv, thiab tsis yog tib neeg. Txawm li cas los xij, KAPOW ua, thiab muab kev pabcuam zoo thiab raug nqi. Txhawm rau qhib Kapow SMS tus account, mus saib qhov txuas hauv qab no.
www.koobpov.co.uk
Kauj Ruam 3: Txuas Nws
Cov kab hluav taws xob txuas rau qhov haujlwm no yog saud
Kauj ruam 4: Txoj Cai
// ESP8266 Demo Project xa SMS ntawm KAPOW (www.kapow.co.uk)
// https://www.instructables.com/id/How-to-Send-SMS-… #include #include char _sKapow_Host = "kapow.co.uk"; int _iKapow_Port = 80; / * <<<< Hloov DETAILS hauv qab no */ // Koj li WiFi ntsiab lus: char _sWiFi_SSID = "YourWifiPoint"; // <--- CHANGE !!! char _sWiFi_Password = "YourWifFiPassword"; // <--- CHANGE !!! // Koj Tus Kapow Tus Neeg Siv Khoom Paub meej: char _sKapow_User = "YourKapowAccount"; // <--- CHANGE !!! char _sKapow_Password = "YourKapowPassword"; // <--- CHANGE !!! char _sKapow_Mobile = "Koj Lub Xov Tooj"; // >>> CHANGE DETAILS SAWV DAWS */ // khawm txuas nrog GP0 Pin const int gp0_Pin = 0; const koj iMaxAttempts = 10; int gp0_State = 0; teeb tsa tsis muaj dab tsi () {Serial.begin (9600); Serial.println ("\ nDemo: Xa SMS ntawm KAPOW"); // pib lub khawm khawm ua lub tswv yim // thiab rub nws siab (sab hauv) pinMode (gp0_Pin, INPUT_PULLUP); // tsim Wifi txuas WifiConnect (); } void loop () {// nyeem lub xeev khawm gp0_State = digitalRead (gp0_Pin); // yog laub khawm nias qis? yog (gp0_State == 0) {Serial.println ("Nias Nias Kom Xa SMS …"); SendSmsKapow (_sKapow_Mobile, "Qhov no yog+a+Xeem+SMS+Xov+xa+los ntawm+koj+ESP+ntaus ntawv"); } Serial.println ("Tsaug zog rau 1 thib ob"); ncua (1000); } void WifiConnect () {Serial.print ("\ n Txuas rau WiFi:"); Serial.println (_sWiFi_SSID); WiFi.begin (_sWiFi_SSID, _sWiFi_Password); thaum (WiFi.status ()! = WL_CONNECTED) {// rov sim dua tom qab Serial.print thib ob ("."); ncua (1000); } yog (WiFi.status () == WL_CONNECTED) Serial.println ("Txuas rau WiFi"); } bool SendSmsKapow (char* sMobile, char* sMessage) {WiFiClient clientSms; int iAttempts = 0; Serial.print ("Txuas rau KAPOW host"); thaum (! clientSms.connect (_sKapow_Host, _iKapow_Port)) {Serial.print ("."); iAttempts ++; yog (iAttempts> iMaxAttempts) {Serial.println ("\ n Ua tsis tau txuas mus rau KAPOW"); rov muaj tseeb; } ncua (1000); } Serial.println ("\ n Txuas nrog KAPOW"); ncua (1000); Serial.println ("Xa HTTP thov mus rau KAPOW:"); // Ib qho piv txwv GET thov yog: //https://www.kapow.co.uk/scripts/sendsms.php?username=test&password=test&mobile=07777123456&sms=Test+message char sHttp [500] = ""; strcat (sHttp, "Tau txais /cov ntawv sau /sendsms.php?username="); strcat (sHttp, _sKapow_User); strcat (sHttp, "& tus password ="); strcat (sHttp, _sKapow_Password); strcat (sHttp, "& xov tooj ="); strcat (sHttp, sMobile); strcat (sHttp, "& sms ="); strcat (sHttp, sMessage); strcat (sHttp, "& returnid = TRUE / n / n"); Serial.println (sHttp); clientSms.print (sHttp); Serial.println ("Tos kom teb (10 secs) …"); ncua (10 * 1000); char sReply [100] = ""; int iPos = 0; thaum (clientSms.available ()) {char c = clientSms.read (); Serial.print (c); sReply [iPos] = c; iPos ++; yog (iPos == 99) so; } sReply [iPos] = '\ 0'; // kos yog tias teb muaj OK bool bResult = (strstr (sReply, "OK")! = NULL); yog (bResult) Serial.println ("\ nSMS: Ua tiav xa"); lwm yam Serial.println ("\ nSMS: Ua tsis tau tejyam xa"); yog (! clientSms.connected ()) {Serial.println ("Disconnecting from KAPOW"); clientSms.stop (); } rov bResult; }
Kauj ruam 5: Nyem rau Code
Muaj ntau ntau yam qhia ntxaws qhia yuav ua li cas nyem qhov program ESP8266. Yog li kuv tsuas yog muab cov ntsiab lus ntawm kuv kev teeb tsa hauv qhov yooj yim, Kuv siv aUSB rau Serial FTDI interface, thiab rub GP0 qis rau kev rov pib dua kom pib lub bootloader flashing txheej txheem. Kuv tsim kuv tus kheej lub tshuab ntaus ntawv ntaus ntawv kom yooj yim. Nws muaj* lub qhov (socket) rau ESP-01 ntaus ntawv* lub qhov (socket) rau lub liab FTDI interface los ntsaws rau hauv PC host ntawm USB.* Nyees khawm rau RESET, GP0, GP2 RAU GROUND Koj tuaj yeem nyem ESP ntaus ntawv siv 3.3v muab los ntawm FTDI interface. Xyuas kom FTDI jumper teeb tsa kuj tau teeb tsa rau 3.3v.
Kauj Ruam 6: Nias Lub Khawm
Koj tuaj yeem sim qhov phiaj xwm txuas nrog FTDI rau kev tso tawm cov ntawv txuas, lossis nyob ib leeg (ntawm lub khob cij nrog cov khoom siv hluav taws xob sab nraud). Nws tau rov ua dua tshiab rau koj siv lwm 3.3v khoom siv, raws li FTDI cov khoom siv tam sim no yog tshem tawm. Txawm li cas los xij, FTDI 3.3v cov khoom kuj tseem ua haujlwm rau kuv, vim tias kuv lub router wifi nyob hauv caj npab ncav cuag. Leave ESP txuas nrog lub serial/usb chaw nres nkoj yog li koj tuaj yeem saib xyuas kev ua haujlwm debug cav siv Arduino IDE's Serial Monitor. On powerup … Nias khawm txuas nrog GP0. Qhov no yuav xa tawm SMS cov lus raws li hauv qab no. Txheeb xyuas koj lub xov tooj rau qhov tau txais SMS ntawv xov xwm. Ua haujlwm tiav.
Pom zoo:
KEV TSHAWB TSEV KAWM NTAWV HAUV TSEV KAWM NTAWV (Tswj koj cov ntawv thov los ntawm ib tus neeg thoob ntiaj teb): 5 Kauj Ruam
KEV HLOOV TSHIAB (tswj koj cov ntawv thov los ntawm ib lub koom haum thoob ntiaj teb): Hauv cov lus qhia no kuv tau qhia yuav ua li cas koj tuaj yeem siv ESP8266 los tswj cov cuab yeej AC xws li Teeb, kiv cua, thiab lwm yam los ntawm thoob plaws ntiaj teb hauv Is Taws Nem ntawm Blynk app yog tias koj yog tshiab rau ESP8266 nco ntsoov txheeb xyuas cov lus qhia no:-Pib Pib Nrog NodeM
Yuav Ua Li Cas Tsheb Tsheb RC Los Ntawm Cov Duab Duab thiab Ntawv Ntawv: 9 Kauj Ruam (nrog Duab)
Yuav Ua Li Cas RC Tsheb Log Los Ntawm Cardboard thiab Kraft Paper: RC log yog qhov tseem ceeb rau txhua lub tsheb RC. Muaj ntau ntau pawg thiab hom RC log thiab tau txais txoj kev xaiv lub log yog ib qho tseem ceeb tshaj plaws thaum cuam tshuam nrog cov tsheb no. Thaum kuv pib DIYing RC tsheb, ib qho ntawm cov maj
Yuav Ua Li Cas Hloov Cov Ntawv Uas Zoo Li Thaum Koj Tsiv Koj Tus Kheej Los Ntawm Qhov Pib Pib: 4 Cov Kauj Ruam
Yuav Ua Li Cas Hloov Cov Ntawv Uas Zoo Li Thaum Koj Tsiv Koj Tus Nas Hla Lub Pob Pib: Lub npe hais txhua yam
Yuav Ua Li Cas Tau Txais Cov Nkauj Los Ntawm Txhua Qhov (Haha) Lub Vev Xaib (Ntev Li Koj Tau hnov Nws Koj Yuav Tau Txais Nws Ok Zoo Yog Nws Tau Ntxig Hauv Flash Koj Yuav Tsis Muaj Peev Xwm) EDITED !!!!! Ntxiv Info: 4 Cov Kauj Ruam
Yuav Ua Li Cas Tau Txais Cov Nkauj Los Ntawm Txhua Qhov (Haha) Lub Vev Xaib (Ntev Li Koj Tau hnov Nws Koj Yuav Tau Txais Nws … Ok Zoo Yog Nws Tau Ntxig Hauv Flash Koj Yuav Tsis Muaj Peev Xwm) EDITED !!!!! Ntxiv Cov Lus Qhia: yog tias koj tau mus rau lub vev xaib thiab nws ua nkauj nkauj uas koj nyiam thiab xav tau nws ntawm no yog cov lus qhia rau koj tsis yog kuv qhov txhaum yog tias koj cuam tshuam qee yam (tsuas yog txoj hauv kev nws yuav tshwm sim yog tias koj pib tshem cov khoom yam tsis muaj laj thawj. ) Kuv tuaj yeem tau txais cov nkauj rau
Yuav Ua Li Cas Rov Qhib Cov Ntawv Thaum Koj Rov Nkag Nkag Rov Los Tom Qab Koj Logoff: 5 Kauj Ruam
Yuav Ua Li Cas Rov Qhib Cov Ntawv Thaum Koj Rov Nkag Los Tom Qab Koj Logoff: Okay yog li qhov xwm txheej no, koj tab tom siv lub khoos phis tawj nrog ntau thiab ntau ntawm koj cov ntawv qhib tau qhib … Tom qab ntawd, koj niam tuaj txog tsev ntxov dua qhov xav tau! Koj paub zoo tias yog nws ntes koj siv lub khoos phis tawj, qhov twg koj yuav tsum tau pw hauv txaj vim yog