G6EJD / ESP32-e-Paper-Weather-Display

An ESP32 and 2.9", 4.2" or 7.5" ePaper Display reads Weather Underground data via their API and then displays the weather
Other
946 stars 206 forks source link

HTTP error code is not displayed #184

Closed nickGermi closed 2 years ago

nickGermi commented 2 years ago

In common.h file

under bool obtain_wx_data(WiFiClient& client, const String& RequestType) { function you have Serial.printf("connection failed, error: %s", http.errorToString(httpCode).c_str());

For some reason it would not print the error code for me, replacing that with Serial.println(httpCode); did print the error code properly which in my case was error: 400, which turns out, if your city name has a space in it (and I'm guessing that's large percentage of city names), HTTP request fails, you must use + or %20 instead of space in your city name so that HTTP request can succeed, doing so however makes the e-paper dashboard to also show the + sign in city name (not tested with %20). I guess you need to URL encode the uri to prevent this issue.

Another issue I encountered and it was very hard to find the reason was that 3 Color 7.5inch waveshare display is not supported by this application or U8g2_for_Adafruit_GFX.h module, because of insufficient memory in ESP32, I guess a mention of that would be nice.

G6EJD commented 2 years ago

Your display is supported by the GxEPD library and I believe I have included an example to drive that. For city/locations it’s better to use the OWM location number or Lat/Lon, but yes the use of %20 will work although for display purposes would need a replacewith %20 with “ “