Cov txheej txheem:

ESP8266 GMail Sender: 3 Kauj Ruam (nrog Duab)
ESP8266 GMail Sender: 3 Kauj Ruam (nrog Duab)

Video: ESP8266 GMail Sender: 3 Kauj Ruam (nrog Duab)

Video: ESP8266 GMail Sender: 3 Kauj Ruam (nrog Duab)
Video: email alert using nodemcu esp8266 | email send using nodemcu | esp8266 | tamil |manimarantech 2024, Kaum ib hlis
Anonim
ESP8266 GMail Xa Ntawv
ESP8266 GMail Xa Ntawv

Nyob zoo thiab zoo siab txais tos rau kuv Thawj Cov Lus Qhia.

Kuv yuav qhia koj li cas xa email los ntawm ib qho ESP8266 wifi module siv Gmail server.

Cov lus qhia no tso siab rau Arduino core rau ESP8266 WiFi nti, uas ua rau tus kheej muaj microcontroller los ntawm nws (tsis xav tau AT cov lus txib thiab tus tswv cuab).

Koj tuaj yeem txuas cov ntsuas thiab tau txais kev ceeb toom los ntawm email txog kev hloov pauv.

Hloov tshiab 2018:

Nov yog cov cai tshiab sau ua arduino lib. Nws txhawb ntau tus neeg tau txais. Tsis tas li tsis tas yuav nkag tus lej nkag thiab tus lej nkag mus rau base64 tam sim no nws siv ESP core base64 lib. github

2019 Hloov tshiab:

  • Txoj cai no tsis ua haujlwm nrog ESP8266 core rau Arduino version 2.5.0!
  • Kev daws teeb meem ib ntus siv cov tub ntxhais version 2.4.2

Ua ntej peb pib

Yuav tsum tau kho vajtse:

  1. Ib qho ESP8266 (Kuv siv ESP8266-07 ebay txuas).
  2. Hauv kuv rooj plaub USB UART Board (Kuv siv FT232RL FTDI Serials Adapter Module ebay). Tsis xav tau yog tias koj lub rooj tsav xwm muaj chaw nres nkoj usb.
  3. Qee cov jumper cables.
  4. WIFI router tau kawg.

Cov npe yuav tsis tiav.

Yuav tsum tau software:

  1. Arduino Software
  2. Arduino core rau ESP8266 WiFi nti
  3. Sketch nrog txoj haujlwm thiab ntsuas tus lej (ESP8266_Gmail_Sender.zip).

Kauj ruam 1: Teeb Gmail Account

Gmail Account Teeb
Gmail Account Teeb

Peb yuav siv SMTP los xa lus.

Siv SMTP Kev Pov Thawj Peb muab tsuas yog email thiab password, los ntawm lub neej ntawd Google siv ntau txoj hauv kev txheeb xyuas qhov tseeb yog li peb yuav tsum hloov chaw.

Mus rau koj li Google chaw teeb tsa thiab pab kom "Tso cai rau kev nyab xeeb tsawg app" nyob hauv qab ntawm nplooj ntawv.

Qhov no txhais tau tias cov apps tsuas xav tau koj li email thiab password thaum nkag mus rau koj tus lej gmail.

Yog tias koj txhawj xeeb txog kev nyab xeeb, tsuas yog siv tus lej sib txawv

Kauj ruam 2: Kho Sketch

Kho kom raug kab kos
Kho kom raug kab kos
Kho kom raug Sketch
Kho kom raug Sketch

Kuv tau sau me ntsis kos uas xa ib qho lus sim los tshuaj xyuas yog tias txhua yam ua haujlwm raws li tsim nyog

Thaum txhua lub software rub tawm thiab teeb tsa:

  • Unzip ESP8266_Gmail_Sender.zip
  • Nrhiav thiab qhib ESP8266_Gmail_Sender.ino
  • Teem koj lub npe nkag rau wifi (SSID) thiab tus password. Yuav tsum zoo li no:

const char* ssid = "MyWiFi";

const char* lo lus zais = "12345678";

Hauv teeb () muaj nuj nqi nrhiav

yog (gsender-> Kawm (ntsiab lus)-> Xa ("[email protected]", "Teeb teeb"))

Thawj qhov ntsuas ntawm Xa () muaj nuj nqi yog tus tau txais email, kab lus thib ob.

Hloov tus neeg txais los ntawm [email protected] rau koj tus email uas yuav tau txais lus.

Kuv tau txais ntau email txhua hnub vim tias qee tus ntawm koj tsis ua tib zoo, THOV ZOO TSHAJ PLAWS NTAWV THOV NCO NTSOOV POM ZOO TSHAJ PLAWS EMAIL

Lub luag haujlwm tseem ceeb yog xaiv tau! Cov ntsiab lus teev ib zaug thiab khaws cia kom txog thaum koj hloov nws.

Koj tuaj yeem xa email yam tsis muaj kev kawm lossis yog nws tau teeb tsa

gsender-> Xa (rau, lus);

Tam sim no qhib Gsender.h tab

Peb xav tau Base64 tus lej email chaw nyob thiab tus lej zais ntawm tus lej Gmail uas yuav siv los xa email

Koj tuaj yeem siv base64encode.org rau encoding, qhov tshwm sim yuav tsum yog qee yam xws li:

const char* EMAILBASE64_LOGIN = "Y29zbWkxMTExMUBnbWFpbC5jb20 =";

const char* EMAILBASE64_PASSWORD = "TGFzZGFzZDEyMzI =";

Tam sim no teeb FROM teb

const char* FROM = "[email protected]";

Qhov ntawd yog txhua yam rau ntu no.

Kauj ruam 3: Code Uploading and Testing

Code Uploading thiab Xeem
Code Uploading thiab Xeem
Code Uploading thiab Xeem
Code Uploading thiab Xeem

Txuag hloov. Tsis txhob hnov qab teeb tsa koj lub rooj tsavxwm hauv Tool menu.

Rub cov duab kos rau koj lub ESP8266 pawg thawj coj.

Qhib Serial saib, pawg thawj coj saib yuav sau cov lus nkag.

Qhov ntawd yog txhua yam Kuv vam tias koj yuav tau txais "Cov lus xa." Ua tsaug …

Pom zoo: