Answer the question
In order to leave comments, you need to log in
Problem with ESP8266 (ESP-12F)?
I am trying to flash an ESP8266 (ESP-12F) module. Here is the code
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <UniversalTelegramBot.h>
char ssid[] = "***";
char password[] = "***";
#define BOTtoken "***"
WiFiClientSecure client;
UniversalTelegramBot bot(BOTtoken, client);
String keyboardJson = "";
void setup() {
Serial.begin(9600);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
}
}
void loop() {
int numNewMessages = bot.getUpdates(
bot.last_message_received + 1);
handleNewMessages(numNewMessages);
}
void handleNewMessages(int numNewMessages) {
for (int i = 0; i < numNewMessages; i++) {
String chat_id = String(bot.messages[i].chat_id);
String text = bot.messages[i].text;
if (text == "/ledon") {
Serial.println("turnOn");
bot.sendMessage(chat_id, "Relay is ON", "");
}
if (text == "/ledoff") {
Serial.println("turnOff");
bot.sendMessage(chat_id, "Relay is OFF", "");
}
if (text == "/start") {
bot.sendMessageWithReplyKeyboard(chat_id,
"Choose from one of the following options",
"", keyboardJson, true);
}
}
}
Serial port COM8
Connecting........_____....._____....._____....._____....._____....._____.....____Traceback (most recent call last):
File "C:\Users\79857\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4/tools/upload.py", line 65, in <module>
esptool.main(cmdline)
File "C:/Users/79857/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool\esptool.py", line 2890, in main
esp.connect(args.before)
File "C:/Users/79857/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool\esptool.py", line 483, in connect
raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error))
esptool.FatalError: Failed to connect to ESP8266: Invalid head of packet (0x00)
_
выбранный последовательный порт _
не существует или плата не подключена к нему
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question