Page 11 of 13

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

Posted: Tuesday 22 October 2024 18:52
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

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

Posted: Tuesday 22 October 2024 18:55
by palnic
RpiNet is available on my phone, I can connect to it

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

Posted: Tuesday 22 October 2024 20:08
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

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

Posted: Tuesday 22 October 2024 20:50
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.

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

Posted: Tuesday 22 October 2024 20:56
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

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

Posted: Tuesday 22 October 2024 20:58
by palnic
Still some issue with the touchpad

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

Posted: Wednesday 23 October 2024 17:22
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

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

Posted: Wednesday 23 October 2024 18:28
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)

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

Posted: Wednesday 23 October 2024 21:17
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);

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

Posted: Thursday 24 October 2024 17:57
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.

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

Posted: Thursday 24 October 2024 20:16
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!

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

Posted: Friday 25 October 2024 16:55
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

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

Posted: Tuesday 29 October 2024 14:19
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.

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

Posted: Tuesday 29 October 2024 16:54
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.

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

Posted: Thursday 07 November 2024 19:43
by sq9njj
Hello,
Is there a way or a possibility to display clock on CYD ??

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

Posted: Friday 08 November 2024 17:40
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.

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

Posted: Saturday 09 November 2024 13:39
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.

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

Posted: Monday 27 January 2025 22:37
by marexsc
I had a problem with adding devices, only default icons were displayed on the panel, adding idx in "Main.cpp" did nothing.
In my case, adding the entry "#define FORCE_CONFIG 1" to the "Main.cpp" configuration helped.
Now everything works for me.

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

Posted: Tuesday 28 January 2025 19:32
by Thorgal789
You have all settings in platformio.ini

Code: Select all

build_flags =
	-fexceptions
	-DPIO_FRAMEWORK_ARDUINO_ENABLE_EXCEPTIONS
	-DLV_CONF_PATH="../../../../src/conf/lv_conf.h" # file path
	-DUSER_SETUP_LOADED=1 # To enable config throught platformio for TFT_eSPI
	#-DFORCE_CONFIG # Enable or disable the forced network configuration.
	-DFORCECALIBRATE=false # Reset the calibration at every restart, used to reset it after a config change.
	#-DOLD_DOMOTICZ # If you are using older Domoticz version < 2023.2
	-DBONUSPAGE=0 # Special page to add, similar to Homepage but not updated, from 1 to 3
	#-DFASTCLIC # Enable 1 clic action for some widget
	#-DNO_INFO_PAGE # Disable the Info panel
	-DNO_GROUP_PAGE # Disable the Group/scene panel
	#-DCUSTOM_FONT=1
	#-DAUTO_BRIGHTNESS=1
But yes, there is at least 3 ways to configure the project.
- Use FORCE_CONFIG and hard write value in main.cpp
- Use the device GUI at start on the touchpad.
- Use external file called personnal_settings.h

The third is only available on the beta branch, I will update the project this week, long time I haven't do it, sorry.

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

Posted: Wednesday 29 January 2025 5:06
by kniazio
Thorgal789 wrote: Tuesday 28 January 2025 19:32 The third is only available on the beta branch, I will update the project this week, long time I haven't do it, sorry.
By the way, maybe something could be done about the too bright backlight on the 2432S028R