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 »

Thank you for prompt response. Even if I hardcoded SSID "strcpy(global_config.wifiSSID, "RpiNet");" in main.cpp the serial monitor says "


rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:184
load:0x40078000,len:12732
ho 0 tail 12 room 4
load:0x40080400,len:2908
entry 0x400805c4
Starting application
Config version: 3
Starting calibration
Calibration coef: -0.1 , 0.1
Calibration offset: 238.1 , -19.4
Display buffer size: 7680 bytes
Screen init done
Brightness value: 255
Wifi connecting to SSID: SalesZoom
WiFi Status: Disconnected
WiFi Status: Disconnected
WiFi Status: Disconnected
WiFi Status: Disconnected
WiFi Status: Disconnected
WiFi Status: Disconnected
WiFi Status: Disconnected
WiFi Status: Disconnected
WiFi Status: Disconnected
WiFi Status: No SSID Available
WiFi Status: No SSID Available
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 »

RpiNet is available on my phone, I can connect to it
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 »

Wifi issue has been fixed, I turned ON "-DFORCE_CONFIG" and now I can connect to WiFi. Can't set trusted network at Domoticz, working to fix it
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 »

But you are using hardcoded setting for wifi ? "SalesZoom" was a previous try ?
You haven't the dialog to set it ? The reset button is still not working ? I have a doubt for the touchpad working mode ...


For the trusted network Domoticz/setting/parameter/security/trusted network then add the device IP.
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's possible the touchpad was in landscape..", where I can change touchpad to the portrait. I want to display only three devices and want them to take the whole screen. Please show me where I can do this and play with the fonts. Thanks
Attachments
20241022_134207.jpg
20241022_134207.jpg (177.96 KiB) Viewed 737 times
20241022_133252.jpg
20241022_133252.jpg (133.29 KiB) Viewed 737 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 »

Still some issue with the touchpad
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. Looks like everything works now. All I did is:
Screen_driver.cpp
touchscreen2.setRotation(global_config.rotateScreen ? 2 : 0);
tft.setRotation(global_config.rotateScreen ? 4 : 0);

esp32-2432S024R.json
"-DTFT_HEIGHT=320",
"-DTFT_WIDTH=240",
"-DLCD_WIDTH=240",
"-DLCD_HEIGHT=320",

I am in the portrait mode

Still need to adjust fonts
Attachments
20241023_094713.jpg
20241023_094713.jpg (187.9 KiB) Viewed 722 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 »

Have updated again the branch "test".
- have removed the hardcoded part for rotation
- have added your changes
- have added

Code: Select all

-DDEVICE_SIZE=3
for your device, you will have bigger widget.


But color are not the good one, IDK if you have changed a setting but perhaps you can remove

Code: Select all

"-DTFT_RGB_ORDER=1",
Text will be bigger on the next version, but I haven't try the result (I m on landscape mode on mine), ca n you share the result, we will check what we can update (fonts but perhaps too position)
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. I downloaded the latest branch "test".Changes I made:
esp32-2432S024R.json:
"-DLCD_WIDTH=240",
"-DLCD_HEIGHT=320",

platformio.ini:
-DTOTAL_ICONX=1 # How many icon widht
-DTOTAL_ICONY=3 # How many icon Heigh
-DDEVICE_SIZE=3 # Device display size
-DFASTCLIC=1
-DFORCE_CONFIG=1

I am not 100% sure about this, but it looks better on my small display
home_panel.cpp:
Ln130,168,186 : lv_obj_set_style_text_font(label2, &font1, 0);
Attachments
20241023_140513.jpg
20241023_140513.jpg (220.22 KiB) Viewed 714 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 »

Code: Select all

"-DLCD_WIDTH=240",
"-DLCD_HEIGHT=320",
I have not used them, because for me the driver don't use it. It have an impact on result ?

With

Code: Select all

DEVICE_SIZE=3
font1 have 19ppx size and font2 have 14ppx size so yes it is visible, but hard for me to make it "customisable" using the json file, perhaps using an external file, like for the config (the personnal_settings.h file)

And still the color problem, remove

Code: Select all

"-DTFT_RGB_ORDER=1"
do nothing ?

For the rest, I m not graphical designer so I can't help you a lot ^^, but if you want to add a border somewhere I can explain what to add on 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 »

You are right!

"-DLCD_WIDTH=240",
"-DLCD_HEIGHT=320", do nothing, can ignore

"-DTFT_RGB_ORDER=1" I can't see any difference with or without

I understand it is hard to make everyone happy, so "-DTFT_RGB_ORDER=1" does it job to increase a font.
Thanks a lot for your help!
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 »

Code: Select all

-DTFT_RGB_ORDER=1
If the line is in the json file or not change the RGB order, ATM on your device the red is blue. So for me it's the RGB order, you can too invert color with adding or removing

Code: Select all

"-DTFT_INVERSION_ON=1",
but from my memory you have already tried.

Code: Select all

// Identical looking TFT displays may have a different colour ordering in the 16-bit colour
#define TFT_BGR 0   // Colour order Blue-Green-Red
#define TFT_RGB 1   // Colour order Red-Green-Blue
So for me you are using ATM TFT_RGB ( = 1)
And you need to use TFT_BGR (= 0)

So -DTFT_RGB_ORDER=0
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 »

Sorry, I didn't try to change color settings, someone asking me every day when light is going to work. But everything is working fine and I want to say thanks Thorgal789 for your help.
Attachments
20241028_202637.jpg
20241028_202637.jpg (93.49 KiB) Viewed 591 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 »

Ha yes, it's custom integration ^^, nice, I understand better now.
Don't worry, another user, another day will use the same device than you and will update the code, nothing is locked.

For information the device can support OTA update, so you don't need to open your wall switch to edit code, but it depend used settings.
sq9njj
Posts: 1
Joined: Thursday 07 November 2024 19:42
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 sq9njj »

Hello,
Is there a way or a possibility to display clock on CYD ??
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 »

Ha good question, there is no native "clock device" on domoticz, right ?
So yes it's possible using for exemple a text widget and a script to print text on it, I can make a try this week end, but I think it will be only for hour + minut, else it will use too much resources for nothing.
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 »

I have updated the code on the "test" branch.
If you create a Text widget on domoticz, you can display a clock on it using this code in a LUA time script.

Code: Select all

commandArray['UpdateDevice'] = 90 .. "|0|" .. os.date('%H:%M')
Now on the device on the text widget, if the text is less than 6 char it will be displayed automatically. So you can have a clock.

It's possible too using the websocket (there is regulary time event) but it mean I need to overwrite the device working mode (display a custom widget instead of the regular one)
I m using the bigger police, but on my device it's still too small, so need to use a bigger font in memory just for this widget I think.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest