Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling / version issue with ArduinoJson #122

Closed
bmw-biker opened this issue Mar 30, 2023 · 3 comments
Closed

Compiling / version issue with ArduinoJson #122

bmw-biker opened this issue Mar 30, 2023 · 3 comments

Comments

@bmw-biker
Copy link

bmw-biker commented Mar 30, 2023

Hi, I tried to get ConfigManager running. But I get lots of errors regarding ArduinoJson getMember(), getOrAddMember(), .is<T> and .as<T>.
Obviously Platformio takes the latest ArduinoJson 6.21.1.
Seems that between 6.0.0 and the current there have been some breaking changes.

Any idea how to adapt ConfigManager to current ArduinoJson ?
Or, which ArduinoJson version is the correct for latest ConfigManager, and how can I force Platformio to use this version ?

Example log for getMember and .is<T>:

.pio\libdeps\esp_wroom_02\ConfigManager\src/ConfigManager.h: In member function 'void ConfigParameter<T>::fromJson(ArduinoJson::JsonObject*)':
.pio\libdeps\esp_wroom_02\ConfigManager\src/ConfigManager.h:78:42: error: 'class ArduinoJson::JsonObject' has no member named 'getMember'
   78 |     if (json->containsKey(name) && json->getMember(name).is<T>()) {
      |                                          ^~~~~~~~~
.pio\libdeps\esp_wroom_02\ConfigManager\src/ConfigManager.h:78:62: error: expected primary-expression before '>' token
   78 |     if (json->containsKey(name) && json->getMember(name).is<T>()) {
      |                                                              ^

Best regards, Torsten

@nrwiersma
Copy link
Owner

Sorry, have no idea. If you figure it out, feel free to open a PR.

@bmw-biker
Copy link
Author

Many thanks for the fast response.

Meanwhile I figured some out...
Latest version of ConfigManager is from 12.2021.
So I tried to find the latest ArduinoJson version before that date which is 6.18.5.
So, if I then include the following exact version 6.18.5 dependency in platformio.ini file it compiles without error:

lib_deps = 
  bblanchon/ArduinoJson@6.18.5  ; without ^ before version !

Although I didn't manage to get it to connect with my Smartphone yet. Smartphone tries to connect but aborts after a while. I'll have to check tomorrow.

@nrwiersma
Copy link
Owner

Fixed by #123. If there are still issues, please reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants