Go Down

Topic: Upgrading AutoConnect to ArduinoJson6 (Read 137 times) previous topic - next topic

Marciokoko

Oct 20, 2019, 07:21 pm Last Edit: Oct 21, 2019, 12:53 am by Marciokoko
Guys,

Ive been working on this tutorial for wifimanager autconnect with parameters cause i need the apikey for thingspeak for my esp01+dht22 temp and hum reporter:

https://randomnerdtutorials.com/wifimanager-with-esp8266-autoconnect-custom-parameter-and-manage-your-ssid-and-password/

The complete code is attached but the offending line seems to be this one:

Code: [Select]

    DynamicJsonDocument doc;



But im getting this:

Code: [Select]
Users/quique123/Documents/Arduino/CustomESPWiFiManager/AutoConnect.ino:131:25: note:   candidate expects 2 arguments, 0 provided
     DynamicJsonDocument doc;
                         ^
In file included from /Users/quique123/Documents/Arduino/libraries/ArduinoJson/src/ArduinoJson/Document/DynamicJsonDocument.hpp:7:0,
                 from /Users/quique123/Documents/Arduino/libraries/ArduinoJson/src/ArduinoJson.hpp:21,
                 from /Users/quique123/Documents/Arduino/libraries/ArduinoJson/src/ArduinoJson.h:9,
                 from /Users/quique123/Documents/Arduino/CustomESPWiFiManager/AutoConnect.ino:8:
/Users/quique123/Documents/Arduino/libraries/ArduinoJson/src/ArduinoJson/Document/BasicJsonDocument.hpp:36:3: note: ArduinoJson6120_000001::BasicJsonDocument<TAllocator>::BasicJsonDocument(const ArduinoJson6120_000001::BasicJsonDocument<TAllocator>&) [with TAllocator = ArduinoJson6120_000001::DefaultAllocator]
   BasicJsonDocument(const BasicJsonDocument& src)
   ^
/Users/quique123/Documents/Arduino/libraries/ArduinoJson/src/ArduinoJson/Document/BasicJsonDocument.hpp:36:3: note:   candidate expects 1 argument, 0 provided
/Users/quique123/Documents/Arduino/libraries/ArduinoJson/src/ArduinoJson/Document/BasicJsonDocument.hpp:33:12: note: ArduinoJson6120_000001::BasicJsonDocument<TAllocator>::BasicJsonDocument(size_t, TAllocator) [with TAllocator = ArduinoJson6120_000001::DefaultAllocator; size_t = unsigned int]
   explicit BasicJsonDocument(size_t capa, TAllocator allocator = TAllocator())
            ^
/Users/quique123/Documents/Arduino/libraries/ArduinoJson/src/ArduinoJson/Document/BasicJsonDocument.hpp:33:12: note:   candidate expects 2 arguments, 0 provided
Multiple libraries were found for "dht.h"
 Used: /Users/quique123/Documents/Arduino/libraries/DHTstable
 Not used: /Users/quique123/Documents/Arduino/libraries/DHTlib
exit status 1
no matching function for call to 'ArduinoJson6120_000001::BasicJsonDocument<ArduinoJson6120_000001::DefaultAllocator>::BasicJsonDocument()'

rtek1000

If I'm not mistaken, this library 'ArduinoJson' has a break from support in previous functions. Try downgrading to a different version to get the code to work. Find out which library version was used in the original project.

Repository maintainers should never change the way functions are declared, but unfortunately this often happens. Some repository maintainers create a new repository to prevent this. This should be the default procedure.
Please avoid private messages, your question may be someone's answer in the future!

Marciokoko

can a moderator please delete this one...thanks

Go Up