ESP8266-Weather-Widget-V20/

I found on https://www.instructables.com/ESP8266-Weather-Widget-V20/ a very nice project and I'm trying to accomplish it. I encounter a compile error : C:\Users\mikem\AppData\Local\arduino\sketches\4E07D2BD3F6C2093F1C529F6DE0CCB45\sketch\esp8266-weather-station-color.ino.cpp.o: in function _Z10updateDatav': C:\Users\mikem\Documents\esp8266-weather-station-color\esp8266-weather-station-color/TZinfo.h:332: undefined reference to _ZN11SunMoonCalc23calculateSunAndMoonDataEv'
collect2.exe: error: ld returned 1 exit status
exit status 1

I saw on Instructables many people who built it, I just have no way to contact them for help not even ThingPulse who seems to be the author of this project.

I have built that and, in fact, fixed a bug in it. That collection error, though, I think, is an error in your setup.

The line it is complaining about is

  if (timezone == "Europe/Athens")	return PSTR("EET-2EEST,M3.5.0/3,M10.5.0/4");

As you can see that does not look like the string in the error message. The error message is referencing the normal part of the Arduino build process but something has gone wrong and I suspect you assumed one install method when this one uses a different.
Did you perhaps try to erroneously edit the TZInfo.h file? As you can see the error does NOT appear in the TZInfo.h file.
It appears the file being verified is a temp file, make sure there are no outstanding edits (. on file tab).
If you followed the exact install instructions (this one is a bit different) it should work but since I can't see what you did it is difficult.
If you want to start over with a clean install and show me via screen grab each step then maybe I can spot something.

Check if SunMoonCalc.cpp exists

  • Go to the project folder:
    C:\Users\mikem\Documents\esp8266-weather-station-color\esp8266-weather-station-color\
  • Look for a file named: SunMoonCalc.cpp

If it doesn't exist, that's the problem. The function is declared but has no implementation. You’ll need to get the complete file.

I have SunMoonCalc . h not .cpp

How can I fix it, please?

It is my third attempt, following the instruction letter by letter, still the same result.

I mean, starting from scratch, all clean.

Here are the steps I followed:
Arduino Code:

https://github.com/ThingPulse/esp8266-weather-stat...

Libraries:

  1. Mini Grafx by Daniel Eichhorn

  2. ESP8266 WeatherStation by Daniel Eichhorn

  3. Json Streaming Parser by Daniel Eichhorn

  4. ThingPulse XPT2046 Touch by ThingPulse (forked from Paul Stoffregen), if you had previously installed the original XPT2046_Touchscreen then you need to uninstall that one!

After downloading the library unzip it and installed it with your Arduino Library Manager in

Sketch > Include Library > Manage Libraries...

The sketch opens in IDE with many tabs.
Using Verify it run for about 60% and I get the mentioned error.
I even made nice case, 3D printed.
I have the API key, I configured the WIFI, location code.

This step is wrong. You do NOT unzip the download, you do the Sketch > Include Library > Add .Zip Library... then select the zip.

I never did what you have in step 4. That library has been read-only since 2021.

I just compiled the project with no problems.
I think you may have a damaged file. Your problem is that you think you have uninstalled and started over, but you either missed some parts or caching is involved.
On my Mac it is easy to remove everything and start over, no idea how linux works and not 100% sure about Windows.
Do you have other projects? If not use the standard windows uninstall procedure to uninstall the IDE (both 1.x and 2.x if you have both) NOW look for Arduino15. Since you did not follow the directions to post all code in code tags and all errors in code tags I don;t know the path so you will need to find it. The quick way is to copy the error log to notepad or similar, then do a find on Arduino15 (case sensitive). Now remove that directory and all sub-directories from your PC. Now start over with installing IDE2 then the 8266 boards as below

(https://arduino.esp8266.com/stable/package_esp8266com_index.json)

I assume you know how to do that. Now, install the libraries using the library manager or sketch install from a zip.

There is no such file in the "esp8266-weather-station-color" sketch:

The file is in the "ESP8266 Weather Station" library (which is a dependency of the "esp8266-weather-station-color" sketch:

https://github.com/ThingPulse/esp8266-weather-station/blob/master/src/SunMoonCalc.cpp


It is no longer necessary to use the ThingPulse fork of the library, as is explained in the readme of the fork:

https://github.com/ThingPulse/XPT2046_Touchscreen#xpt2046-touchscreen-arduino-library

Update 2021-08-24: this is no longer relevant as the underlying issue was addressed with Release Version 1.4 · PaulStoffregen/XPT2046_Touchscreen · GitHub. Please use XPT2046_Touchscreen >=1.4.

So you can simply install the "XPT2046_Touchscreen" library via the Arduino IDE Library Manager.

Starting from from scratch, now, cleaning all, I will keep you posted.

Starting from from scratch, now, cleaning all, I will keep you posted!

Have you read and understood post 9, that changes the install, maybe you were following the old install that will not work, you have to follow the new install.

Please, what is the new install? I'm simply following what it is available on Instructables.

Let me check instructables first. Did you read and understand post 9 that tells you some of the new?

Here is the new procedure, only one library to download plus the sketch of course, the other 3 libraries are standard and can be installed from the Library Manager.

All four can be installed via Library Manager. Unfortunately they wrote the name of the library wrong in those instructions. The actual name of the library is "ESP8266 Weather Station", not "ESP8266 WeatherStation". If you search for the correct library in Library Manager you will see it there.

It wsould be nice if the libraries search box was 'smarter'

I downloaded ESP8266 WeatherStation and installed it.
I downloaded https://github.com/ThingPulse/esp8266-weather-stat... unzipped and started in IDE, ready to start Verify

You need to be much more clear. Why do you not do screen grabs so we know EXACTLY what you mean. Here is my problem

Don't forget you need to make a few edits for WiFi, API Key, TimeZone maybe a few more.

All those edits are done, this is my second weather station, first it is working, just too small display.