wim57 wrote: ↑Saturday 13 April 2024 9:53
I tried with another unit and everything was fine, so maybe I made some mistake the first time.
Sadly, I have to correct my previous post. I tried the first unit once more and the display looked like below. Both are ESP32-2432S028 but one is USB-C and the other is micro-USB, so the hardware/display controller may be different. The USB-C is the one that is working ok. The malformed display seems to be in portrait mode where the other one shows landscape.
Ha yes, I see the problem, you need to play with rotation and wifth/height.
I will search the correct setting today, but yes there is different hardware, have already see this issue.
It's a custom setting for the ILI9341 chipset but in landscape mode. And honnestly I can't say if color are fine on your capture ^^ (from that I have read using a different chipset have impact on color more than display).
So for the moment we can keep the same driver, the same chipset and just try with rotation.
Always in the json file
Well, I don't understand which json you mean. I can only find the board definition in esp32-2432S028R.json which mentions DILI9342_DRIVER=1.
Changing DTFT_ROTATION in this definition does not change anything (on both boards) so maybe this is not the right place.
For now I will stick to the previous version of the test branch that works on both boards.
Edit: removed remark about refresh after wake timeout because it was not correct.
For now I will stick to the previous version of the test branch that works on both boards
You have the branch version, for I compare code ? I can understand how you can have different result on the actual one but I don't understand how the code can work for both previosuly .... Perhaps I was using a different driver.
Edit: removed remark about refresh after wake timeout because it was not correct.
You can be right too, I have never tested this part as I use the 100% always powered mode, the working mode is strange, It turn off the light AND decrease the CPU rate. The incomings requests are still managed but IDK how a reduced CPU usage can have as impact on them.
But this code had width and height reversed, and for this I can't make rollback, I need to find a "homogeneity".
Try to edit direclty screen_driver.cpp, line 526.
I downloaded the latest test branch, just to make sure no changes are missing.
Line 526 in sreen_driver.cpp was already as you described, but it did not change anything.
The version of the test branch that I used before works on both units, only the colors are different.
Ah, I thought I needed to change it TO zero.
If I change it to 1, 2 or 3 the screen is still not good.
But when I change the driver from ILI9342 to ILI9341 (which is in my other version) the screen is readable but rotated (heigth and with swapped?).
Again, I can put 1, 2 or 3 in screen_driver.cpp but that stays the same. So, at least, driver ILI9341 seems to work better for my board.
//#define ILI9341_DRIVER // Generic driver for common displays
//#define ILI9341_2_DRIVER // Alternative ILI9341 driver, see https://github.com/Bodmer/TFT_eSPI/issues/1172
//#define ILI9342_DRIVER // Landscape default orientation variant of ILI9341
But as the code is working in landscape, I need this mode.
This hardware probably need a ILI9341_1_DRIVER, it's possible too using the false resolution and ILI9341_DRIVER, and force the resolution with the constructor fonction on line 41 on screen_driver.cpp file
Yep, it's the same "garbage" screen.
But with this driver, you have more values to make test in esp32-2432S028R_old.json
Can just try with reversing for exemple
I try to add some status to the Home Screen, On/ Off status of a switch (now only displaying the On status), and the open/ closed status of the blinds. The On/ Off status works, but not the Open/ Closed status of a blind. I tried to modify the Home panel.ccp file:
lv_obj_set_style_img_recolor(img, color, 0);
// Display a "on" icon
if (d->type < TYPE_SWITCH && strcmp(d->data, "On") == 0)
{
lv_obj_t * label = lv_label_create(Button_icon);
lv_obj_set_style_text_color(label, color, 0);
lv_obj_align_to(label, img, LV_ALIGN_OUT_RIGHT_BOTTOM, 0, 0);
//lv_obj_set_style_border_width(label, 5, 0); // To make it visible
lv_label_set_text(label, " On");
}
// Display a "Off" icon
if (d->type < TYPE_SWITCH && strcmp(d->data, "Off") == 0)
{
lv_obj_t * label = lv_label_create(Button_icon);
lv_obj_set_style_text_color(label, color, 0);
lv_obj_align_to(label, img, LV_ALIGN_OUT_RIGHT_BOTTOM, 0, 0);
//lv_obj_set_style_border_width(label, 5, 0); // To make it visible
lv_label_set_text(label, " Off");
}
// Display a "Open" icon
if (d->type < TYPE_BLINDS && strcmp(d->data, "Open") == 0)
{
lv_obj_t * label = lv_label_create(Button_icon);
lv_obj_set_style_text_color(label, color, 0);
lv_obj_align_to(label, img, LV_ALIGN_OUT_RIGHT_BOTTOM, 0, 0);
//lv_obj_set_style_border_width(label, 5, 0); // To make it visible
lv_label_set_text(label, " Open");
}
// Display a "Closed" icon
if (d->type < TYPE_BLINDS && strcmp(d->data, "Closed") == 0)
{
lv_obj_t * label = lv_label_create(Button_icon);
lv_obj_set_style_text_color(label, color, 0);
lv_obj_align_to(label, img, LV_ALIGN_OUT_RIGHT_BOTTOM, 0, 0);
//lv_obj_set_style_border_width(label, 5, 0); // To make it visible
lv_label_set_text(label, " Closed");
}
/*Create description*/
if (d->type == TYPE_BLINDS && strcmp(d->data, "Open") == 0)
You can too "factorise" the code, to avoid to have common command.
I m too on this code part, I don't realy like the "on" text.
My first idea was to use 'image concanetation" for exemple an icon with just the bulb and another with ray added or not according to state, but a complete icon take the same size ....
I m searching too an "image effect" to do on the actual icon, but no ideas. Different color, no, we can think it's another device type, a circle, bof, a glowing effect, not visible enought, change the background, ugly too.
A small icon close the first one ? but need one for bulb and at least 2 for covering ....
About the icon change, there is a fonction that return the icon to use
if (d->type == TYPE_BLINDS && strcmp(d->data, "Open") == 0)
You can too "factorise" the code, to avoid to have common command.
I m too on this code part, I don't realy like the "on" text.
My first idea was to use 'image concanetation" for exemple an icon with just the bulb and another with ray added or not according to state, but a complete icon take the same size ....
I m searching too an "image effect" to do on the actual icon, but no ideas. Different color, no, we can think it's another device type, a circle, bof, a glowing effect, not visible enought, change the background, ugly too.
A small icon close the first one ? but need one for bulb and at least 2 for covering ....
About the icon change, there is a fonction that return the icon to use
if (d->type == TYPE_BLINDS && strcmp(d->data, "Open") == 0)
I was suprised that it didn't work.
Even more confusing was when i replaced "Open " with "On" the text On and Open in the Switch (bulb) icon was mixed up.
I dublicated the code to try, and when it worked, "factorise" it to avoid common commands.
For me i like the On, Off, Open, Closed as text in a icon.
I manage to fix the Swedish font åäö to my project
I made new files (lv_font_montserrat_10.c + lv_font_montserrat_12.c) with the same input as the original (find the settings in top of the file) and then added the swedish fonts åäö ÅÄÖ with online converter https://lvgl.io/tools/fontconverter
settings.png (10.6 KiB) Viewed 2145 times
When i change the file Montserrat_Bold_14 ESP32 crash when doing setup page for Domoticz so i try some more there..
Thorgal789 wrote: ↑Saturday 27 April 2024 12:13
Ha yes, I m reading the value, data don't contain "open" or "closed" but the level (except for 0 and 100 value, so only full closed or full open)