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

deserializeJson() failed: InvalidInput error #195

Closed EddyL113 closed 1 year ago

EddyL113 commented 1 year ago

I'm getting this issue after it started working for a few hours. I'm using the 2.9 Waveshare(GxEPD2_290_T94_V2 driver). The wifi is fine but I do also get an occasional failed to obtain time error.

Here is the console: Connecting to: ---------- WiFi connected at: ------------- 2 3 4

Creating object...and deserializeJson() failed: InvalidInput

Creating object...and deserializeJson() failed: InvalidInput 4

Creating object...and deserializeJson() failed: InvalidInput

Creating object...and deserializeJson() failed: InvalidInput Entering 1489-secs of sleep time Awake for : 3.698-secs Starting deep-sleep period...

Here is the code where it's failing:

void setup() { StartTime = millis(); Serial.begin(115200); while (!Serial); Serial.println(FILE); if (StartWiFi() == WL_CONNECTED && SetupTime() == true) { bool WakeUp = false; if (WakeupHour > SleepHour) { Serial.println("1"); WakeUp = (CurrentHour >= WakeupHour || CurrentHour <= SleepHour); } else { Serial.println("2"); WakeUp = (CurrentHour >= WakeupHour && CurrentHour <= SleepHour); } if (WakeUp) { Serial.println("3"); InitialiseDisplay(); // Give screen time to initialise by getting weather data! byte Attempts = 1; bool RxWeather = false, RxForecast = false; WiFiClient client; // wifi client object while ((RxWeather == false || RxForecast == false) && Attempts <= 2) { // Try up-to 2 time for Weather and Forecast data Serial.println("4"); if (RxWeather == false) RxWeather = obtain_wx_data(client, "weather"); if (RxForecast == false) RxForecast = obtain_wx_data(client, "forecast"); Attempts++; } if (RxWeather && RxForecast) { // Only if received both Weather or Forecast proceed Serial.println("5"); GetHighsandLows();; StopWiFi(); // Reduces power consumption DisplayWeather(); display.display(false); // Full screen update mode } } } BeginSleep(); }

Any ideas?

G6EJD commented 1 year ago

These types of error are almost always due to a link problem. Are you are to connect to a Router rather than mobile phone?