WiFiMQTTManager Library problems

Hya

i’m getting this errors an am not being able to solve it. Any help?

TIA

p8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -I/home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/sdk/include -I/home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/sdk/lwip2/include -I/home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/sdk/libc/xtensa-lx106-elf/include -I/tmp/arduino_build_208981/core -c -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++11 -MMD -ffunction-sections -fdata-sections -fno-exceptions -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10813 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_NODEMCU\"" -DLED_BUILTIN=2 -DFLASHMODE_DIO -DESP8266 -I/home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266 -I/home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/variants/nodemcu -I/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src -I/home/paulo/Arduino/Projects/libraries/WiFiManager -I/home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/ESP8266WiFi/src -I/home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/ESP8266WebServer/src -I/home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/DNSServer/src -I/home/paulo/Arduino/Projects/libraries/ArduinoJson-6.x/src -I/home/paulo/Arduino/Projects/libraries/PubSubClient /home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp -o /tmp/arduino_build_208981/libraries/WifiMQTTManager/WiFiMQTTManager.cpp.o
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp:117: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;
           ^
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp:192: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;
           ^
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp:266:11: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
   StaticJsonBuffer<2000> JSONbuffer;
           ^
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp: In member function 'void WiFiMQTTManager::setup(String)':
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp:117:23: error: 'jsonBuffer' was not declared in this scope
     DynamicJsonBuffer jsonBuffer;
                       ^
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp:125:23: warning: 'SPIFFS' is deprecated (declared at /home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/FS.h:269): SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
     File configFile = SPIFFS.open("/config.json", "w");
                       ^
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp:130:10: error: 'ArduinoJson::JsonObject' has no member named 'prettyPrintTo'
     json.prettyPrintTo(Serial);
          ^
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp:131:10: error: 'ArduinoJson::JsonObject' has no member named 'printTo'
     json.printTo(configFile);
          ^
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp: In member function 'void WiFiMQTTManager::_setupSpiffs()':
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp:173:5: warning: 'SPIFFS' is deprecated (declared at /home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/FS.h:269): SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
     SPIFFS.format();
     ^
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp:179:7: warning: 'SPIFFS' is deprecated (declared at /home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/FS.h:269): SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
   if (SPIFFS.begin()) {
       ^
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp:181:9: warning: 'SPIFFS' is deprecated (declared at /home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/FS.h:269): SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
     if (SPIFFS.exists("/config.json")) {
         ^
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp:184:25: warning: 'SPIFFS' is deprecated (declared at /home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/FS.h:269): SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
       File configFile = SPIFFS.open("/config.json", "r");
                         ^
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp:192:27: error: 'jsonBuffer' was not declared in this scope
         DynamicJsonBuffer jsonBuffer;
                           ^
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp:194:14: error: 'ArduinoJson::JsonObject' has no member named 'printTo'
         json.printTo(Serial);
              ^
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp:195:18: error: 'ArduinoJson::JsonObject' has no member named 'success'
         if (json.success()) {
                  ^
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp:210:5: warning: 'SPIFFS' is deprecated (declared at /home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/FS.h:269): SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
     SPIFFS.format();
     ^
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp: In member function 'void WiFiMQTTManager::_registerDevice()':
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp:266:19: error: expected primary-expression before '<' token
   StaticJsonBuffer<2000> JSONbuffer;
                   ^
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp:266:26: error: 'JSONbuffer' was not declared in this scope
   StaticJsonBuffer<2000> JSONbuffer;
                          ^
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp:282:8: error: 'ArduinoJson::JsonObject' has no member named 'printTo'
   root.printTo(messageBuffer, sizeof(messageBuffer));
        ^
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp:286:8: error: 'ArduinoJson::JsonObject' has no member named 'prettyPrintTo'
   root.prettyPrintTo(Serial);
        ^
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp: In function 'void _subscriptionCallback(char*, byte*, unsigned int)':
/home/paulo/Arduino/Projects/libraries/WifiMQTTManager/src/WiFiMQTTManager.cpp:340:5: warning: 'SPIFFS' is deprecated (declared at /home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/FS.h:269): SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
     SPIFFS.format();
     ^
Bibliothek WifiMQTTManager in Version 1.0.2-beta im Ordner: /home/paulo/Arduino/Projects/libraries/WifiMQTTManager  wird verwendet
Bibliothek WiFiManager in Version 2.0.3-alpha im Ordner: /home/paulo/Arduino/Projects/libraries/WiFiManager  wird verwendet
Bibliothek ESP8266WiFi in Version 1.0 im Ordner: /home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/ESP8266WiFi  wird verwendet
Bibliothek ESP8266WebServer in Version 1.0 im Ordner: /home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/ESP8266WebServer  wird verwendet
Bibliothek DNSServer in Version 1.1.1 im Ordner: /home/paulo/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/libraries/DNSServer  wird verwendet
Bibliothek ArduinoJson-6.x in Version 6.17.3 im Ordner: /home/paulo/Arduino/Projects/libraries/ArduinoJson-6.x  wird verwendet
Bibliothek PubSubClient im Ordner: /home/paulo/Arduino/Projects/libraries/PubSubClient (legacy) wird verwendet
exit status 1
Fehler beim Kompilieren für das Board NodeMCU 1.0 (ESP-12E Module).

This has no meaning for you

is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6

?

Idahowalker:
This has no meaning for you ?

Bibliothek ArduinoJson-6.x in Version 6.17.3 im Ordner: /home/paulo/Arduino/Projects/libraries/ArduinoJson-6.x  wird verwendet

yes, because ArduinoJson version 6 is being used.

Oi! I see this is part of your include

ArduinoJson-6.x

I'd look to see how many ArduinoJson folders you have located in your library folder. Right now it looks like one thing is being pointed at but the other thing is being loaded. A bug hunt.

You can have a look at ConfigOnDRD_FS_MQTT_Ptr of ESP_WiFiManager Library to know how to convert to ArduinoJSon version > 6

For example

#if (ARDUINOJSON_VERSION_MAJOR >= 6)
  DynamicJsonDocument json(1024);
#else
  DynamicJsonBuffer jsonBuffer;
  JsonObject& json = jsonBuffer.createObject();
#endif


  // JSONify local configuration parameters
  json[AIO_SERVER_Label]      = custom_AIO_SERVER;
  json[AIO_SERVERPORT_Label]  = custom_AIO_SERVERPORT;
  json[AIO_USERNAME_Label]    = custom_AIO_USERNAME;
  json[AIO_KEY_Label]         = custom_AIO_KEY;

  // Open file for writing
  File f = FileFS.open(CONFIG_FILE, "w");

  if (!f)
  {
    Serial.println(F("Failed to open Config File for writing"));
    return false;
  }

#if (ARDUINOJSON_VERSION_MAJOR >= 6)
  serializeJsonPretty(json, Serial);
  // Write data to file and close it
  serializeJson(json, f);
#else
  json.prettyPrintTo(Serial);
  // Write data to file and close it
  json.printTo(f);
#endif

and more

yes, i understand, but i’m not able to do this kind of job…

The easiest way is to install the ArduinoJson version 5.13.5 and you don't need to modify anything. Just use the code as is.

thank you!!!!!

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