Page 3 of 13
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Monday 26 February 2024 14:53
by palnic
Thorgal789 wrote: ↑Saturday 24 February 2024 21:14
I have updated the code to "trying" to support your device (just comment/uncomment in platformio.ini file), I m using pin from here
https://github.com/Smanar/CYD-Domoticz-Remote/issues/2
The code compile, but I think your device don't use the same driver, I m using DILI9341_2_DRIVER but I think you need to use DILI9341_DRIVER, problem with this driver you will miss some declaration.
I m searching a working project with this device, and you will probably need the same lib than @kniazio (lovyanGFX), but I prefer make try first with TFT_eSPI
Edit:
Have found a new configuration
Code: Select all
"-DILI9341_DRIVER=1",
"-DESP32_2432S024C",
This one is compiling, I don't think the touch will work but I think the display will be fine.
This last change is not yet on the github.
Thanks a lot. Will try today
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Monday 26 February 2024 15:58
by palnic
Thanks again! As you said it is compiling now but touch doesn't work. All I can see is "Calibrate screen"
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Monday 26 February 2024 19:04
by Thorgal789
madpatrick wrote: ↑Sunday 25 February 2024 15:21
Maybe this is womething your are looking for ?
Yes exaclty, I have put this one in my list but it have somes negatives points
- the price, it's correct, but others are realy cheaper.
- Need to make a special hole in the wall, and I already have one (standard hole in my country), so I need to adapt it, for the other one, I just need to print a case, put a 230AC/5VDC alimentation in the hole, and the device behind.
-Few documentation.
But for the moment it's the better one I have found.
@palnic I based the code on this issue
https://github.com/HASwitchPlate/openHASP/issues/555
But it seem the lib I m using don't support this touchpad, so need to migrate too on the LOVYANGFX.
The only working project for your device I have found is this one
https://github.com/elik745i/ESP32-2432s024c so I will use the same config.
I have a new version using the second lib on the github, but on branch "test", I m breaking other stuff ATM so I can't send it on "master".
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Monday 26 February 2024 20:58
by palnic
I saw the openHASP project and a few years back I tried to adopt it to Domoticz. Unfortunately my programming skills is not good enough, I am electrical engineer, and I wasn't able finish this job. I still have case from the HASP and ESP32-2432s024c wilt fit almost perfectly. This is a standard case for US. It would be nice to finish this project for Domoticz
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Tuesday 27 February 2024 17:21
by Thorgal789
Do you have tried the branch "test" on my github to see if this one is working ? Display and touch ?
I have updated it yesterday with the same setting than in the openHASP project ,but my driver, so I don't know the result.
https://github.com/Smanar/CYD-Domoticz-Remote/tree/test
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Tuesday 27 February 2024 17:42
by palnic
Thanks, will try now
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Tuesday 27 February 2024 18:46
by palnic

- 20240227_114028.jpg (224.57 KiB) Viewed 1393 times
The sensing definitely works, the is some issue with display pictures will look into
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Tuesday 27 February 2024 19:09
by kniazio
As usual, @Thorgal789 did a lot of work. The display now works very stably. All I need is additional websites for my devices

Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Tuesday 27 February 2024 23:02
by EdwinK
Going to try this with the CYD that I bought for my printer but is now not needed anymore.
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Wednesday 28 February 2024 16:56
by Thorgal789
@palnic The field to play are
Code: Select all
"-DTFT_WIDTH=240",
"-DTFT_HEIGHT=320",
"-DTFT_ROTATION=4",
On the json file and
Code: Select all
disp_drv.hor_res = TFT_HEIGHT;
disp_drv.ver_res = TFT_WIDTH;
in the screen_driver.cpp file, sometime we need to reverse TFT_HEIGHT and TFT_WIDTH.
If you can't success, I will try to compile the project that use your device, this action will enable/disable code, so easier to understand the good config in this "multi support" code.
@EdwinK
Take care the last code is still on the branch "test", I haven't updated the master branch yet, need to make some bench to see cpu/memory use with the new code.
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Wednesday 28 February 2024 18:17
by palnic

- 20240228_111153.jpg (80.71 KiB) Viewed 1337 times
Thanks. Here are my settings:
platformio.ini:
-DTFT_WIDTH=320
-DTFT_HEIGHT=240
-DTFT_ROTATION=2
screen_driver.cpp:
disp_drv.hor_res = TFT_HEIGHT;
disp_drv.ver_res = TFT_WIDTH;
Display looks perfect, but sensing doesn't work
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Wednesday 28 February 2024 19:26
by Thorgal789
You need to reverve the display at 90° no ? Widgets are by defaut more longer than larger.
but sensing doesn't work
It have worked previously ? Yes else you will be blocked at calibration step.
On the platoformio.ini file
Set it to "true", It's possible the previously memorised don't work with your new setting. This setting will reset the touch calibration at every restart.
(And there is a setting to reverse the touchpad too if neeeded, but harder to see, I can give you a code to see the pointer, easier to see if you need to reverse it too)
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Wednesday 28 February 2024 19:43
by palnic
OK. It works now, trying to connect to Domoticz. Thanks a lot. What about cup of coffee
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Wednesday 28 February 2024 20:03
by Thorgal789
Lol, for me will be soon a full diner.
Give me your last setting, 90° reversed (or you can keep it in this side, but not sure what can be the result) I will put them in my next update.
For information I m searching a way to add secondary (or more) page, will be the same than on the homepage, but not updated in real time.
And I still have a strange issue on too big json.
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Wednesday 28 February 2024 20:13
by palnic
Ok, enjoy your dinner. My lunch is over, working to rotate the screen
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Wednesday 28 February 2024 20:44
by palnic
Actually I am going to keep it vertically, since I want to replace some wall switch and display extra info on the screen. My settings stay the same:
platformio.ini:
-DTFT_WIDTH=320
-DTFT_HEIGHT=240
-DTFT_ROTATION=2
screen_driver.cpp:
disp_drv.hor_res = TFT_HEIGHT;
disp_drv.ver_res = TFT_WIDTH;
So far I can't connect to Domoticz, says "Failed to connect"?
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Thursday 29 February 2024 16:31
by palnic
No matter what I do, the is no connection to Domoticz. Connected to WiFi, Domoticz is ON, but can't connect display, it says "Failed to connect"
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Thursday 29 February 2024 17:30
by Thorgal789
No problem, I will update the code for the vertical support, waiting if one day I found someone that need the horizontal. But you will probably need to change the display 2*4 instead of 3*3 ?
Value to enter for connexion need to be for exemple:
- host : 192.168.1.1
- port : 8080
If it don't work
Be sure the device have its IP autorised in the Trusted Networks setting in Domoticz.
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Thursday 29 February 2024 17:57
by palnic
My Domoticz address is 192.168.0.86:8080. This is what I entered. Looks like it doesn't reset connection after if failed once.
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Thursday 29 February 2024 18:51
by Thorgal789
Looks like it doesn't reset connection after if failed once
If I m right it's memorised, but you have a button to reset it.
You can set them direclty in code in main.cpp
Code: Select all
#if FORCE_CONFIG
strcpy(global_config.wifiPassword, "xxxxxxxxxxxxxxxxxxx");
strcpy(global_config.wifiSSID, "xxxxxxxxxxxxxxx");
strcpy(global_config.ServerHost, "192.168.1.1");
global_config.ServerPort = 8080;
global_config.wifiConfigured = true;
global_config.ipConfigured = true;
const static int t[] = {37, 75, 16, 36, 28, 35, 57, 89, 45};
for (int i=0; i<TOTAL_ICONX*TOTAL_ICONY; i++)
global_config.ListDevices[i] = t[i];
WriteGlobalConfig();
#endif
If you enable FORCE_CONFIG in platformio.ini
You see nothing in domoticz log, or on device log (with serial monitor) ?
Yo have added the device IP to domoticz setting (trusted network) ?