Выполнил замену.
Copy and relpace «twi.h», «core_esp8266_si2c.c» in folder %USERPROFILE%AppDataLocalArduino15packagesesp8266hardwareesp82662.3.0coresesp8266
Copy and replace «Wire.h», «Wire.cpp» in folder %USERPROFILE%AppDataLocalArduino15packagesesp8266hardwareesp82662.3.0librariesWire
Пытаюсь подключить SI7021 к ESP01 на пины 0,2. Беру Ваш пример из библиотеки HTU21D-master SI7021_DEMO при компиляции выдает ошибку.
C:UsersHOMEAppDataLocalArduino15packagesesp8266hardwareesp82662.3.0coresesp8266_core_esp8266_si2c.c:157:15: error: conflicting types for ‘twi_writeTo’
unsigned char twi_writeTo(unsigned char address, unsigned char * buf, unsigned int len, unsigned char sendStop){
^
In file included from C:UsersHOMEAppDataLocalArduino15packagesesp8266hardwareesp82662.3.0coresesp8266_core_esp8266_si2c.c:21:0:
C:UsersHOMEAppDataLocalArduino15packagesesp8266hardwareesp82662.3.0coresesp8266twi.h:66:9: note: previous declaration of ‘twi_writeTo’ was here
uint8_t twi_writeTo(uint8_t address, uint8_t *buffer, uint8_t length, bool sendStop);
^
C:UsersHOMEAppDataLocalArduino15packagesesp8266hardwareesp82662.3.0coresesp8266_core_esp8266_si2c.c:181:15: error: conflicting types for ‘twi_readFrom’
unsigned char twi_readFrom(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop){
^
In file included from C:UsersHOMEAppDataLocalArduino15packagesesp8266hardwareesp82662.3.0coresesp8266_core_esp8266_si2c.c:21:0:
C:UsersHOMEAppDataLocalArduino15packagesesp8266hardwareesp82662.3.0coresesp8266twi.h:67:9: note: previous declaration of ‘twi_readFrom’ was here
uint8_t twi_readFrom(uint8_t address, uint8_t *buffer, uint8_t length, bool sendStop);
^
Используем библиотеку Wire версии 1.0 из папки: C:UsersHOMEAppDataLocalArduino15packagesesp8266hardwareesp82662.3.0librariesWire
Используем библиотеку HTU21D-master версии 1.1.0 из папки: D:ArduinolibrarieslibrariesHTU21D-master
exit status 1
Ошибка компиляции для платы Generic ESP8266 Module.
Страница 1 из 2
-
Недавно купила новый для себя модуль ESP8266
Загрузила одну программу Blink из примеров Arduino IDE
После этого ничего не компилирует
Помогите, пожалуйста, решить эту проблему -
Что значит
выкладывайте ошибки, код.
Не забывайте про тэги, для удобного чтения. -
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <UniversalTelegramBot.h>
//объявляю библиотекиchar ssid[] = «***»; //мой wifi
char password[] = «***»; //пароль#define BOTtoken «***» //токен бота
WiFiClientSecure client;
UniversalTelegramBot bot(BOTtoken, client); //переменная для шифрованного соединенияString keyboardJson = «[[«/help«]]»; //клавиатура бота
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.chat_id); //проверяем каждое сообщение и запоминаем id
String text = bot.messages.text; //записываем в переменную текст сообщения
if(text == «/help») {
bot.sendMessageWithReplyKeyboard(chat_id,
«Choose from one of the following options»,
«», keyboardJson, true);
}
if(text == «/help») {
bot.sendMessageWithReplyKeyboard(chat_id,
«Choose from one of the following options»,
«», keyboardJson, true);
}//если приходит сообщение с этим текстом, отвечаем …
}
}Последнее редактирование: 30 янв 2019
-
(у меня теперь скриншоты с телефона не загружаются) -
Онжела!Вставь Его правильно!В нужное место!
Последнее редактирование: 30 янв 2019
-
Добавь строку #include <ArduinoJson.h>
-
Добавила, с ней тоже ничего не работает(
-
@Angelina Dementeva, скетч не компилируется или не работает? Telegram блокируется, попробуйте проверить его доступность
-
К сожалению, именно не компилируется
Можете объяснить что это значит?
-
Если не компилируется — копируете вывод компилятора об ошибках и вставляете его в сообщение на форуме (длинный вывод компилятора прячете под спойлер ). ping — утилита для проверки соединения, запускается из командной строки Windows.
Daniil и NikitOS нравится это.
-
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp: In member function ‘String UniversalTelegramBot::sendPostToTelegram(String, ArduinoJson::JsonObject&)’:
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:85:26: error: ‘ArduinoJson::JsonObject’ has no member named ‘measureLength’
int length = payload.measureLength();
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:92:13: error: ‘ArduinoJson::JsonObject’ has no member named ‘printTo’
payload.printTo(out);
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp: In member function ‘bool UniversalTelegramBot::getMe()’:
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:269:3: error: ‘DynamicJsonBuffer’ was not declared in this scope
DynamicJsonBuffer jsonBuffer;
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:269:21: error: expected ‘;’ before ‘jsonBuffer’
DynamicJsonBuffer jsonBuffer;
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:270:22: error: ‘jsonBuffer’ was not declared in this scope
JsonObject& root = jsonBuffer.parseObject(response);
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:272:11: error: ‘ArduinoJson::JsonObject’ has no member named ‘success’
if(root.success()) {
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp: In member function ‘int UniversalTelegramBot::getUpdates(long int)’:
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:305:5: error: ‘DynamicJsonBuffer’ was not declared in this scope
DynamicJsonBuffer jsonBuffer;
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:305:23: error: expected ‘;’ before ‘jsonBuffer’
DynamicJsonBuffer jsonBuffer;
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:306:24: error: ‘jsonBuffer’ was not declared in this scope
JsonObject& root = jsonBuffer.parseObject(response);
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:308:14: error: ‘ArduinoJson::JsonObject’ has no member named ‘success’
if (root.success()) {
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:312:48: error: ‘class ArduinoJson670_0_0::ObjectSubscript<const char*>’ has no member named ‘size’
int resultArrayLength = root[«result»].size();
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:316:62: error: invalid initialization of non-const reference of type ‘ArduinoJson::JsonObject& {aka ArduinoJson670_0_0::ObjectRef&}’ from an rvalue of type ‘ArduinoJson670_0_0::enable_if<true, ArduinoJson670_0_0::ObjectSubscript<const char*> >::type {aka ArduinoJson670_0_0::ObjectSubscript<const char*>}’
JsonObject& message = root[«result»][«message»];
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp: In member function ‘bool UniversalTelegramBot::sendMessage(String, String, String)’:
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:379:3: error: ‘DynamicJsonBuffer’ was not declared in this scope
DynamicJsonBuffer jsonBuffer;
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:379:21: error: expected ‘;’ before ‘jsonBuffer’
DynamicJsonBuffer jsonBuffer;
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:380:25: error: ‘jsonBuffer’ was not declared in this scope
JsonObject& payload = jsonBuffer.createObject();
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp: In member function ‘bool UniversalTelegramBot::sendMessageWithReplyKeyboard(String, String, String, String, bool, bool, bool)’:
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:394:3: error: ‘DynamicJsonBuffer’ was not declared in this scope
DynamicJsonBuffer jsonBuffer;
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:394:21: error: expected ‘;’ before ‘jsonBuffer’
DynamicJsonBuffer jsonBuffer;
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:395:25: error: ‘jsonBuffer’ was not declared in this scope
JsonObject& payload = jsonBuffer.createObject();
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:404:70: error: invalid initialization of non-const reference of type ‘ArduinoJson::JsonObject& {aka ArduinoJson670_0_0::ObjectRef&}’ from an rvalue of type ‘ArduinoJson670_0_0::ObjectRef’
JsonObject& replyMarkup = payload.createNestedObject(«reply_markup»);
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:411:21: error: expected ‘;’ before ‘keyboardBuffer’
DynamicJsonBuffer keyboardBuffer;
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:412:29: error: ‘keyboardBuffer’ was not declared in this scope
replyMarkup[«keyboard»] = keyboardBuffer.parseArray(keyboard);
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp: In member function ‘bool UniversalTelegramBot::sendMessageWithInlineKeyboard(String, String, String, String)’:
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:432:3: error: ‘DynamicJsonBuffer’ was not declared in this scope
DynamicJsonBuffer jsonBuffer;
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:432:21: error: expected ‘;’ before ‘jsonBuffer’
DynamicJsonBuffer jsonBuffer;
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:433:25: error: ‘jsonBuffer’ was not declared in this scope
JsonObject& payload = jsonBuffer.createObject();
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:442:70: error: invalid initialization of non-const reference of type ‘ArduinoJson::JsonObject& {aka ArduinoJson670_0_0::ObjectRef&}’ from an rvalue of type ‘ArduinoJson670_0_0::ObjectRef’
JsonObject& replyMarkup = payload.createNestedObject(«reply_markup»);
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:444:21: error: expected ‘;’ before ‘keyboardBuffer’
DynamicJsonBuffer keyboardBuffer;
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:445:36: error: ‘keyboardBuffer’ was not declared in this scope
replyMarkup[«inline_keyboard»] = keyboardBuffer.parseArray(keyboard);
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp: In member function ‘String UniversalTelegramBot::sendPhoto(String, String, String, bool, int, String)’:
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:514:3: error: ‘DynamicJsonBuffer’ was not declared in this scope
DynamicJsonBuffer jsonBuffer;
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:514:21: error: expected ‘;’ before ‘jsonBuffer’
DynamicJsonBuffer jsonBuffer;
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:515:25: error: ‘jsonBuffer’ was not declared in this scope
JsonObject& payload = jsonBuffer.createObject();
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:533:72: error: invalid initialization of non-const reference of type ‘ArduinoJson::JsonObject& {aka ArduinoJson670_0_0::ObjectRef&}’ from an rvalue of type ‘ArduinoJson670_0_0::ObjectRef’
JsonObject& replyMarkup = payload.createNestedObject(«reply_markup»);
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:535:23: error: expected ‘;’ before ‘keyboardBuffer’
DynamicJsonBuffer keyboardBuffer;
^
E:UserДокументыArduinolibrariesUniversalTelegramBotsrcUniversalTelegramBot.cpp:536:31: error: ‘keyboardBuffer’ was not declared in this scope
replyMarkup[«keyboard»] = keyboardBuffer.parseArray(keyboard);
^
exit status 1
Ошибка компиляции для платы Generic ESP8266 Module. -
1. Вам нужна библиотека ArduinoJson версии 5.13.4 — в менеджере библиотек в выпадающем списке можно выбрать нужную версию
2. Поправьте —bot.messages[i].text
bot.messages[i].chat_id— к сообщениям обращаемся по индексу
-
Теперь выдаёт новые ошибки
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed -
В итоге, я разобралась с ошибками, но команда не появилась в телеграмм боте. Совсем уже не знаю в чем проблема( Могла ли я сломать как-то этот модуль?
-
@Angelina Dementeva, api.telegram.org пингуется? Добавьте вывод в UART отладочных сообщений библиотеки UniversalTelegramBot
void setup() {
Serial.begin(9600);
bot._debug=true; // выводим отладочную информацию
… -
Откройте командную строку и выполните команду:
C:Userss.user>ping api.telegram.orgОбмен пакетами с api.telegram.org [149.154.167.220] с 32 байтами данных:
Ответ от 149.154.167.220: число байт=32 время=103мс TTL=53
Ответ от 149.154.167.220: число байт=32 время=103мс TTL=53
Ответ от 149.154.167.220: число байт=32 время=103мс TTL=53
Ответ от 149.154.167.220: число байт=32 время=104мс TTL=53Статистика Ping для 149.154.167.220:
Пакетов: отправлено = 4, получено = 4, потеряно = 0
(0% потерь)
Приблизительное время приема-передачи в мс:
Минимальное = 103мсек, Максимальное = 104 мсек, Среднее = 103 мсекУ Вас так?
Страница 1 из 2
This error may pop up after switching between
staging and
stable esp8266
/ Arduino package installations, or after upgrading the package version.
If you face this issue, you will not be able to compile any sketch for
any ESP8266 module type.
Read below what is the error root cause or jump straight to the
resolution
The Root Cause¶
This issue is attributed to Arduino IDE Boards Manager not cleaning up
previous package installation before a new one is applied. As this is
not done, then it is user responsibility to remove previous package
before applying a new one.
To prevent it from happening, if you are changing between staging
and stable, first press Remove button to delete currently used
installation.
There is no need to remove the installed package if you are changing it
to another version (without switching between staging and stable).
Depending on selected module the error message is slightly different.
For instance, if you choose Generic ESP8266 Module, it will look as
follows:
Board generic (platform esp8266, package esp8266) is unknown Error compiling for board Generic ESP8266 Module.
Below is an example messages for
WeMos:
Board d1_mini (platform esp8266, package esp8266) is unknown Error compiling for board WeMos D1 R2 & mini.
… and another one for Adafruit Feather
HUZZAH:
Board huzzah (platform esp8266, package esp8266) is unknown Error compiling for board Adafruit HUZZAH ESP8266.
If the issue already happens, then uninstalling and re-installing the
package with Boards Manager typically will not fix it.
Uninstalling and re-installing the Arduino IDE will not fix it as well.
Well, OK, fine. You will be able to fix it with Boards Manager. To do
so, you need to carefully go step by step through the effort of removing
new and then the old package. Once done you can install again the new
package. Did I mention that in between you need to change twice
JOSN
in Additional Boards Manager URLs?
Fortunately there is a quicker and more effective fix. See below.
How to Fix it?¶
Issue resolution is as simple as deleting a folder with older esp8266 /
Arduino installation.
Procedure is identical on Windows, Linux and Mac OS. The only difference
is folder path. For instance, on Mac, it will be
/Users/$USER/Library/Arduino15/packages/esp8266/hardware/esp8266
.
Example below shows the path for Windows.
-
Check location of installation folder by going to File >
Preferences (Ctrl+,). The folder location is at the very bottom of
the Preferences window.
-
Click provided link to open the folder. For Windows 7 it will look as
follows:
-
Navigate further down to
Arduino15packagesesp8266hardwareesp8266
directory. Inside you
will find two folders with different esp8266 / Arduino package
installations.
-
Delete the older folder. Restart Arduino IDE, select your ESP module
and the error should be gone.
Note: If you are not sure which folder to delete, then remove both of
them. Restart Arduino IDE, go to Tools > Board: > Boards Manager and
install the esp8266 / Arduino package again. Select ESP8266 module and
the issue should be resolved.
More Information¶
This issue has been reported quite frequently in
Issues section of
esp8266 / Arduino repository. The most appreciated solution was provided
by [@anhhuy0501](https://github.com/anhhuy0501) in
#1387.
If you are interested in more details, please refer to
#2297,
#2156,
#2022,
#1802,
#1514,
#1387,
#1377,
#1251,
#1247,
#948
подскажите по ошибке компиляции:
никак не могу разобраться о причине ошибки
Arduino: 1.8.15 (Windows 10), Плата:»Generic ESP8266 Module, 80 MHz, Flash, Disabled, nodemcu, 26 MHz, 40MHz, DOUT (compatible), 4M (2M SPIFFS), 2, v2 Lower Memory, Disabled, None, All Flash Contents, 115200″
ПРЕДУПРЕЖДЕНИЕ: библиотека Timezone должна запускаться на архитектурах avr и может быть несовместима с вашей платой на архитектуре esp8266.
In file included from C:Usersmitkir01DownloadsGyverLamp-masterfirmwareGyverLamp_v1.4GyverLamp_v1.4.ino:122:0:
C:Program Files (x86)ArduinolibrariesFastLED/FastLED.h:14:21: note: #pragma message: FastLED version 3.003.002
# pragma message «FastLED version 3.003.002»
^
In file included from C:Program Files (x86)ArduinolibrariesFastLED/FastLED.h:65:0,
from C:Usersmitkir01DownloadsGyverLamp-masterfirmwareGyverLamp_v1.4GyverLamp_v1.4.ino:122:
C:Program Files (x86)ArduinolibrariesFastLED/fastspi.h:130:23: note: #pragma message: No hardware SPI pins defined. All SPI access will default to bitbanged output
# pragma message «No hardware SPI pins defined. All SPI access will default to bitbanged output»
^
In file included from C:Usersmitkir01AppDataLocalArduino15packagesesp8266hardwareesp82662.5.0/tools/sdk/libc/xtensa-lx106-elf/include/string.h:163:0,
from C:Usersmitkir01AppDataLocalArduino15packagesesp8266hardwareesp82662.5.0coresesp8266/Arduino.h:33,
from C:Program Files (x86)ArduinolibrariesTimeDateStrings.cpp:12:
C:Program Files (x86)ArduinolibrariesTimeDateStrings.cpp: In function ‘char* monthStr(uint8_t)’:
C:Usersmitkir01AppDataLocalArduino15packagesesp8266hardwareesp82662.5.0/tools/sdk/libc/xtensa-lx106-elf/include/sys/pgmspace.h:76:81: error: ‘const void*’ is not a pointer-to-object type
#define pgm_read_ptr(addr) (reinterpret_cast<const void>(addr))
^
C:Usersmitkir01AppDataLocalArduino15packagesesp8266hardwareesp82662.5.0/tools/sdk/libc/xtensa-lx106-elf/include/sys/string.h:32:57: note: in definition of macro ‘strcpy_P’
#define strcpy_P(dest, src) strncpy_P((dest), (src), SIZE_IRRELEVANT)
^
C:Program Files (x86)ArduinolibrariesTimeDateStrings.cpp:72:29: note: in expansion of macro ‘pgm_read_ptr’
strcpy_P(buffer, (PGM_P)pgm_read_ptr(&(monthNames_P[month])));
^
C:Program Files (x86)ArduinolibrariesTimeDateStrings.cpp: In function ‘char* dayStr(uint8_t)’:
C:Usersmitkir01AppDataLocalArduino15packagesesp8266hardwareesp82662.5.0/tools/sdk/libc/xtensa-lx106-elf/include/sys/pgmspace.h:76:81: error: ‘const void*’ is not a pointer-to-object type
#define pgm_read_ptr(addr) (reinterpret_cast<const void>(addr))
^
C:Usersmitkir01AppDataLocalArduino15packagesesp8266hardwareesp82662.5.0/tools/sdk/libc/xtensa-lx106-elf/include/sys/string.h:32:57: note: in definition of macro ‘strcpy_P’
#define strcpy_P(dest, src) strncpy_P((dest), (src), SIZE_IRRELEVANT)
^
C:Program Files (x86)ArduinolibrariesTimeDateStrings.cpp:86:28: note: in expansion of macro ‘pgm_read_ptr’
strcpy_P(buffer, (PGM_P)pgm_read_ptr(&(dayNames_P[day])));
^
exit status 1
Ошибка компиляции для платы Generic ESP8266 Module.
Loading