Telegram + ESP-01

Тема в разделе "Arduino & Shields", создана пользователем Kewralza15, 24 май 2019.

Метки:
  1. Kewralza15

    Kewralza15 Нуб

    Здравствуйте!
    Делаю первые шаги с ArduinoUno и модулем WiFi ESP-01.
    Хочу включить/выключить светодиод на плате (13 пин).
    Схема подключения
    Код (C++):
    #include <ESP8266WiFi.h>
    #include  <WiFiClientSecure.h>
    #include <TelegramBot.h>
    #define LED 13 //led pin number
    // Initialize Wifi connection to the router
    const char* ssid     = "название моей wifi сети";
    const char* password = "пароль";
    // Initialize Telegram BOT
    const char BotToken[] = "токкен от телеграм бота @BotFather";
    WiFiClientSecure net_ssl;
    TelegramBot bot (BotToken, net_ssl);
    // the number of the LED pin  
    void setup()
    {  
    Serial.begin(115200);  
    while (!Serial) {}  //Start running when the serial is open
    delay(3000);  
    // attempt to connect to Wifi network:  
    Serial.print("Connecting Wifi: ");  
    Serial.println(ssid);  
    while (WiFi.begin(ssid, password) != WL_CONNECTED)
          {  
      Serial.print(".");  
      delay(500);  
    }  
    Serial.println("");  
    Serial.println("WiFi connected");  
    bot.begin();  
    pinMode(LED, OUTPUT);  
    }  
    void loop()
    {  
    message m = bot.getUpdates(); // Read new messages  
    if (m.text.equals("on"))
          {  
      digitalWrite(LED, 1);  
      bot.sendMessage(m.chat_id, "The Led is now ON");  
    }  
    else if (m.text.equals("off"))
          {  
      digitalWrite(LED, 0);  
      bot.sendMessage(m.chat_id, "The Led is now OFF");  
    }  
    }  
    Получаю вот такую ошибку
    Telegram пингуется, поетому проблема скорее всего в самой библиотеке для работы с Телеграм.