Загрузка эскиза электронной почты на ESP8266 через Arduino IDE

Я работаю над проектом, чтобы отправить электронное письмо, когда кнопка нажата, используя arduino uno, модуль Wi-Fi ESP8266 и приложение Blynk. Мне удалось загрузить эскиз на модуль Wi-Fi (ESP8266), но он не отвечает. Вот вывод, который я получаю от последовательного монитора:

len 1384, room 16 
tail 8
chks

Я посмотрел в Интернете, и я не могу найти решение этой проблемы. Может кто-нибудь один, пожалуйста, помогите?

Ниже приведен эскиз, который я загружаю. Заранее спасибо!

#include <Blynk.h>

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
/* Set this to a bigger number, to enable sending longer messages */
#define BLYNK_MAX_SENDBYTES 128

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "xxxxxxxxxxxxxxxxxxxxx";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "XXXXXXX";
char pass[] = "";

void emailOnButtonPress()
{
  // *** WARNING: You are limited to send ONLY ONE E-MAIL PER 15 SECONDS! ***

  // Let's send an e-mail when you press the button
  // connected to digital pin 2 on your Arduino

  int isButtonPressed = !digitalRead(2); // Invert state, since button is "Active LOW"

  if (isButtonPressed) // You can write any condition to trigger e-mail sending
  {
    Serial.println("Button is pressed."); // This can be seen in the Serial Monitor
    Blynk.email("xxxxxxx@gmail.com", "Subject: Button Logger", "You just pushed the button...");

    // Or, if you want to use the email specified in the App (like for App Export):
    //Blynk.email("Subject: Button Logger", "You just pushed the button...");
  }
}

void setup()
{
  // Debug console
  Serial.begin(9600);

  Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8442);
  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442);

  // Send e-mail when your hardware gets connected to Blynk Server
  // Just put the recepient's "e-mail address", "Subject" and the "message body"
  Blynk.email("xxxxxx@gmail.com", "Subject", "My Blynk project is online.");

  // Setting the button
  pinMode(2, INPUT_PULLUP);
  // Attach pin 2 interrupt to our handler
  attachInterrupt(digitalPinToInterrupt(2), emailOnButtonPress, CHANGE);
}

void loop()
{
  Blynk.run();
}

0 ответов

Другие вопросы по тегам