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

DiaDomo
Posts: 37
Joined: Saturday 28 March 2020 13:55
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

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

Post by DiaDomo »

Nice project! Is it possible to use the Arduino IDE or another easy way to upload the bin file to the CYD?
I don't have Visual Studio & Platform IO installed (yet).

BTW: I'm testing with a CYD as an alternative, semi real-time (every 15 s refresh) and stand-alone energy monitor - using api calls the contents of some domoticz devices can be shown on the CYD.
Attachments
cyd-energy monitor
cyd-energy monitor
cyd.jpg (162.48 KiB) Viewed 1043 times
Raspberry PI 2 & 3 & 4 | RFlink | MySensors | ESP32 | Homebridge | Tasmota Sonoff | Zigbee2Mqtt | ADS-B
Thorgal789
Posts: 815
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 »

semi real-time (every 15 s refresh)
You can't use websocket notification ? Or values are moving a lot and it's useless ? And yes CYD are realy good device, lot of things possible with them.
Nice project! Is it possible to use the Arduino IDE or another easy way to upload the bin file to the CYD?
Yes, I think it's that is doing @stupsi99, but the problem is more the compilation, as lot of settings need to be set before it.
stupsi99
Posts: 7
Joined: Tuesday 09 July 2024 14:46
Target OS: Windows
Domoticz version:
Contact:

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

Post by stupsi99 »

Yes! I use Tasmota webinstaller to upload the file.
1) https://tasmota.github.io/install/
2) select "tasmota32 LVGL" to flash.
3) enter wifi ssid and password
4) login to webinterface and flash the new .bin file
After reboot the config screen starts at CYD
DiaDomo
Posts: 37
Joined: Saturday 28 March 2020 13:55
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

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

Post by DiaDomo »

Thanks, but how can I set the wifi ssid and password? I can only select the bin file:
Attachments
tasmota webinstaller
tasmota webinstaller
install-bin.png (80.98 KiB) Viewed 1004 times
Raspberry PI 2 & 3 & 4 | RFlink | MySensors | ESP32 | Homebridge | Tasmota Sonoff | Zigbee2Mqtt | ADS-B
stupsi99
Posts: 7
Joined: Tuesday 09 July 2024 14:46
Target OS: Windows
Domoticz version:
Contact:

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

Post by stupsi99 »

Install the tasmota32 LVGL first !!
After finish you see a box to enter the wifi (PC)
Reboot and login to the CYD webinterface.
Then update to your .bin file (webinterface CYD)
palnic
Posts: 36
Joined: Wednesday 13 September 2017 15:40
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8153
Location: Chicago
Contact:

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

Post by palnic »

It was my mistake from beginning to use capacitive board esp32-2432S024C. Everything works fine, thanks to Thorgal789, but it is really hard to make any adjustment on the small screen. I want to move to esp32-2432S024R display, could you please add this board to your project. Thanks
Thorgal789
Posts: 815
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 »

The esp32-2432S024C use the same graphic driver than the esp32-2432S028R, juste need to change the touch driver.
I have make code for the esp32-2432S024R (untested, and not online yet) but it use same resolution than the other, so only 240*320 ?
palnic
Posts: 36
Joined: Wednesday 13 September 2017 15:40
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8153
Location: Chicago
Contact:

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

Post by palnic »

Yes. It is 240*320
Thorgal789
Posts: 815
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 have pushed the esp32-2432S024R to test on the branch "test".
Tell me the result pls ?
palnic
Posts: 36
Joined: Wednesday 13 September 2017 15:40
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8153
Location: Chicago
Contact:

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

Post by palnic »

Thanks a lot! I was able to get a message, "Calibrate Screen", But something wrong with the resolution. No matter what value I put in esp32-2432S024R.json file
"-"DTFT_HEIGHT=320",
"-DTFT_WIDTH=240",
Screen stay the same orientation. Here is a warning I got:

In file included from .pio/libdeps/esp32-2432S024R/TFT_eSPI/User_Setup_Select.h:203,
from .pio/libdeps/esp32-2432S024R/TFT_eSPI/TFT_eSPI.h:69,
from src/core/screen_driver.cpp:49:
.pio/libdeps/esp32-2432S024R/TFT_eSPI/TFT_Drivers/ILI9341_Defines.h:8: warning: "TFT_WIDTH" redefined
#define TFT_WIDTH 320

<command-line>: note: this is the location of the previous definition
In file included from .pio/libdeps/esp32-2432S024R/TFT_eSPI/User_Setup_Select.h:203,
from .pio/libdeps/esp32-2432S024R/TFT_eSPI/TFT_eSPI.h:69,
from src/core/screen_driver.cpp:49:
.pio/libdeps/esp32-2432S024R/TFT_eSPI/TFT_Drivers/ILI9341_Defines.h:9: warning: "TFT_HEIGHT" redefined
#define TFT_HEIGHT 240

<command-line>: note: this is the location of the previous definition
In file included from src/core/screen_driver.cpp:49:
Attachments
20241017_145227.jpg
20241017_145227.jpg (223.29 KiB) Viewed 623 times
palnic
Posts: 36
Joined: Wednesday 13 September 2017 15:40
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8153
Location: Chicago
Contact:

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

Post by palnic »

Other settings:
screen_driver.cpp
disp_drv.hor_res = TFT_WIDTH;
disp_drv.ver_res = TFT_HEIGHT;
tft.setRotation(global_config.rotateScreen ? 4 : 0);
Thorgal789
Posts: 815
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 »

The resolution is something hard to found, but I think we can use the 3 drivers for this devices so will be not a problem.
There is a special setting to swap the resolution on the actual driver (ATM I m using TFT_eSPI), If I remember it's

Code: Select all

-DILI9342_DRIVER=1
but need first to found the correct orientation.

You have tried to play with

Code: Select all

"-DTFT_ROTATION=4",
There is too a "hardcoded" rotation that can perturb it, in screen_driver.cpp

Code: Select all

    // Rotation option
    #ifdef TFT_ESPI
        tft.setRotation(global_config.rotateScreen ? 0 : 2);
    #endif

Code: Select all

tft.setRotation(global_config.rotateScreen ? 4 : 0);
And this line change nothing ?

From here https://github.com/HASwitchPlate/openHA ... /750/files setting are not so bad, but can have a special hardware.

edit:
Have found the special setting to swap x and y

Code: Select all

// Change the width and height if required (defined in portrait mode)
// or use the constructor to over-ride defaults

#if defined (ILI9341_DRIVER) || defined (ILI9341_2_DRIVER)
  #define TFT_WIDTH  240
  #define TFT_HEIGHT 320
#elif defined (ILI9342_DRIVER)
  #define TFT_WIDTH  320
  #define TFT_HEIGHT 240
#endif
So need to use -DILI9341_DRIVER=1 or -DILI9342_DRIVER=1

And it seem this driver don't use TFT_ROTATION, so need to edit direclty the code in screen_driver.cpp

Code: Select all

    // Rotation option
    #ifdef TFT_ESPI
        tft.setRotation(global_config.rotateScreen ? 0 : 2);
    #endif
palnic
Posts: 36
Joined: Wednesday 13 September 2017 15:40
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8153
Location: Chicago
Contact:

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

Post by palnic »

I have changed "-DILI9341_DRIVER=1",at esp32-2432S024R.json. Looks good but touch doesn't works
Thorgal789
Posts: 815
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 »

From that I m reading the R version use a XPT2046 and the Capacitive use a CST820.
I m searching other project on Github and except a difference here on some project

Code: Select all

#ifdef TOUCH_XPT2046
    #define XPT2046_IRQ 36
Changed in

Code: Select all

#ifdef TOUCH_XPT2046
    #define XPT2046_IRQ -1
The library seem to work.

You just have the screen "Calibrate Screen" and nothing is working ?
You have tried to run the project with "serial monitor" enabled ?
palnic
Posts: 36
Joined: Wednesday 13 September 2017 15:40
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8153
Location: Chicago
Contact:

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

Post by palnic »

Here is "serial monitor" output
Attachments
102124 serial monitor.jpg
102124 serial monitor.jpg (44.19 KiB) Viewed 554 times
palnic
Posts: 36
Joined: Wednesday 13 September 2017 15:40
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8153
Location: Chicago
Contact:

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

Post by palnic »

Here is a board display
Attachments
20241021_080701.jpg
20241021_080701.jpg (188.41 KiB) Viewed 555 times
Thorgal789
Posts: 815
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 »

No serial output when touching the display ?
You want to use Portrait mode ?
And color issue, the display need to be white text on black screen, try

Code: Select all

"-DTFT_INVERSION_ON=1",
in the esp32-2432S024R.json file.

Can make a try with adding too

Code: Select all

"-DUSE_HSPI_PORT=1",
It's from this project https://github.com/b00mekk/ESP32Maraude ... 2S024R_CYD but I don't think it use the touchpad.
It have prebuild file, can you make a try to see if it work on your device ?
palnic
Posts: 36
Joined: Wednesday 13 September 2017 15:40
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8153
Location: Chicago
Contact:

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

Post by palnic »

"-DUSE_HSPI_PORT=1", it did a trick.
Calibration working now, I use it in a Portrait mode. Trying to connect to wifi. Thanks a lot!
palnic
Posts: 36
Joined: Wednesday 13 September 2017 15:40
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8153
Location: Chicago
Contact:

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

Post by palnic »

Now is a new issue. After board is loaded I can see calibration screen with calibration mark and can perform a calibration.Than "Connecting to WiFi" screen comes up and stop. "Reset" button dosn't responsive
Attachments
20241021_134848.jpg
20241021_134848.jpg (177.9 KiB) Viewed 541 times
102424.jpg
102424.jpg (70.39 KiB) Viewed 541 times
20241021_134947.jpg
20241021_134947.jpg (223.34 KiB) Viewed 541 times
Thorgal789
Posts: 815
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 »

No SSID available, it mean the arduino don't found the wifi network.
You have already set the SSID and the password ? Or was broken before ?
I have updated the branch "test" with your last comments and have added one more debug line that print the SSID used for connection.
"Reset" button dosn't responsive
It's possible the touchpad was in landscape and the display in portrait.
To check that, there is an hidden utility, line 347 in screen_driver.cpp, it will enable something to test the touch (but need to reset the calibration using -DFORCECALIBRATE=true in platformio.ini )
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest