Exit Status 1 (ESP8266)

I have the code to turn off and on the relay light via Telegram and the error "Exit Status 1" appears. This is the code:

#include <CTBot.h>
#include <ArduinoJson.h>
#include <ESP8266WiFi.h>

CTBot myBot;

const char* wifiSsid = "wifi-ahsan";
const char* wifiPassword = "anyarlali";

String token = "censored"; 
const int id = censored

int Relay1 = 5;
int Relay2 = 4;

void setup() {
  Serial.begin(115200);
  delay(10);

  // Koneksi ke jaringan Wi-Fi
  WiFi.begin(wifiSsid, wifiPassword);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.println("Menghubungkan ke WiFi...");
  }
  Serial.println("Tersambung ke Wi-Fi");

  // Inisialisasi bot Telegram
  myBot.wifiConnect(wifiSsid, wifiPassword);
  myBot.setTelegramToken(token);

  if (myBot.testConnection()) {
    Serial.println("testConnection OK");
  } else {
    Serial.println("testConnection NOK");
  }

  // Inisialisasi pin relay
  pinMode(Relay1, OUTPUT);
  digitalWrite(Relay1, HIGH);
  pinMode(Relay2, OUTPUT);
  digitalWrite(Relay2, HIGH);
}

void loop() {
  TBMessage msg;

  if (myBot.getNewMessage(msg)) {
    if (msg.text.equalsIgnoreCase("Mulai bot")) {
      myBot.sendMessage(msg.sender.id, "Silahkan Mulai");
      delay(500);
    }
    if (msg.text.equalsIgnoreCase("Relay1 ON")) {
      digitalWrite(Relay1, LOW);
      myBot.sendMessage(msg.sender.id, "Lampu 1 Menyala");
    } else if (msg.text.equalsIgnoreCase("Relay1 OFF")) {
      digitalWrite(Relay1, HIGH);
      myBot.sendMessage(msg.sender.id, "Lampu 1 Padam");
      delay(500);
    }
    if (msg.text.equalsIgnoreCase("Relay2 ON")) {
      digitalWrite(Relay2, LOW);
      myBot.sendMessage(msg.sender.id, "Lampu 2 Menyala");
    } else if (msg.text.equalsIgnoreCase("Relay2 OFF")) {
      digitalWrite(Relay2, HIGH);
      myBot.sendMessage(msg.sender.id, "Lampu 2 Padam");
      delay(500);
    }
    if (msg.text.equalsIgnoreCase("All Relay ON")) {
      digitalWrite(Relay1, LOW);
      digitalWrite(Relay2, LOW);
      myBot.sendMessage(msg.sender.id, "Semua Lampu Menyala");
      delay(500);
    }
    if (msg.text.equalsIgnoreCase("All Relay OFF")) {
      digitalWrite(Relay1, HIGH);
      digitalWrite(Relay2, HIGH);
      myBot.sendMessage(msg.sender.id, "Semua Lampu Padam");
      delay(500);
    }
  }
}

and the error was

Any idea how to fix that, guys?

To see detailed compilation error message you need to switch on the options in the File-Preferences menu of Arduino IDE:

After that start the compilation again and copy the output to the forum as text, using code tags.

Do not include the screenshots - it mostly useless.

In this line you defined a variable named "id" containing the value of another variable named "censored", which was not previously defined,
and also when defining a precise variable, end the definition with ";".

Test your code with this modification.

#include <CTBot.h>
#include <ArduinoJson.h>
#include <ESP8266WiFi.h>

CTBot myBot;
int censored = 0;
const char* wifiSsid = "wifi-ahsan";
const char* wifiPassword = "anyarlali";

String token = "censored"; 
const int id = censored;
.......................................

See what is circled in red; there should be more info above what you showed.

You can right-click in the output window and select copy all. Next you can paste it here in a reply; please use code tags (as you did for your code in the opening post).

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.