dynamicjsonbuffor not an object
ZugBahnHof opened this issue · 1 comments
this is my arduino ide error message:
Arduino: 1.8.3 (Linux), Board: "NodeMCU 0.9 (ESP-12 Module), 80 MHz, Flash, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
ESP8266_WebSocketClient:25: error: 'DynamicJsonBuffer' does not name a type
DynamicJsonBuffer jsonBuffer;
^
/home/user/Arduino/IOT-ESP8266-Google-Home-master/ESP8266/WebSocketClient/ESP8266_WebSocketClient/ESP8266_WebSocketClient.ino: In function 'void processWebScoketRequest(String)':
ESP8266_WebSocketClient:109: error: 'jsonBuffer' was not declared in this scope
JsonObject& root = jsonBuffer.parseObject(data);
^
exit status 1
'DynamicJsonBuffer' does not name a type
Does someone know, what's wrong?
I installed the newest versions of the given libraries, but what's hash.h? Is it also a library I have to install?
This error means you're using a version of ArduinoJson library that is not compatible with this code. The ArduinoJson library 6.x.x versions have breaking changes that make them not work with code written for the ArduinoJson 5.x.x versions.
The recommended solution is to roll back to the newest 5.x.x release of ArduinoJson:
- Sketch > Include Library > Manage Libraries...
- Wait for the download to finish.
- In the "Filter your search..." box, type "arduinojson".
- In the search results, click on "ArduinoJson by Benoit Blanchon"
- From the dropdown version menu, select "5.13.4".
- Click "Install".
- Wait for the installation to finish.
- Click "Close'. The code should now compile.
The alternative solution is to update the code to work with the 6.x.x versions of ArduinoJson. You will find a guide to this here:
https://arduinojson.org/v6/doc/upgrade/
Reference:
https://arduinojson.org/v5/faq/error-jsonbuffer-was-not-declared-in-this-scope/
what's hash.h? Is it also a library I have to install?
It's Hash.h, not hash.h. You're using Linux so you should already know that filename case is important. Hash.h is part of the Hash library bundled with the ESP8266 package. You don't need to install it because you already installed it with the ESP8266 package.