New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)

Subforum for general discussions. Do not dump your questions/problems here, but try to find the subforum where it belongs!

Moderators: leecollings, remb0

marexsc
Posts: 5
Joined: Monday 27 January 2025 22:19
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)

Post by marexsc »

Just dimming the display backlight doesn't do much - I tried, but it's more about bland or not very intense colors. It's like too little sharpness or contrast, unfortunately our TFT display doesn't support these functions. I hope I'm wrong because I'd also like it to be clearer.
Thorgal789
Posts: 849
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)

Post by Thorgal789 »

What is your device ? it's a 2432S028R ? You know the version ? Else how many USB port you have, mini-USB and USB-C ?
I have a 2432S028R with 1 USB-C + 1 Mini USB (it's the native version, without edition in platformio.ini file)


Used with Dark mode and brightness to 25 % (Yes, I think too thoses devices have too much luminosity) and I haven't problem. I can add 10% but if in your side it have an impact on color and not luminosity it's naother problem, on my side this option realy have an impact on the "light producted" by the device.
marexsc
Posts: 5
Joined: Monday 27 January 2025 22:19
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)

Post by marexsc »

My device is 2432S028 without any letters, version with 1xUSB USBmini 1xUSB C, I'm not entirely sure but the driver is probably ili9432 (backlight gpio 21, LDR gpio34), and maybe that's the problem because at the moment I'm working on 2432S028R and ili9431 driver.
marexsc
Posts: 5
Joined: Monday 27 January 2025 22:19
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)

Post by marexsc »

The image is a sample of what the difference is, the second display is "Openhasp"
Attachments
Cyd&Openhasp.jpg
Cyd&Openhasp.jpg (114.67 KiB) Viewed 1653 times
Thorgal789
Posts: 849
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)

Post by Thorgal789 »

I think I have same.
It's the defaut config, you haven't edited anything in platoformio file ?
So it use the driver TFT_ESPI

Code: Select all

	-DTFT_ESPI=1
	#-DLOVYANGFX=1
	#-DARDUINO_GFX
(You can try with the 2 other)
The backlight GPIO is 21 yes, but the gpio 34 is the light sensor for me (CDS).

And your device is blinking ? On your capture you have one device with a dark theme and the other with a lighter, so hard to compare.
The dark theme don't use a black color, it's more a "dark grey".

Image

It's an older version, but colors are same.

If you want I can give you a code to replace the "dark grey" by a full dark ?
Make a try with the "light" theme ?
Thorgal789
Posts: 849
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)

Post by Thorgal789 »

Have updated the "master" code on github. There is a corrective about domoticz device id, I don't remember what is was, but can make a try.
There is too the "light websocket" support and the OTA, so now you can update the device only using Wifi.
kniazio
Posts: 200
Joined: Thursday 06 October 2016 8:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.7243
Contact:

Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)

Post by kniazio »

Thorgal789 wrote: Saturday 01 February 2025 12:40 Have updated the "master" code on github. There is a corrective about domoticz device id, I don't remember what is was, but can make a try.
There is too the "light websocket" support and the OTA, so now you can update the device only using Wifi.
Is this the webserver? How to upload OTA?
Attachments
cyd_webserwer.png
cyd_webserwer.png (97.47 KiB) Viewed 1344 times
Kedi
Posts: 569
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)

Post by Kedi »

Put /update after the 192.168.1.117 -> 192.168.1.117/update
Logic will get you from A to B. Imagination will take you everywhere.
Thorgal789
Posts: 849
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)

Post by Thorgal789 »

Ha yes, I forget to describe OTA, I will update the Github in 20 mn.
There is 2 options for OTA, PUSHOTA and PULLOTA you can enable one of them or nothing (not both ofc).

PUSHOTA Enable the OTA in PUSH mode, it mean there is a webserver that run permanently, youcan access it using /update as url.
PULLOTA can be used using the GUI, on the device itself, using the first menu, it will download itself the new firmware, but for the moment the url is hardcoded (not sure people will use this mode, I think I m the only one to prefer the PULLOTA)

In ota.cpp

Code: Select all

const char url[] = "http://192.168.1.81:8080/firmware.bin";
marexsc
Posts: 5
Joined: Monday 27 January 2025 22:19
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)

Post by marexsc »

If you can, send the black color you mentioned earlier.
Thorgal789
Posts: 849
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)

Post by Thorgal789 »

About the "dark grey" Im using ?
If you are using the dark theme, the code is in file main_ui.cpp

Code: Select all

else
    {
        background = lv_palette_darken(LV_PALETTE_GREY, 4);
        lv_style_set_shadow_color(&style_shadow,  lv_palette_darken(LV_PALETTE_GREY, 2));
    }
    lv_style_set_bg_color(&style_shadow, background);
For information

Code: Select all

For the lighter variants of a palette color use lv_color_t c = lv_palette_lighten(LV_PALETTE_..., v). v can be 1..5. For the darker variants of a palette color use lv_color_t c = lv_palette_darken(LV_PALETTE_..., v). v can be 1..4.
You want to make the color more black ?

Code: Select all

background = lv_color_hex(0x000000);
Kedi
Posts: 569
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)

Post by Kedi »

I love it :D , but just a few remarks:
1. Personnal is incorrect, it should be personal with just 1 'n'
2. Personally I like the black background beter, perhaps that var could be transfered to the personal_settings.h file. So everybody could use its own personal background color more easily.
3. I switched in the info tab the order of baro and utility to be consistent with Domoticz, and also changed the baro into weather like in Domoticz.
Logic will get you from A to B. Imagination will take you everywhere.
Thorgal789
Posts: 849
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)

Post by Thorgal789 »

Arf, I have just made the release with the typo ....

1 - Corrected, but too late now
2- My GF too, and you are not alone, so for the moment full black is the defaut, the problem is I m using a fonction to generate the palette, and it use only a bool value, so it can be only on or off, not possible to make a third "custom" option, I need lot of settings to have a full custom palette.
3- Corrected too, have increased the tab size and and a capital letter too.

Change on the "test" branch.

Edit:
You haven't a "persistence phenomenon" with the full dark color ? (we can guess the widget even if the display is using a full colored backgound)
Ltech
Posts: 4
Joined: Sunday 23 February 2025 21:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)

Post by Ltech »

I love it!

Running on esp32-8048S070C in 10 minutes

And I convert it for the esp32-8048S050C.
Only trouble is the timeout. If I put the screen on 50%, it jumps to 100% and not 0% after timeout.. It is inverted

I put my config in attachment

I can't get it to GIT
esp32-8048S050C.h
(3.11 KiB) Downloaded 11 times
screen_driver.cpp
(15.79 KiB) Downloaded 11 times
Last edited by Ltech on Sunday 23 February 2025 21:40, edited 1 time in total.
Thorgal789
Posts: 849
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)

Post by Thorgal789 »

Ltech wrote: Sunday 23 February 2025 21:23
Oups, sorry have just see your comment.
Thx I will add it tommorrow to the github.

About your issue, it only happen with the "standby mode" ? I mean , if you set it to 25% or 75% using the setting panel you haven't issue, or it's reversed too ?

I m seing you have edited the code

Code: Select all

screen_setBrightness(254);
It's to correct your issue ?
Thorgal789
Posts: 849
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)

Post by Thorgal789 »

Ok so I hav found nothing about your issue, nothing similar, and no settings to 'invert" the brighness so have just used a hack

Code: Select all

#ifdef ESP32_8048S050C
    brightness = 255 - brightness;
#endif
The code is updated on the "test" branch
Ltech
Posts: 4
Joined: Sunday 23 February 2025 21:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)

Post by Ltech »

No this is only inverting the brightness. The brightness setting mode was fine.

When the sleep mode is activated, it turns to 100% brightness, no to 0%
It has to be somewhere else.

So on first touch, the monitor go back to 50% from 100% after leep mode (wake timeout)

In you modification it is only inverting the default brightness setting, not the screen sleep brightness setting

I guess the backlight led is driven inverted. When in pwm those are pulses, when in sleep it is an fix level...
Thorgal789
Posts: 849
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)

Post by Thorgal789 »

Ltech wrote: Monday 10 March 2025 8:33 In you modification it is only inverting the default brightness setting, not the screen sleep brightness setting
The "hack" invert all brightness, it need to work for all requests, even the sleep brightness.
You mean with it the normal setting for brightness is reversed but you still have the same issue ?

The fonction is screen_timer_sleep() and inside there is

Code: Select all

screen_setBrightness(0);
So without the hack the value stay 0 and with the hack it become 255, not possible you still have the same result .....

I have just see this fonction

Code: Select all

void set_screen_brightness()
{
    if (global_config.brightness < 32)
        screen_setBrightness(255);
    else
        screen_setBrightness(global_config.brightness);
}
It's called on "wake up", so for you it's again 50% if I m right.
I guess the backlight led is driven inverted. When in pwm those are pulses, when in sleep it is an fix level...

Code: Select all

screen_setBrightness(0);
And if you remove my hack and use value 1 ? Perhaps the issue is only for 0.

I m reducting the frequency too, but I don't think it can have an impact on brightness ....
Ltech
Posts: 4
Joined: Sunday 23 February 2025 21:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)

Post by Ltech »

Yes, this make it works! Thank-you ! :D

You can publish the 5" sunton

Was this my mistake trying to make the screen working?
screen_setBrightness(254) => screen_setBrightness(0)

Code: Select all

#ifdef AUTO_BRIGHTNESS
....
#else

    screen_setBrightness(0);
    isScreenInSleep = true;

    // Screen is off, no need to make the cpu run fast, the user won't notice ;)
    setCpuFrequencyMhz(CPU_FREQ_LOW);
    Serial.printf("CPU Speed: %d MHz\n", ESP.getCpuFreqMHz());
#endif
}
Thorgal789
Posts: 849
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)

Post by Thorgal789 »

Was this my mistake trying to make the screen working?
IDK ^^, depend if this code was here before or after your issue.
Im doing same, it s for that there is so much disabled code, I m not able to remember if it's usefull or not.

So what is the final solution ? to add it officially on github.

Rool back to

Code: Select all

screen_setBrightness(0);
only ? No more changes ? Can remove the hack or still need it ?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest