If you try to compile a program written for ArduinoJson 5 when version 6 is installed, you get one of the following error:

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

To fix this error, you must either:

  • Downgrade the installed version of ArduinoJson:
    • Open the Arduino Library Manager
    • Search “ArduinoJson”
    • Select version 5.13.5
    • Click “Install”

    (See the picture below.)

  • Upgrade your program:

How to downgrade ArduinoJson to version 5