'The connection between my arduino board and my telegram channel is not working

Im trying to connect a ldr sensor to telegram bot, so that i know if the lights are tripping or not, but it seems like the tripped messages aren't going through. I tried to restart the chip, but it keeps showing "testconnection NOK"Can someone help me to see if there are anyways to troubleshoot this issue? Below is the code used for my arduino.

#include <WiFiClient.h> //CLIENT LIBRARY  
#include <ESP8266WebServer.h> //WEBSERVICER LIBRARY
#include <ESP8266HTTPClient.h> //HTTP CLIENT LIBRARY
#include "CTBot.h" //TELEGRAM BOT LIBRARY

CTBot myBot; //INITIALIZE TELEGRAM BOT VARIABLE

String ssid  = "CGA-Farm"    ; // ASSIGN SSID VARIABLE WITH WIFI SSID 
String pass  = "0003606367"; // ASSIGN PASS VARIABLE WITH WIFI PASSWORD
String token = "1715253121:AAHqI4O2mt11ono-wFQ-_p5UfVpu0OeekeY"; // TELEGRAM BOT TOKEN RETRIEVED FROM BOTFATHER
int CNT = 0;

void setup() {
  Serial.begin(9600);
  Serial.println("Starting TelegramBot..."); 
  myBot.wifiConnect(ssid, pass); // CONNECT ESP TO ACCESS POINT
  myBot.setTelegramToken(token); // SET TELEGRAM BOT TOKEN
  
    if (myBot.testConnection())// DEBUG CONNECTION
    Serial.println("\ntestConnection OK");
    else
    Serial.println("\ntestConnection NOK");
}

void loop() {
  
  float reading = analogRead(A0);
  Serial.println(reading);
  
  delay(1000);
  if (reading < 800)
  {
    if (CNT < 1) 
    {
      Serial.println("No light!");
      myBot.sendMessage(-1001412490907,"GR1 Zone1 tripped!");
      CNT = CNT + 1;
    }
  } else
  {
    CNT = 0;
  }
}


Solution 1:[1]

Maybe your error is in the Serial.begin(9600) because the baud rate of the Arduino is not compatible with the Telegram bot. Try to change the value 9600 with this number :

115200

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Max Scoch