• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP32 Cloud MQTT Broker (TTGO T-Call ESP32 SIM800L) mysql

Q&A Forum › Category: ESP32 › ESP32 Cloud MQTT Broker (TTGO T-Call ESP32 SIM800L) mysql
0 Vote Up Vote Down
NUR AZLIN AIRUL AZLIN MOHAMED ZOHDI asked 4 years ago

Has anyone worked on the LilyGo SIM800L with Telegram group?  I managed to set the module to send message to the telegram grp, but unable to read for messages.

Question Tags: sim800L telegram
2 Answers
0 Vote Up Vote Down
NUR AZLIN AIRUL AZLIN MOHAMED ZOHDI answered 4 years ago

Dear all,
Just to update – I have managed to setup the LilyGo T-Call SIM800 ESP32 module to run Telegram Bot over 2G.
Hope this will benefit whoever is looking for a solution.
FYI..
//include files required
#include <TinyGsmClient.h>
#include <TinyGsmClientSIM800.h>
#include <ArduinoHttpClient.h>
#include “SSLClient.h”
#include <UniversalTelegramBot.h>
#include <ArduinoJson.h>
TinyGsmClient client(modem);
SSLClient telegramSSL(&client);
HttpClient bot_telegram = HttpClient(telegramSSL, hostname3, port0); // secure
UniversalTelegramBot bot(BOTtoken, bot_telegram); //secure
void setup()
telegramSSL.setCACert(TELEGRAM_CERTIFICATE_ROOT); // api.telegram.org
 
//setup telegram
bot.sendMessage(CHAT_ID, “Bot Started”, “”);
delay(3000);
bot_telegram.stop();
void loop() //put function inside loop if required
{
if (millis() > lastTimeBotRan + botRequestDelay) {
int numNewMessages = bot.getUpdates(bot.last_message_received + 1);
Serial.println(“New telegram message = ” +String(numNewMessages));
while(numNewMessages) {
Serial.println(“got response”);
handleNewMessages(numNewMessages);
numNewMessages = bot.getUpdates(bot.last_message_received + 1);
}
lastTimeBotRan = millis();
esp_task_wdt_reset(); // hardware watchdog to reset incase module hangs
bot_telegram.stop(); // close client after every check else server return with “chat not found”
delay(60000); // long delay – else esp32 keep on crashing
}

0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi.
I’m glad you got it working.
Thanks for sharing it.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.