Json.h: no such file or directory

Hi All
Having a few dramas uploading some code to my Duinotech Uno Wifi. I'm building the project here GitHub - Jaycar-Electronics/Motherload-Datalogger: The Datalogger project to end all dataloggers, with Google Cloud Platform!

I'm using the code here

and getting some errors.
I have uploaded the ARDUINO_JSON library as seen in the screen shot
This is the error message i get

Multiple libraries were found for "WiFiClient.h"

espcode:5:18: fatal error: json.h: No such file or directory

Used: C:\Users\jcp\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\libraries\ESP8266WiFi

#include "json.h"

Not used: C:\Users\jcp\Documents\Arduino\libraries\WiFiNINA

^

Not used: C:\Users\jcp\Documents\arduino-nightly-windows\arduino-nightly\libraries\WiFi

compilation terminated.

exit status 1

json.h: No such file or directory

any help much appriciated

Because it's common for Arduino sketches to only consist of a single .ino file, it's a common mistake to assume they are all this way. But sketches may consist of multiple files. It's actually the folder that is the sketch, not the .ino file.

The espCode sketch is one of these multi-file sketches, as you can see here:

The error is caused by you only downloading the .ino file, leaving behind the essential json.h file of the sketch.

You can get the full sketch by doing this:

You will now be able to compile the sketch without getting that error.

If done correctly you will see as in the photo below, the two tabs at the top of your sketch.

The reason it is done this way is many program add ons such as the json file may change from time to time and the sketch may no longer work. This way, with the file included, all good.

json_h.jpg

json_h.jpg

Awesome PERT
Worked perfectly.
A bit daunting as a learner but that was well explained and easy.
Cheers

You're welcome. I'm glad to hear it's working now. Enjoy!
Per

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.