{"id":98814,"date":"2020-09-17T13:24:39","date_gmt":"2020-09-17T13:24:39","guid":{"rendered":"https:\/\/randomnerdtutorials.com\/?p=98814"},"modified":"2020-09-18T17:48:22","modified_gmt":"2020-09-18T17:48:22","slug":"telegram-group-esp32-esp8266","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/telegram-group-esp32-esp8266\/","title":{"rendered":"Telegram Group: Control ESP32\/ESP8266 Outputs (Arduino IDE)"},"content":{"rendered":"\n<p>This tutorial shows how to control your ESP32 or ESP8266 boards through a Telegram group. Using a Telegram group to control your boards may be useful if you want to have several people interacting with a bot on the same chat and you want all those people to get notifications from the bot.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/ESP_Telegram_output_Group.jpg?resize=1200%2C675&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Telegram Group: Control ESP32\/ESP8266 Outputs (Arduino IDE)\" class=\"wp-image-99247\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/ESP_Telegram_output_Group.jpg?w=1280&amp;quality=100&amp;strip=all&amp;ssl=1 1280w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/ESP_Telegram_output_Group.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/ESP_Telegram_output_Group.jpg?resize=1024%2C576&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/ESP_Telegram_output_Group.jpg?resize=768%2C432&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure><\/div>\n\n\n\n<p>We have other tutorials about Telegram that we recommend reading:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"Telegram: Control ESP32\/ESP8266 Outputs (Arduino IDE)\">Control ESP32\/ESP8266 Outputs using Telegram (Arduino IDE)<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/telegram-request-esp32-esp8266-nodemcu-sensor-readings\/\">Request ESP32\/ESP8266 Sensor Readings using Telegram (Arduino IDE)<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/telegram-esp32-motion-detection-arduino\/\">ESP32 Motion Detection with Notifications using Telegram (Arduino IDE)<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/telegram-esp8266-nodemcu-motion-detection-arduino\/\">ESP8266 NodeMCU Motion Detection with Notifications (Arduino IDE)<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Project Overview<\/h2>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"840\" height=\"628\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Control-ESP32-ESP8266-NodeMCU-with-Telegram-Group-Arduino-IDE.jpg?resize=840%2C628&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Control ESP32 and ESP8266 boards using a Telegram Group with several members\" class=\"wp-image-98848\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Control-ESP32-ESP8266-NodeMCU-with-Telegram-Group-Arduino-IDE.jpg?w=840&amp;quality=100&amp;strip=all&amp;ssl=1 840w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Control-ESP32-ESP8266-NodeMCU-with-Telegram-Group-Arduino-IDE.jpg?resize=300%2C224&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Control-ESP32-ESP8266-NodeMCU-with-Telegram-Group-Arduino-IDE.jpg?resize=768%2C574&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 840px) 100vw, 840px\" \/><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li>In this tutorial you&#8217;ll create a telegram bot to interact with the ESP32 or ESP8266 boards;<\/li><li>You&#8217;ll create a group where you can add several people you want to have control and receive notifications from the bot;<\/li><li>The bot will be added to the group so that the members can interact with it;<\/li><li>As an example, we&#8217;ll show you how to send commands to control outputs and how to send responses from the bot to the group.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Introducing Telegram<\/h2>\n\n\n\n<p><a href=\"https:\/\/telegram.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Telegram<\/a> Messenger is a cloud-based instant messaging and voice over IP service. You can easily install it in your smartphone (Android and iPhone) or computer (PC, Mac and Linux). It is free and without any ads. Telegram allows you to create bots that you can interact with.<\/p>\n\n\n\n<p>&#8220;<em>Bots are third-party applications that run inside Telegram. Users can interact with bots by sending them messages, commands and&nbsp;inline requests. You control your bots using HTTPS requests to Telegram Bot API<\/em>&#8220;.<\/p>\n\n\n\n<p>The ESP32\/ESP8266 will interact with the Telegram bot to receive and handle the messages, and send responses to the Telegram group. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Install Telegram<\/h3>\n\n\n\n<p>Go to Google Play or App Store, download and install&nbsp;<strong>Telegram<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"354\" height=\"269\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/06\/Install-Telegram.png?resize=354%2C269&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Install and Download Telegram\" class=\"wp-image-97821\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/06\/Install-Telegram.png?w=354&amp;quality=100&amp;strip=all&amp;ssl=1 354w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/06\/Install-Telegram.png?resize=300%2C228&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 354px) 100vw, 354px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Creating a Telegram Bot<\/h2>\n\n\n\n<p>The following steps are easier to follow on your computer. Open a browser, go to the <a href=\"https:\/\/web.telegram.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Telegram Web App<\/a> and login into your account.<\/p>\n\n\n\n<p>If you&#8217;ve followed previous projects and you already have a telegram bot, you can skip this section.<\/p>\n\n\n\n<p>On the top left corner, search for \u201c<strong>botfather<\/strong>\u201d and click the BotFather as shown below.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"665\" height=\"182\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/search-botfather-telegram-web-app.png?resize=665%2C182&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Search for Botfather Telegram Web App\" class=\"wp-image-98816\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/search-botfather-telegram-web-app.png?w=665&amp;quality=100&amp;strip=all&amp;ssl=1 665w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/search-botfather-telegram-web-app.png?resize=300%2C82&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 665px) 100vw, 665px\" \/><\/figure><\/div>\n\n\n\n<p>A new window should open and you\u2019ll be prompted to click the&nbsp;<strong>start<\/strong>&nbsp;button. Type&nbsp;<strong>\/newbot<\/strong>&nbsp;and follow the instructions to create your bot. Give it a name and username.<\/p>\n\n\n\n<p>If your bot is successfully created, you\u2019ll receive a message with a link to access the bot and the&nbsp;<strong>bot token<\/strong>. Save the bot token because you\u2019ll need it so that the ESP32\/ESP8266 can interact with the bot.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"689\" height=\"728\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Telegram-Web-App-Create-bot-botfather.png?resize=689%2C728&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Create a Telegram Bot on Telegram Web App\" class=\"wp-image-98817\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Telegram-Web-App-Create-bot-botfather.png?w=689&amp;quality=100&amp;strip=all&amp;ssl=1 689w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Telegram-Web-App-Create-bot-botfather.png?resize=284%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 284w\" sizes=\"(max-width: 689px) 100vw, 689px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Creating a Telegram Group<\/h2>\n\n\n\n<p>The next step is creating the Telegram group. On the top left corner, click on <strong>New group<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"315\" height=\"274\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Create-a-new-group-web-telegram-app.png?resize=315%2C274&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Create a new group web telegram\" class=\"wp-image-98819\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Create-a-new-group-web-telegram-app.png?w=315&amp;quality=100&amp;strip=all&amp;ssl=1 315w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Create-a-new-group-web-telegram-app.png?resize=300%2C261&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 315px) 100vw, 315px\" \/><\/figure><\/div>\n\n\n\n<p>Add members to your group and give it a name.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"350\" height=\"222\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Name-group-Telegram.png?resize=350%2C222&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Give name to a group Telegram\" class=\"wp-image-98820\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Name-group-Telegram.png?w=350&amp;quality=100&amp;strip=all&amp;ssl=1 350w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Name-group-Telegram.png?resize=300%2C190&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 350px) 100vw, 350px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Add the Bot to the Group<\/h2>\n\n\n\n<p>Once the group is created, click on the group name to add your bot. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"480\" height=\"636\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Add-new-member-group-telegram.png?resize=480%2C636&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-98821\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Add-new-member-group-telegram.png?w=480&amp;quality=100&amp;strip=all&amp;ssl=1 480w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Add-new-member-group-telegram.png?resize=226%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 226w\" sizes=\"(max-width: 480px) 100vw, 480px\" \/><\/figure><\/div>\n\n\n\n<p>Search for your bot name and add it to the group.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"418\" height=\"320\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/Add-bot-to-telegram-group-f.png?resize=418%2C320&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Add bot to telegram group\" class=\"wp-image-99278\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/Add-bot-to-telegram-group-f.png?w=418&amp;quality=100&amp;strip=all&amp;ssl=1 418w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/Add-bot-to-telegram-group-f.png?resize=300%2C230&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 418px) 100vw, 418px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Get the Group ID<\/h2>\n\n\n\n<p>To interact with the Telegram group, the ESP32 needs to know the telegram group ID. In you Telegram account, open your group. The group ID should be on the URL as shown below.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"790\" height=\"283\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Telegram-Group-ID.png?resize=790%2C283&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Get the Telegram group ID\" class=\"wp-image-98823\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Telegram-Group-ID.png?w=790&amp;quality=100&amp;strip=all&amp;ssl=1 790w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Telegram-Group-ID.png?resize=300%2C107&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Telegram-Group-ID.png?resize=768%2C275&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 790px) 100vw, 790px\" \/><\/figure><\/div>\n\n\n\n<p>Save the group ID because you&#8217;ll need it later.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Preparing Arduino IDE<\/h2>\n\n\n\n<p>We\u2019ll program the&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/makeradvisor.com\/tools\/esp32-dev-board-wi-fi-bluetooth\/\" target=\"_blank\">ESP32<\/a> and <a href=\"https:\/\/makeradvisor.com\/tools\/esp8266-esp-12e-nodemcu-wi-fi-development-board\/\" target=\"_blank\" rel=\"noreferrer noopener\">ESP8266<\/a> boards using Arduino IDE, so make sure you have them installed in your Arduino IDE.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/randomnerdtutorials.com\/installing-the-esp32-board-in-arduino-ide-windows-instructions\/\">Installing the ESP32 Board in Arduino IDE (Windows, Mac OS X, Linux)<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/how-to-install-esp8266-board-arduino-ide\/\">Installing ESP8266 Board in Arduino IDE (Windows, Mac OS X, Linux)<\/a><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Universal Telegram Bot Library<\/h3>\n\n\n\n<p>To interact with the Telegram bot, we&#8217;ll use the <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/witnessmenow\/Universal-Arduino-Telegram-Bot\" target=\"_blank\">Universal Telegram Bot Library<\/a> created by Brian Lough that provides an easy interface for the Telegram Bot API.<\/p>\n\n\n\n<p>Follow the next steps to install the latest release of the library.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/witnessmenow\/Universal-Arduino-Telegram-Bot\/archive\/master.zip\" target=\"_blank\">Click here to download the Universal Arduino Telegram Bot library<\/a>.<\/li><li>Go to <strong>Sketch <\/strong>&gt; <strong>Include Library<\/strong> &gt; <strong>Add.ZIP Library..<\/strong>.<\/li><li>Add the library you&#8217;ve just downloaded.<\/li><\/ol>\n\n\n\n<p>And that&#8217;s it. The library is installed.<\/p>\n\n\n\n<p class=\"rntbox rntcorange\"><strong>Important: <\/strong> don&#8217;t install the library through the Arduino Library Manager because it might install a deprecated version.<\/p>\n\n\n\n<p>For all the details about the library, take a look at the Universal Arduino Telegram Bot Library <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/witnessmenow\/Universal-Arduino-Telegram-Bot\" target=\"_blank\">GitHub<\/a> page.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">ArduinoJson Library<\/h3>\n\n\n\n<p>You also have to install the <a href=\"https:\/\/github.com\/bblanchon\" target=\"_blank\" rel=\"noreferrer noopener\">ArduinoJson<\/a> library. Follow the next steps to install the library.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Go to <strong>Skech <\/strong>&gt; <strong>Include Library<\/strong> &gt; <strong>Manage Libraries<\/strong>.<\/li><li>Search for &#8220;ArduinoJson&#8221;.<\/li><li>Install the library.<\/li><\/ol>\n\n\n\n<p>We&#8217;re using ArduinoJson library version 6.15.2.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"786\" height=\"443\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/06\/Install-ArduinoJson-Library.png?resize=786%2C443&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-97837\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/06\/Install-ArduinoJson-Library.png?w=786&amp;quality=100&amp;strip=all&amp;ssl=1 786w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/06\/Install-ArduinoJson-Library.png?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/06\/Install-ArduinoJson-Library.png?resize=768%2C433&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 786px) 100vw, 786px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Parts Required<\/h2>\n\n\n\n<p>For this example you just need one ESP32 or an ESP8266 board.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a rel=\"noreferrer noopener\" href=\"https:\/\/makeradvisor.com\/tools\/esp32-dev-board-wi-fi-bluetooth\/\" target=\"_blank\">ESP32 board<\/a>&nbsp;(read&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/makeradvisor.com\/esp32-development-boards-review-comparison\/\" target=\"_blank\">Best ESP32 dev boards<\/a>)<\/li><li>Alternative \u2013&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/makeradvisor.com\/tools\/esp8266-esp-12e-nodemcu-wi-fi-development-board\/\" target=\"_blank\">ESP8266 board<\/a> (read&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/makeradvisor.com\/tools\/esp32-dev-board-wi-fi-bluetooth\/\" target=\"_blank\">Best ESP8266 dev boards<\/a>)<\/li><\/ul>\n\n\n<p>You can use the preceding links or go directly to <a href=\"https:\/\/makeradvisor.com\/tools\/?utm_source=rnt&utm_medium=post&utm_campaign=post\" target=\"_blank\">MakerAdvisor.com\/tools<\/a> to find all the parts for your projects at the best price!<\/p><p style=\"text-align:center;\"><a href=\"https:\/\/makeradvisor.com\/tools\/?utm_source=rnt&utm_medium=post&utm_campaign=post\" target=\"_blank\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/10\/header-200.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\"><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Control ESP32\/ESP8266 using Telegram Group &#8211; Sketch<\/h2>\n\n\n\n<p>The following code allows you to control your ESP32 or ESP8266 NodeMCU GPIOs by sending messages to a group where your Telegram Bot is a member.<\/p>\n\n\n\n<p>To make this sketch work for you, you need to insert your network credentials (SSID and password), the Telegram Bot Token and your Telegram Group ID.<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/*\n  Rui Santos\n  Complete project details at https:\/\/RandomNerdTutorials.com\/telegram-group-esp32-esp8266\/\n  \n  Project created using Brian Lough's Universal Telegram Bot Library: https:\/\/github.com\/witnessmenow\/Universal-Arduino-Telegram-Bot\n*\/\n\n#ifdef ESP32\n  #include &lt;WiFi.h&gt;\n#else\n  #include &lt;ESP8266WiFi.h&gt;\n#endif\n#include &lt;WiFiClientSecure.h&gt;\n#include &lt;UniversalTelegramBot.h&gt;   \/\/ Universal Telegram Bot Library written by Brian Lough: https:\/\/github.com\/witnessmenow\/Universal-Arduino-Telegram-Bot\n#include &lt;ArduinoJson.h&gt;\n\n\/\/ Replace with your network credentials\nconst char* ssid = &quot;REPLACE_WITH_YOUR_SSID&quot;;\nconst char* password = &quot;REPLACE_WITH_YOUR_PASSWORD&quot;;\n\n\/\/ Initialize Telegram BOT\n#define BOTtoken &quot;XXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&quot;  \/\/ your Bot Token (Get from Botfather)\n\n\/\/ Use @myidbot to find out the chat ID of an individual or a group\n\/\/ Also note that you need to click &quot;start&quot; on a bot before it can\n\/\/ message you\n#define CHAT_ID &quot;-XXXXXXXXXX&quot;\n\n#ifdef ESP8266\n  X509List cert(TELEGRAM_CERTIFICATE_ROOT);\n#endif\n\nWiFiClientSecure client;\nUniversalTelegramBot bot(BOTtoken, client);\n\n\/\/ Checks for new messages every 1 second.\nint botRequestDelay = 1000;\nunsigned long lastTimeBotRan;\n\nconst int ledPin = 2;\nbool ledState = LOW;\n\n\/\/ Handle what happens when you receive new messages\nvoid handleNewMessages(int numNewMessages) {\n  Serial.println(&quot;handleNewMessages&quot;);\n  Serial.println(String(numNewMessages));\n\n  for (int i=0; i&lt;numNewMessages; i++) {\n    \/\/ Chat id of the requester\n    String chat_id = String(bot.messages[i].chat_id);\n    if (chat_id != CHAT_ID){\n      bot.sendMessage(chat_id, &quot;Unauthorized user&quot;, &quot;&quot;);\n      continue;\n    }\n    \n    \/\/ Print the received message\n    String text = bot.messages[i].text;\n    Serial.println(text);\n\n    String from_name = bot.messages[i].from_name;\n\n    if (text == &quot;\/led_on&quot;) {\n      bot.sendMessage(chat_id, &quot;LED state set to ON&quot;, &quot;&quot;);\n      ledState = HIGH;\n      digitalWrite(ledPin, ledState);\n    }\n    \n    if (text == &quot;\/led_off&quot;) {\n      bot.sendMessage(chat_id, &quot;LED state set to OFF&quot;, &quot;&quot;);\n      ledState = LOW;\n      digitalWrite(ledPin, ledState);\n    }\n    \n    if (text == &quot;\/state&quot;) {\n      if (digitalRead(ledPin)){\n        bot.sendMessage(chat_id, &quot;LED is ON&quot;, &quot;&quot;);\n      }\n      else{\n        bot.sendMessage(chat_id, &quot;LED is OFF&quot;, &quot;&quot;);\n      }\n    }\n  }\n}\n\nvoid setup() {\n  Serial.begin(115200);\n\n  #ifdef ESP8266\n    configTime(0, 0, &quot;pool.ntp.org&quot;);      \/\/ get UTC time via NTP\n    client.setTrustAnchors(&amp;cert); \/\/ Add root certificate for api.telegram.org\n  #endif\n\n  pinMode(ledPin, OUTPUT);\n  digitalWrite(ledPin, ledState);\n  \n  \/\/ Connect to Wi-Fi\n  WiFi.mode(WIFI_STA);\n  WiFi.begin(ssid, password);\n  #ifdef ESP32\n    client.setCACert(TELEGRAM_CERTIFICATE_ROOT); \/\/ Add root certificate for api.telegram.org\n  #endif\n  while (WiFi.status() != WL_CONNECTED) {\n    delay(1000);\n    Serial.println(&quot;Connecting to WiFi..&quot;);\n  }\n  \/\/ Print ESP32 Local IP Address\n  Serial.println(WiFi.localIP());\n\n  bot.sendMessage(CHAT_ID, &quot;Bot Started&quot;, &quot;&quot;);\n}\n\nvoid loop() {\n  if (millis() &gt; lastTimeBotRan + botRequestDelay) {\n    int numNewMessages = bot.getUpdates(bot.last_message_received + 1);\n\n    while(numNewMessages) {\n      Serial.println(&quot;got response&quot;);\n      handleNewMessages(numNewMessages);\n      numNewMessages = bot.getUpdates(bot.last_message_received + 1);\n    }\n    lastTimeBotRan = millis();\n  }\n}\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/ESP\/ESP_Telegram\/ESP_Telegram_Group.ino\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<p>The code is compatible with ESP32 and ESP8266 NodeMCU boards (it\u2019s based on the Universal Arduino Telegram Bot library&nbsp;<a href=\"https:\/\/github.com\/witnessmenow\/Universal-Arduino-Telegram-Bot\/blob\/master\/examples\/ESP8266\/FlashLED\/FlashLED.ino\" target=\"_blank\" rel=\"noreferrer noopener\">example<\/a>). The code will load the right libraries accordingly to the selected board.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How the Code Works<\/h2>\n\n\n\n<p>Start by importing the required libraries.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>#ifdef ESP32\n  #include &lt;WiFi.h>\n#else\n  #include &lt;ESP8266WiFi.h>\n#endif\n#include &lt;WiFiClientSecure.h>\n#include &lt;UniversalTelegramBot.h>\n#include &lt;ArduinoJson.h><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Network Credentials<\/h3>\n\n\n\n<p>Insert your network credentials in the following variables.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>const char* ssid = \"REPLACE_WITH_YOUR_SSID\";\nconst char* password = \"REPLACE_WITH_YOUR_PASSWORD\";<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Telegram Bot Token<\/h3>\n\n\n\n<p>Insert your Telegram Bot token you&#8217;ve got from Botfather on the <span class=\"rnthl rntliteral\">BOTtoken<\/span> variable.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>#define BOTtoken \"XXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\"  \/\/ your Bot Token (Get from Botfather)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Telegram Group ID<\/h3>\n\n\n\n<p>Insert your Telegram group ID. It should start with a &#8220;-&#8221; signal.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>#define CHAT_ID \"-XXXXXXXXXX\"<\/code><\/pre>\n\n\n\n<p>Create a new WiFi client with <span class=\"rnthl rntliteral\">WiFiClientSecure<\/span>.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>WiFiClientSecure client;<\/code><\/pre>\n\n\n\n<p>Create a <span class=\"rnthl rntliteral\">bot<\/span> with the token and client defined earlier.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>UniversalTelegramBot bot(BOTtoken, client);<\/code><\/pre>\n\n\n\n<p>The <span class=\"rnthl rntliteral\">botRequestDelay<\/span> and <span class=\"rnthl rntliteral\">lastTimeBotRan<\/span> are used to check for new Telegram messages every x number of seconds. In this case, the code will check for new messages every second (1000 milliseconds). You can change that delay time in the <span class=\"rnthl rntliteral\">botRequestDelay<\/span> variable. <\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>int botRequestDelay = 1000;\nunsigned long lastTimeBotRan;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Define Output<\/h3>\n\n\n\n<p>Set the GPIO you want to control. In our case, we&#8217;ll control GPIO 2 (built-in LED) and its state is <span class=\"rnthl rntliteral\">LOW<\/span> by default.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>const int ledPin = 2;\nbool ledState = LOW;<\/code><\/pre>\n\n\n\n<p class=\"rntbox rntclblue\"><strong>Note: <\/strong> if you&#8217;re using an ESP8266, the built-in LED works with inverted logic. So, you should send a <span class=\"rnthl rntliteral\">LOW<\/span> signal to turn the LED on and a <span class=\"rnthl rntliteral\">HIGH<\/span> signal to turn it off.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">handleNewMessages()<\/h3>\n\n\n\n<p>The <span class=\"rnthl rntliteral\">handleNewMessages()<\/span> function handles what happens when new messages arrive.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>void handleNewMessages(int numNewMessages) {\n  Serial.println(\"handleNewMessages\");\n  Serial.println(String(numNewMessages));<\/code><\/pre>\n\n\n\n<p>It checks the available messages:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>for (int i=0; i&lt;numNewMessages; i++) {<\/code><\/pre>\n\n\n\n<p>Get the chat ID for that particular message and store it in the <span class=\"rnthl rntliteral\">chat_id<\/span> variable. The chat ID allows us to identify who sent the message. <\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>String chat_id = String(bot.messages&#091;i].chat_id);<\/code><\/pre>\n\n\n\n<p>If the <span class=\"rnthl rntliteral\">chat_id<\/span> is different from your chat group ID (<span class=\"rnthl rntliteral\">CHAT_ID<\/span>), it means that someone (that is not in the group) has sent a message to your bot. If that&#8217;s the case, ignore the message and wait for the next message.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>if (chat_id != CHAT_ID) {\n  bot.sendMessage(chat_id, \"Unauthorized user\", \"\");\n  continue;\n}<\/code><\/pre>\n\n\n\n<p>Otherwise, it means that the message was sent from someone in your group, so we&#8217;ll save it in the <span class=\"rnthl rntliteral\">text<\/span> variable and check its content.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>String text = bot.messages&#091;i].text;\nSerial.println(text);<\/code><\/pre>\n\n\n\n<p>The <span class=\"rnthl rntliteral\">from_name<\/span> variable saves the name of the sender.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>String from_name = bot.messages&#091;i].from_name;<\/code><\/pre>\n\n\n\n<p>If it receives the<strong> \/led_on<\/strong> message, turn the LED on and send a message confirming we&#8217;ve received the message. Also, update the <span class=\"rnthl rntliteral\">ledState<\/span> variable with the new state.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>if (text == \"\/led_on\") {\n  bot.sendMessage(chat_id, \"LED state set to ON\", \"\");\n  ledState = HIGH;\n  digitalWrite(ledPin, ledState);\n}<\/code><\/pre>\n\n\n\n<p>Sending a message to the bot is very simply. You just need to use the <span class=\"rnthl rntliteral\">sendMessage()<\/span> method on the <span class=\"rnthl rntliteral\">bot<\/span> object and pass as arguments the recipient&#8217;s chat ID, the message, and the parse mode.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>bool sendMessage(String chat_id, String text, String parse_mode = \"\")<\/code><\/pre>\n\n\n\n<p>Do something similar for the <strong>\/led_off<\/strong> message.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>if (text == \"\/led_off\") {\n  bot.sendMessage(chat_id, \"LED state set to OFF\", \"\");\n  ledState = LOW;\n  digitalWrite(ledPin, ledState);\n}<\/code><\/pre>\n\n\n\n<p class=\"rntbox rntclblue\"><strong>Note: <\/strong> if you&#8217;re using an ESP8266, the built-in LED works with inverted logic. So, you should send a <span class=\"rnthl rntliteral\">LOW<\/span> signal to turn the LED on and a <span class=\"rnthl rntliteral\">HIGH<\/span> signal to turn it off.<\/p>\n\n\n\n<p>Finally, if the received message is <strong>\/state,<\/strong> check the current GPIO state and send a message accordingly.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>if (text == \"\/state\") {\n  if (digitalRead(ledPin)){\n    bot.sendMessage(chat_id, \"LED is ON\", \"\");\n  }\n  else{\n    bot.sendMessage(chat_id, \"LED is OFF\", \"\");\n  }\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">setup()<\/h3>\n\n\n\n<p>In the <span class=\"rnthl rntliteral\">setup()<\/span>, initialize the Serial Monitor.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>Serial.begin(115200);<\/code><\/pre>\n\n\n\n<p>If you&#8217;re using the ESP8266, you need to use the following line:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>#ifdef ESP8266\n  client.setInsecure();\n#endif<\/code><\/pre>\n\n\n\n<p>In the library examples for the ESP8266 they say: &#8220;<em>This is the simplest way of getting this working. If you are passing sensitive information, or controlling something important, please either use certStore or at least client.setFingerPrint<\/em>&#8220;.<\/p>\n\n\n\n<p>Set the LED as an output and set it to LOW when the ESP first starts:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>pinMode(ledPin, OUTPUT);\ndigitalWrite(ledPin, ledState);<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Init Wi-Fi<\/h4>\n\n\n\n<p>Initialize Wi-Fi and connect the ESP to your local network with the SSID and password defined earlier.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>WiFi.mode(WIFI_STA);\nWiFi.begin(ssid, password);\nwhile (WiFi.status() != WL_CONNECTED) {\n  delay(1000);\n  Serial.println(\"Connecting to WiFi..\");\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">loop()<\/h3>\n\n\n\n<p>In the <span class=\"rnthl rntliteral\">loop()<\/span>, check for new messages every second.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>void loop() {\n  if (millis() > lastTimeBotRan + botRequestDelay)  {\n    int numNewMessages = bot.getUpdates(bot.last_message_received + 1);\n\n    while(numNewMessages) {\n      Serial.println(\"got response\");\n      handleNewMessages(numNewMessages);\n      numNewMessages = bot.getUpdates(bot.last_message_received + 1);\n    }\n    lastTimeBotRan = millis();\n  }\n}<\/code><\/pre>\n\n\n\n<p>When a new message arrives, call the <span class=\"rnthl rntliteral\">handleNewMessages()<\/span> function.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>while(numNewMessages) {\n  Serial.println(\"got response\");\n  handleNewMessages(numNewMessages);\n  numNewMessages = bot.getUpdates(bot.last_message_received + 1);\n}<\/code><\/pre>\n\n\n\n<p>That&#8217;s pretty much how the code works.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"demonstration\">Demonstration<\/h2>\n\n\n\n<p>Upload the code to your ESP32 or ESP8266 board. Don&#8217;t forget to go to <strong>Tools <\/strong>&gt; <strong>Board <\/strong>and select the board you&#8217;re using. Go to <strong>Tools <\/strong>&gt; <strong>Port <\/strong>and select the COM port your board is connected to.<\/p>\n\n\n\n<p>After uploading the code, press the ESP32\/ESP8266 on-board EN\/RST button so that it starts running the code. Then, you can open the Serial Monitor to check what&#8217;s happening in the background.<\/p>\n\n\n\n<p>Go to your Telegram account and open the group.<\/p>\n\n\n\n<p> Send the following commands and see the bot responding:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong style=\"font-size: inherit; background-color: initial;\">\/led_on<\/strong><span style=\"font-size: inherit; background-color: initial;\"> turns the LED on.<\/span><\/li><li><strong>\/led_off<\/strong> turns the LED off.<\/li><li><strong>\/state<\/strong> requests the current LED state.<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"353\" height=\"708\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Control-ESP32-ESP8266-Telegram-Group.png?resize=353%2C708&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Control ESP32 ESP8266 using Telegram Group Demonstration\" class=\"wp-image-98827\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Control-ESP32-ESP8266-Telegram-Group.png?w=353&amp;quality=100&amp;strip=all&amp;ssl=1 353w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/08\/Control-ESP32-ESP8266-Telegram-Group.png?resize=150%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 150w\" sizes=\"(max-width: 353px) 100vw, 353px\" \/><\/figure><\/div>\n\n\n\n<p>The on-board LED should turn on and turn off accordingly (the ESP8266 on-board LED works in reverse, it&#8217;s off when you send <strong>\/led_on<\/strong> and on when you send<strong> \/led_off<\/strong>).<\/p>\n\n\n\n<p>When you add your telegram bot to a group, everyone in the group can interact with the bot and receive messages from the bot. For example, in this case we can both (Sara and Rui) control the bot and see the commands that the other is sending. Additionally, in a project with notifications, we&#8217;d both be notified on the group. <\/p>\n\n\n\n<p>You can add more people to the group, for example all family members.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"422\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/04\/ESP32-board-Built_in-LED-turned-on-HIGH.jpg?resize=750%2C422&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32 board Built in LED turned on HIGH\" class=\"wp-image-96167\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/04\/ESP32-board-Built_in-LED-turned-on-HIGH.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/04\/ESP32-board-Built_in-LED-turned-on-HIGH.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n\n<p>On the Serial Monitor you should see that the ESP is receiving the messages.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"669\" height=\"435\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/06\/Control-ESP32-ESP8266-Outputs-Telegram-1.png?resize=669%2C435&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Control ESP32 ESP8266 Outputs Telegram Serial Monitor Demonstration\" class=\"wp-image-97843\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/06\/Control-ESP32-ESP8266-Outputs-Telegram-1.png?w=669&amp;quality=100&amp;strip=all&amp;ssl=1 669w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/06\/Control-ESP32-ESP8266-Outputs-Telegram-1.png?resize=300%2C195&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 669px) 100vw, 669px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>In this tutorial you&#8217;ve learned how to get and send messages to the ESP32 or ESP8266 using a Telegram group. Using a Telegram group to control your ESP32 might be advantageous over a single chat, if you want to have several people able to control and monitor the same board. <\/p>\n\n\n\n<p>We&#8217;ve shown you a simple example on how to control an output. The idea is to modify the project to add more commands to execute other tasks. For example, you can <a href=\"https:\/\/randomnerdtutorials.com\/telegram-request-esp32-esp8266-nodemcu-sensor-readings\/\">request sensor readings<\/a> or <a href=\"https:\/\/randomnerdtutorials.com\/telegram-esp32-motion-detection-arduino\/\">send a telegram message when motion is detected<\/a>.<\/p>\n\n\n\n<p>The great thing about using Telegram to control your ESP boards, is that as long as you have an internet connection (and your boards too), you can control and monitor them from anywhere in the world.<\/p>\n\n\n\n<p>We hope you&#8217;ve found this project interesting. <\/p>\n\n\n\n<p>Learn more about the ESP32 and ESP8266 with our resources:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/randomnerdtutorials.com\/learn-esp32-with-arduino-ide\/\">Learn ESP32 with Arduino IDE (eBook + Video Course)<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/home-automation-using-esp8266\/\">Home Automation using ESP8266<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/projects-esp32\/\">More ESP32 projects and tutorials&#8230;<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/projects-esp8266\/\">More ESP8266 projects and tutorials&#8230;<\/a><\/li><\/ul>\n\n\n\n<p>Thanks for reading.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to control your ESP32 or ESP8266 boards through a Telegram group. Using a Telegram group to control your boards may be useful if you want to &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Telegram Group: Control ESP32\/ESP8266 Outputs (Arduino IDE)\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/telegram-group-esp32-esp8266\/#more-98814\" aria-label=\"Read more about Telegram Group: Control ESP32\/ESP8266 Outputs (Arduino IDE)\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":5,"featured_media":99247,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[281,276,277,299,264],"tags":[],"class_list":["post-98814","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-esp32-project","category-esp32","category-esp32-arduino-ide","category-0-esp32","category-project"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/ESP_Telegram_output_Group.jpg?fit=1280%2C720&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/98814","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=98814"}],"version-history":[{"count":0,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/98814\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/99247"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=98814"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=98814"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=98814"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}