Dear Sara,
I am doing the above-mentioned project from your site but cannot compile.
It prompted “error in compiling “esp8266 nodemcu …..” . Please help.
best regards,
Quek Kok Keong
Hi.
Can you provide more information about the error?
What line does the code highlight when you get the error?
Regards,
Sara
Hi Sara,
The errors are :
Arduino: 1.8.13 (Windows 10), Board: “NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200”
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:319:11: error: DynamicJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
DynamicJsonBuffer jsonBuffer;
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:369:11: error: DynamicJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
DynamicJsonBuffer jsonBuffer;
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:530:11: error: DynamicJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
DynamicJsonBuffer jsonBuffer;
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:547:11: error: DynamicJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
DynamicJsonBuffer jsonBuffer;
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:564:11: error: DynamicJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
DynamicJsonBuffer keyboardBuffer;
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:589:11: error: DynamicJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
DynamicJsonBuffer jsonBuffer;
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:601:11: error: DynamicJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
DynamicJsonBuffer keyboardBuffer;
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:684:11: error: DynamicJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
DynamicJsonBuffer jsonBuffer;
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:705:11: error: DynamicJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
DynamicJsonBuffer keyboardBuffer;
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp: In member function ‘String UniversalTelegramBot::sendPostToTelegram(String, ArduinoJson::JsonObject&)’:
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:120:26: error: ‘ArduinoJson::JsonObject’ has no member named ‘measureLength’
int length = payload.measureLength();
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:128:13: error: ‘ArduinoJson::JsonObject’ has no member named ‘printTo’
payload.printTo(out);
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp: In member function ‘bool UniversalTelegramBot::getMe()’:
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:319:21: error: ‘jsonBuffer’ was not declared in this scope
DynamicJsonBuffer jsonBuffer;
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:324:12: error: ‘ArduinoJson::JsonObject’ has no member named ‘success’
if (root.success()) {
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp: In member function ‘int UniversalTelegramBot::getUpdates(long int)’:
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:369:23: error: ‘jsonBuffer’ was not declared in this scope
DynamicJsonBuffer jsonBuffer;
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:372:14: error: ‘ArduinoJson::JsonObject’ has no member named ‘success’
if (root.success()) {
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:382:50: error: invalid initialization of non-const reference of type ‘ArduinoJson::JsonObject& {aka ArduinoJson6152_0000010::ObjectRef&}’ from an rvalue of type ‘ArduinoJson6152_0000010::ElementProxy<ArduinoJson6152_0000010::MemberProxy<ArduinoJson6152_0000010::ObjectRef, const char*> >’
JsonObject &result = root[“result”][i];
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp: In member function ‘bool UniversalTelegramBot::processResult(ArduinoJson::JsonObject&, int)’:
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:431:45: error: invalid initialization of non-const reference of type ‘ArduinoJson::JsonObject& {aka ArduinoJson6152_0000010::ObjectRef&}’ from an rvalue of type ‘ArduinoJson6152_0000010::enable_if<true, ArduinoJson6152_0000010::MemberProxy<ArduinoJson6152_0000010::ObjectRef, const char*> >::type {aka ArduinoJson6152_0000010::MemberProxy<ArduinoJson6152_0000010::ObjectRef, const char*>}’
JsonObject &message = result[“message”];
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:451:50: error: invalid initialization of non-const reference of type ‘ArduinoJson::JsonObject& {aka ArduinoJson6152_0000010::ObjectRef&}’ from an rvalue of type ‘ArduinoJson6152_0000010::enable_if<true, ArduinoJson6152_0000010::MemberProxy<ArduinoJson6152_0000010::ObjectRef, const char*> >::type {aka ArduinoJson6152_0000010::MemberProxy<ArduinoJson6152_0000010::ObjectRef, const char*>}’
JsonObject &message = result[“channel_post”];
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:460:52: error: invalid initialization of non-const reference of type ‘ArduinoJson::JsonObject& {aka ArduinoJson6152_0000010::ObjectRef&}’ from an rvalue of type ‘ArduinoJson6152_0000010::enable_if<true, ArduinoJson6152_0000010::MemberProxy<ArduinoJson6152_0000010::ObjectRef, const char*> >::type {aka ArduinoJson6152_0000010::MemberProxy<ArduinoJson6152_0000010::ObjectRef, const char*>}’
JsonObject &message = result[“callback_query”];
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:472:52: error: invalid initialization of non-const reference of type ‘ArduinoJson::JsonObject& {aka ArduinoJson6152_0000010::ObjectRef&}’ from an rvalue of type ‘ArduinoJson6152_0000010::enable_if<true, ArduinoJson6152_0000010::MemberProxy<ArduinoJson6152_0000010::ObjectRef, const char*> >::type {aka ArduinoJson6152_0000010::MemberProxy<ArduinoJson6152_0000010::ObjectRef, const char*>}’
JsonObject &message = result[“edited_message”];
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp: In member function ‘bool UniversalTelegramBot::sendMessage(String, String, String)’:
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:530:21: error: ‘jsonBuffer’ was not declared in this scope
DynamicJsonBuffer jsonBuffer;
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp: In member function ‘bool UniversalTelegramBot::sendMessageWithReplyKeyboard(String, String, String, String, bool, bool, bool)’:
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:547:21: error: ‘jsonBuffer’ was not declared in this scope
DynamicJsonBuffer jsonBuffer;
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:557:70: error: invalid initialization of non-const reference of type ‘ArduinoJson::JsonObject& {aka ArduinoJson6152_0000010::ObjectRef&}’ from an rvalue of type ‘ArduinoJson6152_0000010::ObjectRef’
JsonObject &replyMarkup = payload.createNestedObject(“reply_markup”);
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:564:21: error: ‘keyboardBuffer’ was not declared in this scope
DynamicJsonBuffer keyboardBuffer;
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp: In member function ‘bool UniversalTelegramBot::sendMessageWithInlineKeyboard(String, String, String, String)’:
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:589:21: error: ‘jsonBuffer’ was not declared in this scope
DynamicJsonBuffer jsonBuffer;
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:599:70: error: invalid initialization of non-const reference of type ‘ArduinoJson::JsonObject& {aka ArduinoJson6152_0000010::ObjectRef&}’ from an rvalue of type ‘ArduinoJson6152_0000010::ObjectRef’
JsonObject &replyMarkup = payload.createNestedObject(“reply_markup”);
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:601:21: error: ‘keyboardBuffer’ was not declared in this scope
DynamicJsonBuffer keyboardBuffer;
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp: In member function ‘String UniversalTelegramBot::sendPhoto(String, String, String, bool, int, String)’:
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:684:21: error: ‘jsonBuffer’ was not declared in this scope
DynamicJsonBuffer jsonBuffer;
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:703:72: error: invalid initialization of non-const reference of type ‘ArduinoJson::JsonObject& {aka ArduinoJson6152_0000010::ObjectRef&}’ from an rvalue of type ‘ArduinoJson6152_0000010::ObjectRef’
JsonObject &replyMarkup = payload.createNestedObject(“reply_markup”);
^
C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot\src\UniversalTelegramBot.cpp:705:23: error: ‘keyboardBuffer’ was not declared in this scope
DynamicJsonBuffer keyboardBuffer;
^
Multiple libraries were found for “UniversalTelegramBot.h”
Used: C:\Users\Bob Quek\Documents\Arduino\libraries\UniversalTelegramBot
Not used: C:\Users\Bob Quek\Documents\Arduino\libraries\Universal-Arduino-Telegram-Bot
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).
Could not find boards.txt in C:\Users\Bob Quek\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.1. Is it pre-1.5?
This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.
I can’t understand the errors. Please advise and help. Thanks.
Best regards,
Quek Kok Keong
Hi,
You need to update the version of the ArduinoJson library you’re using.
In your Arduino IDE, go to Sketch > Include Library > Manage Libraries. Search for ArduinoJson.
There should be an option to select the version. Select 6.15.2.
I hope this helps.
Regards,
Sara
Dear Sara,
Yes, I have used version 6.15.2 ArduinoJson library but prompted the same errors as mentioned to you earlier.
I even installed the latest arduino IDE version 1.8.13 and replaced 3 new ESP8266 nodemcu boards. It still shows the same errors. I cannot understand why. Please advise. Thanks.
Best regards,
Quek Kok Keong