-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DCF77 Meteo Data 1 full day decode #5
Comments
Thanks ! My ESP32 can't get a full day from my indoor antenna either, its logs show some holes in the weather data too, and sometimes redundancy between two decodings, which makes me wonder what sort of bug I've created there 🤔 I haven't checked if the DCF77 signal decoding task was still properly timed after the last code changes, it could be a possible regression of a time-shift bug, eventually losing a whole minute of data before being back in sync, or it could just be QRN from the TFT. Hopefully this will get sorted out after the refactoring. Anyway, the With one full weather data block (=3 bytes) every 3mn, the whole 24h data set can't contain more than 480 entries, some of which may address more than one type of forecast. I'll go with 480 of those: struct WeatherForecast {
int hour;
int minute;
uint8_t data[3];
};
WeatherForecast** AllCitiesForecast; // cache all forecasts and 8 of those for the watched city: struct WeatherData {
int hour;
int minute;
int dcw; // Day critical weather
int ncw; // Night critical weather
int xwh; // Extremeweather
int anm1; // Weather anomality 1
int anm2; // Weather anomality 2
int rpb; // Rainprobability
int anm; // Anomaly
int tem; // Temperature
int twodayforecast;
int fourdayforecast;
}; I'll probably use 20 slots of another struct for wind directions and strengths, one for each city. Meanwhile I've been looking for interfaces examples to show DCF77 weather data, and a 160x1218 display obviously can't fit all that. This made me realize using three icons to describe one weather data instance was wrong, so I'll probably, put the wind direction icon in the middle (replacing the atomic icon), remove the rightmost weather icon and reuse the space for windspeed + humidity + temperature. It's a good thing the ButtonC short-push event is currently unassigned, it could end up as a browsing control for the different stored forecasts. Since the 2-3-4 days forecasts ('DO', 'Fr' and 'SA' on the screen capture) don't have humidity, wind strength and windspeed, the display pattern only requires one icon and one text block, this could be scroll material :-) |
I am hoping to get a full days decode by 23:00hrs tonight. I use an Udo Klein Super Filter between my aerial and my ESP32. The filter fills in the gaps if signal is lost. It does not decode the Meteodata though. I 'll also load your latest code once I have finished recording the serial out. Looks like you have made a number of changes in the last few days. I like your idea of the wind and other data on the display |
you just need to change this:
into this:
|
Just loaded your latest version. Thanks for all those updates. I think I have a full days decode now and have included it. Have also gone through a days decode minute by minute and put it onto a spreadsheet so the data can be analized. |
Thanks for this data 👍 So if there's only one label missing in the text version, is it safe to assume the weather decoding logic tree is correct ? I'm rewriting the whole weather display routine where I separate the TFT output from the Serial output (one is more verbose than the other), but there is colateral damage : the binary representation of data chunks is lost. I'll try to come up later with something to restore that low level debug, but I'll stick with the 32 columns model for the Serial output rendering. |
Hi the weather decoding logic looks fine. I am just waiting for my LOLIN D32 Pro V2.0 to arrive then I can have a play with a 240x320 TFT. I will just mix and match my serial display output to match your changes as they happen. |
Have received my LOLIN D32 Pro V2.0. Compiled and loaded OK to my board. |
If you select the corresponding LoLinD32Pro device from the boards menu you don't have any pins to configure provided you're using the 1.4'' TFT model (a ST7735) fitting the special SPI connector, however I'm quite sure it'll also work with an ILI9341 as they share many instructions, and all necessary pins are labelled on the silkscreen. [edit] here's a successful implementation of lolin d-32-pro with an ili9341 with touch spi sharing the tft spi. |
I have checked and I have the correct board selected. Then nothing else. Do I need to config a 320x240 board in the code? |
Maybe I have the TFT connection wrong? [E][UI.h:1126] InitUI(): Successfully created spritePtr Scanning I2C Bus:
01: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Backtrace: 0x4008c9b4:0x3ffbe170 0x4008cbe5:0x3ffbe190 0x400e4ccf:0x3ffbe1b0 0x40085159:0x3ffbe1d0 0x400dbe12:0x3ffaf630 0x400da404:0x3ffaf650 0x400d7285:0x3ffaf670 0x400d7383:0x3ffaf690 0x4008900d:0x3ffaf6b0 Rebooting... |
Indeed CS should be on 14 as indicated by the "T-CS" label on the back of your LoLin D-32-Pro board. I can't decode the backtrace for you (it requires the ELF from your compilation) but there's a tool in the Arduino menu where you can paste the whole message and get a hint. Decoding the exception must be done right after compiling or it won't work. The exception decoder is available in you "tools" menu / ESP Exception decoder, or you can install it from here. Another thing you can do is check the pins for the DCF77, also I2C SDA and SCL, and eventually comment out those lines in esp32-DCF77_Analyzer_Clock/Config.h
... to see if you still get the same error [edit] managed to reproduce the same error message after flashing my TTGO-T1 with the wrong board, the timeout was related to the buttons pins not responding, so keeping |
Not exactly a UI enhancement but I'm testing a lighter weather cache system (maintaining one NVS key per city was a bad idea) this time using an array fed with weather data for all cities, and backed up to NVS (max 5Kb) every hour. Note how the last three minutes of every hour never succeed to decode any weather data, same a in your logs. The weather display logic is still a work in progress and I need to achieve a visible result before I push the changes, so I'll consider this bug as a tech debt unless you tell me you need the weather data for those specific cities. |
Sorry for the late reply have been away.... Scanning I2C Bus:
01: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Meteo Data Decoding Hour 12 Min 55 The display however still does not work. |
re lighter weather cache system |
Just checking. Is my TFT LOLIND32PRO supported yet in the ESP32-Chimera-Core Library? libraries\ESP32-Chimera-Core\boards\d32_pro\variants #include <stdint.h> static const uint8_t LED_BUILTIN = 5; #define TF_CS 4 // TF (Micro SD Card) CS pin #define SS TF_CS |
This variant file is the same as the official one or the other way around if you see how this file was contributed :). While the LoLinD32Pro is supported by the ESP32-Chimera-Core, the defaut display is the Wemos 1.44'' ST7735 (128x128). The TFT_eSPI setup I was using when I got an ILI9341 (+touch) attached to a LoLinD32Pro was quite short because this configuration is using the default pins from variants.h and doesn't need to be customized much. I suggest you isolate this problem by having the display running directly with LovyanGFX using the standalone SPI config example first (change line 85 to match your display), then share your custom configuration (the LGFX_Config + panel choice) so I can see why it isn't working out of the box. [edit] struct Panel_LoLinD32 : public Panel_ST7735S
{
Panel_LoLinD32(void) {
panel_width = 128;
panel_height = 128;
memory_width = 132;
memory_height = 132;
offset_x = 2;
offset_y = 1;
spi_3wire = true;
spi_cs = 14;
spi_dc = 27;
gpio_rst = 33;
gpio_bl = 32;
pwm_ch_bl = 7;
}
}; In order to support ILI9341 instead of ST7735 you probably need to use this config instead : struct Panel_LoLinD32Custom : public Panel_ILI9341
{
Panel_LoLinD32Custom(void) {
panel_width = 320;
panel_height = 240;
memory_width = 320;
memory_height = 240;
//offset_x = 2;
//offset_y = 1;
spi_3wire = true;
spi_cs = 14;
spi_dc = 27;
gpio_rst = 33;
gpio_bl = 32;
pwm_ch_bl = 7;
}
}; |
I am trying the SPI config example. Have set the following I am not sure of these settings |
Missed your edit will give it a go later today. |
Have selected static lgfx::Panel_ILI9341 panel; in LovyanGFX.SPI Have added this ( I presumed not replaced the Panel_ST7735S) struct Panel_LoLinD32Custom : public Panel_ILI9341 Still nothing on the display. |
I just flashed my IL9341/LoLinD32 Pro with the following example sketch and I can see something on the display, #include "LGFX_TFT_eSPI.h"
// for ESP32
struct LGFX_Config
{
static constexpr spi_host_device_t spi_host = VSPI_HOST;
static constexpr int dma_channel = 1;
static constexpr int spi_sclk = 18;
static constexpr int spi_mosi = 23;
static constexpr int spi_miso = 19;
static constexpr int spi_dlen = 8;
};
static lgfx::LGFX_SPI<LGFX_Config> lcd;
static lgfx::Panel_ILI9341 panel;
void setup(void) {
panel.freq_write = 20000000;
panel.freq_fill = 27000000;
panel.freq_read = 16000000;
panel.spi_mode = 0;
panel.spi_mode_read = 0;
panel.len_dummy_read_pixel = 8;
panel.spi_read = true;
panel.spi_3wire = false;
panel.spi_cs = 14;
panel.spi_dc = 27;
panel.gpio_rst = 33;
panel.gpio_bl = 32;
panel.pwm_ch_bl = 7;
panel.backlight_level = true;
panel.invert = false;
panel.rgb_order = false;
panel.memory_width = 320;
panel.memory_height = 240;
panel.panel_width = 320;
panel.panel_height = 240;
panel.offset_x = 0;
panel.offset_y = 0;
panel.rotation = 0;
panel.offset_rotation = 0;
lcd.setPanel(&panel);
lcd.init();
lcd.drawRect(0,0,lcd.width(),lcd.height(),0xFFFF);
lcd.setTextSize(2);
}
uint32_t count = ~0;
void loop(void) {
lcd.startWrite();
lcd.setRotation(++count & 7);
lcd.setTextColor(random(65536));
lcd.drawNumber(lcd.getRotation(), 16, 0);
lcd.setTextColor(0xFF0000U);
lcd.drawString("R", 30, 16);
lcd.setTextColor(0x00FF00U);
lcd.drawString("G", 40, 16);
lcd.setTextColor(0x0000FFU);
lcd.drawString("B", 50, 16);
lcd.drawRect(30,30,lcd.width()-60,lcd.height()-60,random(65536));
lcd.endWrite();
} |
With the analyzer loaded the following is output from the serial port
01: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Backtrace: 0x4008c9b4:0x3ffbe170 0x4008cbe5:0x3ffbe190 0x400e4cb7:0x3ffbe1b0 0x40085159:0x3ffbe1d0 0x40102c9c:0x3ffce470 0x400dbc2a:0x3ffce490 0x40104022:0x3ffce4d0 0x400d4517:0x3ffce510 0x400d70c0:0x3ffce580 0x4008900d:0x3ffce5b0 Rebooting... |
I can't see the ESP exception decoder under the tools menu. |
yay some progress ^^ you can find this line somewhere in UI.h and comment out the #if / #endif around it :
The exception decoder can be downloader here : https://github.com/me-no-dev/EspExceptionDecoder I'll see how I can integrate LGFX configuration to this project, but I'm still refactoring the weather decoding so it'll take some time. |
OK thanks will have a look in the morning and let you know. Thanks for the help. |
Have set #include "UI_320x240.h" as above but display remains the same. I will leave you to complete refactoring the weather decoding before before continuing with the LGFX problem. |
DCF77MeteoDataDecode01..txt
Edit -data is missing from the code I will resend it complete as sson as the new data is ready!
Enclosed 1 full days Meteo Data from 00:00 to 23:59. Maybe you will find this useful.
I have added time to the data at the end of each section using basic serial.print with no leading zeroes added eg 0:3 is 00:03
I am transcribing the data onto a spreadsheet so sections of data can be broken down to see what and when data is sent.
It will take some time to do but can post it if it's of any use.
The text was updated successfully, but these errors were encountered: