0 votes
in ESPaper by (320 points)

Hi Everyone!

I got a ESPaper Plus Kit and followed the instructions given here:

https://docs.thingpulse.com/guides/espaper-plus-kit/

to compile and download the software. First I had no success, it did not compile, I ran into the same error as some other guys, in TimeClient.cpp there was an issue with a modulo operation. I changed TimeClient.cpp according to his thread:

https://github.com/ThingPulse/esp8266-weather-station/issues/148

After that it was compiling and I could download it. It seems to be running, makes updates but it does only very randomly get the actual date and time, thus showing in the top left corner always "Updated: 09:00:00". In this case, also the Sunrise and Sunset times are shifted by one hour. It shows: 9:13 - 17:38 but correct for my location (nothern Switzerland, 25.Dec) would be: 08:13 - 16:38. It shows the correct Sunrise to Sunset time, when it gets the time poperly, but this is nearly never happening.

I tried different NTP Timeservers - no change.

I tried all these Timeservers on my Win7 Computer and it did synchonise. I also connected my ESPaper to a WiFi hotspot provided by my mobile phone, to check if the issue might be related to my WiFi Router, but no change.

Please find here the output of the console:

----------------------------------------------------------------------------------------------------------------------
Loading config
WIFI_SSID = [------------------]
9
WIFI_PASS = [------------------]
9
DISPLAYED_CITY_NAME = [Schaffhausen]
19
OPEN_WEATHER_MAP_APP_ID = [--------------------------------------------------]
23
OPEN_WEATHER_MAP_LOCATION_ID = [2658761]
28
OPEN_WEATHER_MAP_LANGUAGE = [de]
25
Loaded config
State: 1

About to call OpenWeatherMap to fetch station's current data...
Getting url: http://api.openweathermap.org/data/2.5/weather?id=2658761&appid=----------------------------------------------&units=metric&lang=de
[HTTP] GET...
[HTTP] GET... code: 200
start document
Getting url: http://api.openweathermap.org/data/2.5/forecast?id=2658761&appid=---------------------------------------------------------&units=metric&lang=de
[HTTP] GET...
[HTTP] GET... code: 200
start document

Waiting for time
WiFi: 86%
Min temp: -6.860000, max temp: 3.880000
Writing buffer
full init
***********set register Start**********
***********set register  end**********
Going to sleep
--------------------------------------------------------------------------------------------------------------------
As we can see, it says only "Waiting for time" and then shows immediately "WiFi: 86%". Elsewhere here in the forum I found a console output form an other user which shows like this:
----------------------------------------------

Waiting for time

DST Rules Updated:

DST Start: Sun Mar 11 02:00:00 2018

DST End:   Sun Nov  4 01:00:00 2018

-----------------------------------------------

I also wonder, why we don't see any dots (....) beeing printed to the console, because in the source code I found this:

(Line 217 - 228; espaper-weatherstation.ino)

// Wait max. 3 seconds to make sure the time has been sync'ed
  Serial.println("\nWaiting for time");
  unsigned timeout = 3000;
  unsigned start = millis();
  while (millis() - start < timeout) {
    time_t now = time(nullptr);
    if (now) {
      break;
    }
    Serial.println(".");
    delay(100);
  }

To my limited understanding (I might be wrong!!) it should print dots every 100ms till it "now" is not "0" or the 3'000ms have passed. By the way, increasing the timeout to 6000ms did not help.

I am using the Arduino IDE 1.8.8

downloaded the source code yesterday(25.12.2018) from here: https://github.com/ThingPulse/espaper-weatherstation/archive/master.zip

the libraries versions are as follows:

Mini Grafx by Daniel Eichhorn: Version 1.0.0

ESP8266 Weather Station by ThingPulse: Version 1.6.5

Json Streaming Parser by Daniel Eichhorn Version: 1.0.5

simpleDSTadjust by neptune2 Version: 1.2.0

Any help much appreciated!

sergio

by (19.9k points)
You mentioning the compile issue indicates you use ESP8266 Arduino-core 2.5.0-beta, right? Have you tried downgrading to the recommend 2.4.2 release?

"why we don't see any dots (....)" -  `if (now)` appears to be truthy in which case execution breaks out of the loop.
by (19.9k points)
There is definitely something fishy with NTP in the 2.5 beta: https://github.com/esp8266/Arduino/issues/5564

1 Answer

0 votes
by (320 points)
Hi Marcel,

sorry for my late response! You are perfectly right, for reasons not noticed by me (maybe Uprading the Arduino IDE?) ESP8266 Arduino-core 2.5.0-beta was installed and used. As soon as I "downgraded" to the recomended version 2.4.2 the compillation error as well as the issue with not getting the time properly were solved!

Sorry, my bad!

And thank's a lot for the support!

sergio
by (19.9k points)
We do document which version to use at https://docs.thingpulse.com/guides/espaper-plus-kit/#install-the-esp8266-toolchain but I'm really annoyed how this currently works in the Arduino world. It's way too easy for users to work with the "wrong" version. See https://twitter.com/thingpulse/status/1078378584568414208.

Welcome to ThingPulse Q&A, where you can ask questions and receive answers from other members of the community.

https://thingpulse.com

...