0 votes
in WeatherStationClassic by (170 points)

I have bought the kit from Amazon.

I have followed all the steps of the Guide Manual but there was an error during the compilation process. The message is:

Arduino: 1.8.8 (Windows Store 1.8.19.0) (Windows 10), Placa:"NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled, 4M (no SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200" 

C:\Users\Laboratório\Documents\Arduino\libraries\esp8266-weather-station-master\src\TimeClient.cpp: In member function 'long int TimeClient::getCurrentEpochWithUtcOffset()': 

C:\Users\Laboratório\Documents\Arduino\libraries\esp8266-weather-station-master\src\TimeClient.cpp:124:67: error: invalid operands of types 'double' and 'long int' to binary 'operator%' 

   return round(getCurrentEpoch() + 3600 * myUtcOffset + 86400L) % 86400L; 

exit status 1

Erro compilando para a placa NodeMCU 1.0 (ESP-12E Module)

2 Answers

0 votes
by (19.9k points)
 
Best answer

You are apparently not using the latest version of the Weather Station library. The line 

return round(getCurrentEpoch() + 3600 * myUtcOffset + 86400L) % 86400L; 

was changed last December. See https://github.com/ThingPulse/esp8266-weather-station/commit/20441ecac1d390f06b9747d8ea30bfe19b98f428 for details. It was subsequently released as v1.6.5.

The old code worked fine up until ESP8266 Arduino Core 2.4.2 but not with 2.5 onwards.

by (170 points)
Thanks. I've downloaded the right one.
+1 vote
by (3.6k points)
You should check in the Boards Manager what version of the ESP8266 core you are using? 2.4.2?
by (170 points)
Thanks for answering.

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

https://thingpulse.com

...