panbachi / wordclock

DIY WordClock
https://www.panbachi.de/eigene-word-clock-bauen/
MIT License
108 stars 47 forks source link

Compile error: obsolete API, use ::begin(WiFiClient, url) in "src/utcOffset.cpp" #22

Closed WolfgangFranke closed 3 years ago

WolfgangFranke commented 3 years ago

Arduino IDE: 1.8.15 (Mac OS X) Ard-ESP-Core: https://arduino.esp8266.com/stable/package_esp8266com_index.json ESP8266 Board: LOLIN(WEMOS) D1 R2 & mini

Compile Error in "src/utcOffset.cpp":

/WordClock401_ESP8266/src/utcOffset.cpp: In static member function 'static void UtcOffset::updateLocalizedUtcOffset()':
/WordClock401_ESP8266/src/utcOffset.cpp:9:13: error: call to 'HTTPClient::begin' declared with attribute error: obsolete API, use ::begin(WiFiClient, url)
    9 |   http.begin("http://worldtimeapi.org/api/ip");

exit status 1
Fehler beim Kompilieren für das Board LOLIN(WEMOS) D1 R2 & mini.
WolfgangFranke commented 3 years ago

that change in "src/utcOffset.cpp" works for me, please verify:

/* remove the depricated ESP8266 API call:  
 *HTTPClient http;
 *http.begin("http://worldtimeapi.org/api/ip");
*/

//  use the new API like below:
  WiFiClient client;
  HTTPClient http;
  http.begin(client, "http://worldtimeapi.org/api/ip");