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

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 »

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
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 again! As you said it is compiling now but touch doesn't work. All I can see is "Calibrate screen"
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 »

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".
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 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
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 »

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
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, will try now
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 »

20240227_114028.jpg
20240227_114028.jpg (224.57 KiB) Viewed 934 times
The sensing definitely works, the is some issue with display pictures will look into
kniazio
Posts: 198
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 »

As usual, @Thorgal789 did a lot of work. The display now works very stably. All I need is additional websites for my devices :)
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

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

Post by EdwinK »

Going to try this with the CYD that I bought for my printer but is now not needed anymore.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
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 »

@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.
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 »

20240228_111153.jpg
20240228_111153.jpg (80.71 KiB) Viewed 878 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
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 »

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

Code: Select all

-DFORCECALIBRATE=false 
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)
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 »

OK. It works now, trying to connect to Domoticz. Thanks a lot. What about cup of coffee
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 »

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.
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 »

Ok, enjoy your dinner. My lunch is over, working to rotate the screen
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 »

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"?
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 »

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"
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 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.
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 »

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.
Attachments
20240229_104914.jpg
20240229_104914.jpg (80.45 KiB) Viewed 795 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 »

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) ?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests