Comments on: Telegram: Request ESP32/ESP8266 Sensor Readings (Arduino IDE) https://randomnerdtutorials.com/telegram-request-esp32-esp8266-nodemcu-sensor-readings/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Mon, 08 Apr 2024 12:34:56 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: riwa https://randomnerdtutorials.com/telegram-request-esp32-esp8266-nodemcu-sensor-readings/#comment-904516 Mon, 08 Apr 2024 12:34:56 +0000 https://randomnerdtutorials.com/?p=97860#comment-904516 hello!thanks for the tutorial.i would like to know why is telegram displaying the temperature message twice after i send one “/readings” message.

]]>
By: Uli https://randomnerdtutorials.com/telegram-request-esp32-esp8266-nodemcu-sensor-readings/#comment-882764 Mon, 08 Jan 2024 17:35:22 +0000 https://randomnerdtutorials.com/?p=97860#comment-882764 Hi Sara,
this beautyful program does not work since ArduinoJson was updated to V.7.0.0. Restoring the last v.6.x.x solves the problem.

]]>
By: Slva https://randomnerdtutorials.com/telegram-request-esp32-esp8266-nodemcu-sensor-readings/#comment-882583 Sun, 07 Jan 2024 19:27:11 +0000 https://randomnerdtutorials.com/?p=97860#comment-882583 In reply to Sara Santos.

Thank you very much, everything works!

]]>
By: Sara Santos https://randomnerdtutorials.com/telegram-request-esp32-esp8266-nodemcu-sensor-readings/#comment-882497 Sun, 07 Jan 2024 11:35:08 +0000 https://randomnerdtutorials.com/?p=97860#comment-882497 In reply to Slva.

Hi.
You just need to add a new timer to your code

const unsigned long messageInterval = 180000; //This is half an hour
unsigned long lastMessageTime = 0;

Then, add something like this to the loop() – i haven’t tested it, but the logic is this:

void loop() {
unsigned long currentTime = millis();

if (currentTime – lastMessageTime >= messageInterval) {
String readings = getReadings();
bot.sendMessage(CHAT_ID, readings, “”);
lastMessageTime = currentTime;
}

I hope this helps.
Regards,
Sara

]]>
By: Slva https://randomnerdtutorials.com/telegram-request-esp32-esp8266-nodemcu-sensor-readings/#comment-882474 Sun, 07 Jan 2024 08:24:26 +0000 https://randomnerdtutorials.com/?p=97860#comment-882474 Hello. Tell me, please, is there any command that allows you to take readings from the sensor every half hour and the bot sends messages?

]]>
By: Sara Santos https://randomnerdtutorials.com/telegram-request-esp32-esp8266-nodemcu-sensor-readings/#comment-871562 Sun, 12 Nov 2023 04:00:16 +0000 https://randomnerdtutorials.com/?p=97860#comment-871562 In reply to Bruno.

Hi.
If nothing happens, it may probably be related to the chat ID or the API Token.
Additionally, make sure you’re sending the telegram messages to the right BOT.
Regards,
Sara

]]>
By: Bruno https://randomnerdtutorials.com/telegram-request-esp32-esp8266-nodemcu-sensor-readings/#comment-871106 Thu, 09 Nov 2023 21:59:42 +0000 https://randomnerdtutorials.com/?p=97860#comment-871106 Hi Sara,
I followed in a meticulous way your clear instructions and I copied your code but when I run the code it just stops after printing in the serial monitor
Connecting to WiFi.. and the IP address
and when I access Telegram after /start and/readings nothing happens
I verified several times both the CHAT_ID and the API_TOKEN but they are correct
Could you help me ? Thanks
Bruno

]]>
By: Giuseppe Vicari https://randomnerdtutorials.com/telegram-request-esp32-esp8266-nodemcu-sensor-readings/#comment-842296 Thu, 22 Jun 2023 16:04:31 +0000 https://randomnerdtutorials.com/?p=97860#comment-842296 Good morning Sara,
I have a doubt about reading the temperature via telegram with ESP32 and DHT22.
How can I configure the reading with only one decimal digit?
With the print on the led display it’s easy but with telegram I didn’t succeed.
Thank you
giuseppe

]]>
By: Sara Santos https://randomnerdtutorials.com/telegram-request-esp32-esp8266-nodemcu-sensor-readings/#comment-834742 Sun, 14 May 2023 20:45:54 +0000 https://randomnerdtutorials.com/?p=97860#comment-834742 In reply to Alex.

Hi.
Try using the AsyncTelegram library: https://github.com/cotestatnt/AsyncTelegram
Regards,
Sara

]]>
By: Alex https://randomnerdtutorials.com/telegram-request-esp32-esp8266-nodemcu-sensor-readings/#comment-834693 Sun, 14 May 2023 10:21:53 +0000 https://randomnerdtutorials.com/?p=97860#comment-834693 In reply to Pedro Martin.

+1 same problem

]]>