tobozo / esp32-DCF77_Analyzer_Clock

⏰ An ESP32 TFT interpretation of the @deruiter's DCF77-Analyzer-Clock-V2.0
MIT License
24 stars 9 forks source link

Compile Issue UI.h:65: error: 'class TFT_eSprite' has no member named 'setTextStyle' #3

Open brettoliver opened 4 years ago

brettoliver commented 4 years ago

Hi I have a complile issue see full text below. I am using a TTGO TS V1.2. If I comment out the line 65 in UI.h "sprite->setTextStyle( myStyle );" the compile completes and the program loads with this display- http://www.brettoliver.org.uk/ESP32Analyzer.jpg

I am not sure what effect this line has but the Date and time are not centered and the display has some coloured blocks missing. I also don't get any scrolling meteo txt as per your demo. I do get some weather icon though.

Regards. Brett.


_Error txt

Arduino: 1.8.5 (Windows 10), Board: "TTGO T1, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"

Build options changed, rebuilding all
In file included from J:\My Documents\Arduino\Sketches\DCF77 ESP32 Analyzer Clock\esp32-DCF77_Analyzer_Clock\esp32-DCF77_Analyzer_Clock.ino:78:0:

sketch\UI.h: In function 'void setTextStyle(TFT_eSprite*, TextStyle*)':

UI.h:65: error: 'class TFT_eSprite' has no member named 'setTextStyle'

  sprite->setTextStyle( myStyle );

          ^

Multiple libraries were found for "SD.h"
 Used: C:\Users\Brett\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\SD
 Not used: J:\My Documents\Arduino\Sketches\libraries\SD
 Not used: C:\Program Files (x86)\arduino-1.8.5\libraries\SD
exit status 1
'class TFT_eSprite' has no member named 'setTextStyle'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences._
tobozo commented 4 years ago

Brett,

Thanks for the detailed report.

ESP32-Chimera-Core and LovyanGFX should both be updated from the library manager in order to fix that error.

Here's a snap of my library versions for reference

image

Text-scrolling was disabled when this project moved from the official TFT_eSPI to LovyanGFX driver, some refactoring is required before I can make it work again.

Meanwhile the meteo indicator is working a bit differently, it shows icons for the three possible forecasts based on the latest meteo block, without displaying the city name as I haven't firgured out yet how to re-implement the text scrolling.

The weather info is more talkative in the serial console when you compile with a different debug level though (debug level=warning is a good start).

But first I need to think about a way to select the preferred city from the UI, save it into the NVS, and use that info to filter the weather data that will be scrolled on the display.

brettoliver commented 4 years ago

Thanks for that. My ESP32-Chimera-Core was OK but the LovyanGFX library was out of date. This has fixed the compile issue as well as the date and time centering problem.

The meteo data was going to be my next question as I was going to ask how I set my location from the country and city codes listed but looks like you are working on it already.

tobozo commented 4 years ago

I'll be pushing soon some changes to allow Country+City selection at boot time, this gives back the required precision to the weather icons and filters out from the display any information not relative to the selected Country+City.

The Country+City selection is rudimentary with a very basic pagination system of 90 unsorted item, but it will remember your choice on further boots.

After a Country+City selection has been saved, the menu will only be visible upon next boots during a timeout period :

brettoliver commented 4 years ago

That sounds like a good idea. Thanks for the updates. Have been checking all the info on the serial outputs from the meteo data. Loads of great data here- have not been able to read meteo data before! Thinking I may connect a 2nd TFT via a UNO and the serial out to display this info on a scrolling display.

tobozo commented 4 years ago

Although it was quite easy to match weather data with icons, I haven't been able to figure out what a full 24h dataset represents in terms completeness for a given city.

From what I've understood it seems that some information is related to the "now", while some is related to two-days and four-days forecasts, but I still wonder what the bigger picture looks like and how far the UI can go to restitute the best of this collected data.

brettoliver commented 4 years ago

Thanks for the update the week number etc now display correctly. I notice the weekday indicator only has 6 marks instead of 7. My clock reads today as Friday not Thursday. Not sure if it's possible but could the day of the week be hilighted instead of indicated by a marker? May make it easier to read.

Weather data Had a qucik readup and it looks like there are 90 meteorological regions in total: 60 regions with 4-day forecast, 30 regions with 2-day forecast. Looking at the serial output each city is output every 3 minutes. Without looking at a full days worth of data maybe this equates to 300 bits of data needed to get a full 4day/2day forecast. Each data taking 3mins so is that 15hours to get a full 4day forecast over all 90 regions? Each forecast is labled day 1 to 4 with a city name (some will be day 1 to 2).

Maybe you could display it with scrolling txt eg for today City Name Day1 would be Thurs followed by all weather data for that day. Then day 2 would be Thurs +1 or Fri followed by day 2 weather data etc etc.

It would take upto 15hours to gather all data for a particular city depending where it is in the loop. While wtg for data you could just show eg Sat waiting data.

Edit You would only scroll data for your chosen city selected on your new boot menu.

brettoliver commented 4 years ago

Had a further look. Does not seem as simple as that. I found this line in the DCF77_Weather.h "Between 21:00-23:59 significant weather & temperature is for cities 60-89 wind and wind direction for cities 0-59".

I will try and capture a whole days data just to see the full order.

tobozo commented 4 years ago

This link will probably be helpful : https://www.dcf77logs.de/logs/DcfLog_20200709/dcf

brettoliver commented 4 years ago

Hope you don't mind and maybe if you like the idea you could implement it. Have enclosed a photo shop of the display with a couple of changes. The main one is to add 0 indication on the inner ring where data received is 0 value. This would show the progress of the bit number. I wish I had added this to my LED version of this clock as when you get lots of 0s it's hard to track progress of the bit number.

Great work on this clock BTW. The new version loaded up my weather icons for London overnight. Can't wait to get it built into a case!

ESP32Analyzer3

tobozo commented 4 years ago

Brett,

thanks for you insight on the weather data, and also for these clear suggestions :+1:

Keep in mind some ttgo-t1 models can't have their TFT turned off and will have a shorter life.

Please let me know if you choose another build with a different TFT as the 320x240 design will need some tuning.

brettoliver commented 4 years ago

I would love to build on a 2.2" 320x240 ILI9341 if that's possible?

Can it be built off an ESP32 WROOM module 30/36pin and then add a 320x240 TFT? ESP32_30pin

tobozo commented 4 years ago

I haven't tested on a custom build but it should be okay since the TTGO-TS is a Wroom and this pic shows more than enough available pins for this project to work.

A little warning though: customizing the pinout may be problematic because I'm not sure how ESP32-Chimera-Core and LovyanGFX can handle user-specific settings without modifying the library code (and lose your modifications on next library update).

The easiest way I can think of to get around that situation is to pick one of the existing ILI9341 profiles (namely Odroid-Go, Wrover-Kit or M5Stack) and use in your build the exact same pin numbers at least for the display and the buttons, thus mimicking the chosen profile. All you will need is to select the chosen board (Odroid-Go or Wrover Kit or M5Stack) from the boards menu before compiling/flashing.

As a reference the ESP32-Chimera-Core supported devices and their pin number profiles (display/buttons/speaker/SD) are listed here and abstracted (display only) here.

brettoliver commented 4 years ago

Have been looking into a board for a 320x240 TFT ili9341 display. I have ruled out some due to cost but the D-Duino-32-XS https://www.ebay.co.uk/itm/LoLin-D-Duino-32-with-ESP-WROOM-32-and-OLED-display-Free-1st-class-post/123103316501?hash=item1ca9878a15:g:AL4AAOSwutpZltEr

or the LOLIN D32 Pro V2.0.0 says "Support coming soon:"

Look good. Have you tried any of these boards?

tobozo commented 4 years ago

I have both of these boards and I know they have worked, but haven't tested them since the TFT_eSPI => LovyanGFX migration. There should be a partial support (no SD, no MPU) in the Chimera Core provided the devices are listed in the Arduino Boards menu, please let me know if anything is missing.

[edit] note there are two models of d-duino-32-xs, make sure you get the one with the TFT, because the ebay link seems to be one of those with an OLED instead :-)

I got mine from here, they're all coming from Singapour anyway.