Page 10 of 13
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Thursday 18 July 2024 17:41
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.
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Thursday 18 July 2024 19:07
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.
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Friday 19 July 2024 9:40
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
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Friday 19 July 2024 10:39
by DiaDomo
Thanks, but how can I set the wifi ssid and password? I can only select the bin file:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Friday 19 July 2024 11:40
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)
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Wednesday 16 October 2024 17:46
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
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Wednesday 16 October 2024 18:44
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 ?
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Wednesday 16 October 2024 18:56
by palnic
Yes. It is 240*320
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Thursday 17 October 2024 18:41
by Thorgal789
Ok so have pushed the esp32-2432S024R to test on the branch "test".
Tell me the result pls ?
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Thursday 17 October 2024 22:05
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:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Thursday 17 October 2024 22:25
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);
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Friday 18 October 2024 19:42
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
but need first to found the correct orientation.
You have tried to play with
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
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Friday 18 October 2024 20:16
by palnic
I have changed "-DILI9341_DRIVER=1",at esp32-2432S024R.json. Looks good but touch doesn't works
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Saturday 19 October 2024 13:09
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 ?
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Monday 21 October 2024 15:06
by palnic
Here is "serial monitor" output
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Monday 21 October 2024 15:10
by palnic
Here is a board display
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Monday 21 October 2024 18:51
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
in the esp32-2432S024R.json file.
Can make a try with adding too
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 ?
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Monday 21 October 2024 19:51
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!
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Monday 21 October 2024 21:01
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
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Tuesday 22 October 2024 18:04
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 )