AndrewBudziszek / bitcoin-ticker-esp8266

Bitcoin Ticker code for ESP8266
8 stars 1 forks source link

Error with HTTPClient #2

Closed scul81 closed 3 years ago

scul81 commented 3 years ago

When running the code I receive the following error


Arduino: 1.8.13 (Windows 10), Board: "Generic ESP8266 Module, 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, dtr (aka nodemcu), 26 MHz, 40MHz, DOUT (compatible), 1MB (FS:64KB OTA:~470KB), 2, nonos-sdk 2.2.1+100 (190703), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

D:\Data\Docs\Arduino\CryptoTicker\CryptoTicker.ino: In function 'void loop()':

CryptoTicker:71:15: error: call to 'HTTPClient::begin' declared with attribute error: obsolete API, use ::begin(WiFiClient, url)

   71 |     http.begin(url);

      |     ~~~~~~~~~~^~~~~

CryptoTicker:105:17: error: call to 'HTTPClient::begin' declared with attribute error: obsolete API, use ::begin(WiFiClient, url)

  105 |       http.begin(historyURL);

      |       ~~~~~~~~~~^~~~~~~~~~~~

exit status 1

call to 'HTTPClient::begin' declared with attribute error: obsolete API, use ::begin(WiFiClient, url)

I can confirm I have correctly installed the ESP8266 library

AndrewBudziszek commented 3 years ago

@scul81 Were any other changes made to the code? You might be missing an import. Please link your code if possible.

scul81 commented 3 years ago

Certainly.. the code has been copy pasted

cryptoino.txt

AndrewBudziszek commented 3 years ago

@scul81 Please upload your project to github, or copy paste that code here - https://gist.github.com/. This makes it easier to collaborate.

You have the code for the secrets file commented out.

Your code:

//const char* ssid = SECRET_SSID;
//const char* password = SECRET_WIFI_PASSWORD;

const char* ssid = "xxx";
const char* password = "xxx";

Delete the last two lines and uncomment the first two lines.

That might be unrelated but that's the first thing that sticks out to me.

scul81 commented 3 years ago

Yes I commented those out because the secrets file doesn't work and I have no other option but to hardcode these strings as per issue #1 - I can upload my code on github

AndrewBudziszek commented 3 years ago

@scul81 Can you confirm that you are targeting the right board in the Tools menu? image

scul81 commented 3 years ago

esp8266

as above

The error remains (also after resolving the secrets file problem)

scul81 commented 3 years ago

Would you like to see the contents of my library folder or shall I remove all libraries and reinstall the recommend ones? It would be nice if you could give direct links or references to the libraries with version number and author to make sure they match

AndrewBudziszek commented 3 years ago

Hmm try this?

image

scul81 commented 3 years ago

esp_http same result unfortunately

AndrewBudziszek commented 3 years ago

Can you check the board version?

Tools >> Board >> Board Manager

image

AndrewBudziszek commented 3 years ago

It looks like it breaks with the latest version of that package. So this one might work.

scul81 commented 3 years ago

It seems to have compiled fine! I will now try and test to see if I can load it to the unit

AndrewBudziszek commented 3 years ago

Yay! I will update the documentation. Sorry for the trouble!

scul81 commented 3 years ago

That's OK I believe we can close this issue now