Unable to use core packages (like HTTPClient)

Hi Team,

Before adding my own usermod I am trying to modify EXAMPLE_v2\usermod_v2_example.h

I have un-commented the required lines in usermods_lists.cpp
Without any modification to the usermod example it compiles successfully for d1_mini.

To start with I tried creating a HTTP Client to GET json data from internal server as given in ESP8266 NodeMCU HTTP GET and HTTP POST with Arduino IDE | Random Nerd Tutorials

As soon as I include ESP8266HTTPClient.h it fails to compile

#include <ESP8266HTTPClient.h>
#include <WiFiClient.h>

But it fails to compile due to ESP8266HTTPClient.h and throws the following error.

In file included from wled00/usermods_list.cpp:12:0:
wled00/../usermods/EXAMPLE_v2/usermod_v2_example.h:5:31: fatal error: ESP8266HTTPClient.h: No such file or directory

As such the program for HTTP Client compiles both in Arduino IDE and in new project in VSCode.

Please let me know as to what can be done.

PN: I’m new to VSCode. However, I have been using Arduino IDE.

Thanks and Regards,
Sandeep

Me too!
Should we be using HTTPClient.h or is there already networking available in WLED we should be using instead?

I found the solution. You have to put your headers into usermods_list.cpp
Then when you use it your usermod file it will not throw error.
See the user mod WLED_USE_SD_MMC in usermods_list.cpp as an example.

1 Like

That was it! Thank you!

1 Like