OpenMQTTGateway icon indicating copy to clipboard operation
OpenMQTTGateway copied to clipboard

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

Open opl-git opened this issue 7 years ago • 9 comments

Hello everyone,

I found this project and really like to try it. I used the guide https://github.com/1technophile/OpenMQTTGateway/wiki/Module-Overview-ESP32 Unfortunately there is a problem when compiling it for my esp32: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6

I am using Arduino 1.8.9 on a windows 10 machine.

Hope someone can help me, kind regards Daniek

opl-git avatar Apr 23 '19 09:04 opl-git

Downgraded to ArduinoJson 5.X ... solved the problem.

opl-git avatar Apr 23 '19 12:04 opl-git

Hmm, you forgot this step I think : 8. Copy OpenMQTTGateway/lib to "sketchbook folder"/libraries

1technophile avatar Apr 23 '19 18:04 1technophile

Thank you for your answer! No, I copied all the libaries from OpenMQTT (A6lib...Wifi Manager) in my sktechbook folder under libaries.

opl-git avatar Apr 24 '19 05:04 opl-git

And even arduinojson library that is located in this folder with the good version ?

1technophile avatar Apr 24 '19 05:04 1technophile

Yes, I copied all the libaries from OpenMQTT to my sketchbook libary folder. Maybe the arduinojson library got updated somehow, because when I downgraded it to version 5.13, everything works fine.

opl-git avatar Apr 24 '19 07:04 opl-git

@1technophile Maybe take a look at PlatformIO, it provides library version management and isolates your project from the shared libraries of the Arduino IDE. It's also great for automated builds/managing many different build targets.

thomasnordquist avatar Apr 27 '19 08:04 thomasnordquist

Yep, need to put this on my todo, but I'm asking myself if going to platform.io will not make things more difficult for Arduino IDE traditional users. Maybe just a wrong view.

1technophile avatar Apr 27 '19 12:04 1technophile

PlatformIO is pretty easy to set up for Linux and MAC, the setup is a little more "complicated" for Windows but the Atom IDE Plugin guides you through the setup procedure. Most people in home automation might already know it from Tasmota

https://github.com/MarlinFirmware/Marlin supports platformio/arduino hybrid.

I never cared much for the Arduino IDE, I mostly use it for the Serial Monitor. The PlatformIO IDE is very powerful, with autocompletion and compile/lint-as-you-type.

You might get rid of your lib/ directory, get a powerful IDE and have versioned packages.

I believe you could get started with platformio by simply adding a platformio.ini with no other changes to the project at all, retaining compatibility with the Arduino IDE.

thomasnordquist avatar Apr 27 '19 12:04 thomasnordquist

Thanks for the infos, if I can keep both worlds working with the same repo it would be a nice progress. It seems to be time to put my hands on it!

1technophile avatar Apr 27 '19 13:04 1technophile