-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
diy: add support for Waveshare Touch LCD 2 #221
base: master
Are you sure you want to change the base?
diy: add support for Waveshare Touch LCD 2 #221
Conversation
ffb7c1d
to
e4c7467
Compare
The Waveshare Touch LCD 2 is an ESP32-S3 board with a capacitive touch screen and camera.
e4c7467
to
140508c
Compare
Many thanks. I don't have one of these devices but from a quick look the changes look good. 👍 |
@JamieDriver thank you! I am working on an enclosure design and will upload files, photos and instructions when I'm done 🙂 |
Could you add a small section to |
Also, can you get your working build, do |
I'm using the attached to put together a ci build - not 100% sure if it's correct though as I don't have a device to test. If you remove |
@JamieDriver going to commit the README additions shortly.
It does work! Here is the build/defconfig that I generated and the difference between the one you linked above (ex. flash size difference): yours on left, mine on right 2c2
< CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y
---
> CONFIG_APP_NO_BLOBS=y
6c6
< CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y
---
> CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
15,28d14
< CONFIG_BT_ENABLED=y
< CONFIG_BT_NIMBLE_ENABLED=y
< CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_EXTERNAL=y
< CONFIG_BT_NIMBLE_LOG_LEVEL_NONE=y
< CONFIG_BT_NIMBLE_MAX_CONNECTIONS=1
< CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=5632
< # CONFIG_BT_NIMBLE_ROLE_CENTRAL is not set
< # CONFIG_BT_NIMBLE_ROLE_BROADCASTER is not set
< # CONFIG_BT_NIMBLE_ROLE_OBSERVER is not set
< CONFIG_BT_NIMBLE_NVS_PERSIST=y
< # CONFIG_BT_NIMBLE_SM_LEGACY is not set
< CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME="j"
< CONFIG_BT_NIMBLE_GAP_DEVICE_NAME_MAX_LEN=11
< CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU=517
31a18
> # CONFIG_ETH_USE_SPI_ETHERNET is not set
63d49
< CONFIG_LOG_DEFAULT_LEVEL_NONE=y
64a51,53
> CONFIG_MBEDTLS_ECP_RESTARTABLE=y
> CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF=y
> CONFIG_NEWLIB_STDIN_LINE_ENDING_LF=y
74d62
< # CONFIG_OV5640_SUPPORT is not set
79a68,69
> CONFIG_TINYUSB_DESC_MANUFACTURER_STRING="Waveshare"
> CONFIG_TINYUSB_DESC_PRODUCT_STRING="S3 Touch LCD 2" |
Sorry - I'm being an idiot - I missed that you'd already included the config file! 🤯 |
Neat! Just one thing, I noticed from the pictures you are using vertical vs horizontal, and I can see the Jade ID is being cut off - it might work better with the UI maybe if you rotate the display 90 degrees (though I don't have a device to test it) |
@greenaddress Originally I had that, but then the touch area is in the wrong spot. I saw there is a TODO to fix that in the code. Afterwards the vertical grew on me and I think it looks pretty cool! Maybe it's possible to wrap the Jade ID? |
good point, the touch code AFAIK is not ready for rotations yeah maybe the jade id could scroll or wrap |
Hi, I'll also take a look at the label you're talking about. On that point - just to say none of the the devices we have ported to so far are 'portrait' - so the ui is not well tested in this format. While it tries to be dynamic, there may be screens that do do not look so good in this orientation - the truncated label may just be the first ... Many thanks. |
My generated config says:
Is that right ? From the image the screen doesn't look that close to being square ? |
@trevarj - I've added a commit to the branch discussed here: #221 (comment) that should scroll that truncated id on the home screen. |
Awesome, I will flash and let you know once I'm back at my PC. |
Camera and QRs work great. I already did a few testnet transactions! Tried your branch (commit 8e39688) and get a panic:
Tried e0e8fd4 as well (waveshare~2) and it also gives me a corrupt display. I will try to debug more later. |
Ok, ignore that 'scrolling' commit. I'll revisit it later - prob when I've got hold of one of these devices. We can proceed without it for now. Other than rebasing to latest master, my changes should be:
Difficult to see what may have happened. |
@JamieDriver seems that there were changes made to the .defaults that I provided. Here's the diff between my original branch and waveshare_diy: Yours are the removed ones. modified configs/sdkconfig_display_waveshares3_touch_lcd2.defaults
@@ -4,8 +4,6 @@ CONFIG_BF20A6_SUPPORT=n
CONFIG_BF3005_SUPPORT=n
CONFIG_BOARD_TYPE_WS_TOUCH_LCD2=y
CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y
-CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y
-CONFIG_BOOTLOADER_LOG_LEVEL=3
CONFIG_BOOTLOADER_WDT_ENABLE=n
CONFIG_BUTTON_LONG_PRESS_HOLD_SERIAL_TIME_MS=100
CONFIG_BUTTON_LONG_PRESS_TIME_MS=500
@@ -17,9 +15,6 @@ CONFIG_DEBUG_MODE=y
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
-CONFIG_ESP_CONSOLE_UART=y
-CONFIG_ESP_CONSOLE_UART_NUM=0
-CONFIG_ESP_CONSOLE_ROM_SERIAL_PORT_NUM=0
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
CONFIG_ESP_ERR_TO_NAME_LOOKUP=n
CONFIG_ESP_MAIN_TASK_STACK_SIZE=12288
@@ -35,7 +30,6 @@ CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT=n
CONFIG_ESP_WIFI_NVS_ENABLED=n
CONFIG_ESP_WIFI_RX_IRAM_OPT=n
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
-CONFIG_ETH_ENABLED=n
CONFIG_ETH_USE_SPI_ETHERNET=n
CONFIG_FATFS_LFN_HEAP=y
CONFIG_FATFS_VFS_FSTAT_BLKSIZE=4096
@@ -52,7 +46,6 @@ CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF=y
CONFIG_NT99141_SUPPORT=n
CONFIG_OV2640_SUPPORT=n
CONFIG_OV3660_SUPPORT=n
-CONFIG_OV5640_SUPPORT=y
CONFIG_OV7670_SUPPORT=n
CONFIG_OV7725_SUPPORT=n
CONFIG_PARTITION_TABLE_CUSTOM=y
@@ -76,4 +69,4 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=n
CONFIG_TINYUSB_CDC_ENABLED=y
CONFIG_TINYUSB_CDC_RX_BUFSIZE=64
CONFIG_TINYUSB_DESC_MANUFACTURER_STRING="Waveshare"
-CONFIG_TINYUSB_DESC_PRODUCT_STRING="S3 Touch LCD 2"
\ No newline at end of file
+CONFIG_TINYUSB_DESC_PRODUCT_STRING="S3 Touch LCD 2" |
I think that is done by I made this change to run it locally on just the one file (otherwise it takes forever!)
|
Do you think one of them is responsible for 'corrupt display' ? |
@JamieDriver you're right, it was not the config file! If I revert 079df56 (flush ui) and 92ade1a (scroll ID) I am back to a working device. Here is what I meant by corrupt display: Thanks for helping me work through this! |
So to confirm, this image ^^ is with the 'scroll id' reverted, but with 'flush' still in ? ie. looks like is caused by the 'flush' commit ? |
That's correct. Scroll was reverted (per your request originally) and 'flush' still there. Reverting 'flush' solves the issue, and commenting too (just checked). Let me know if I can do anything else to help debug. |
@JamieDriver hi, finally I fixed the scrolling issue for the device name. Please let me know if there is a better way. PR here: #224 ![]() |
Thanks, pulled these changes into |
Really it's the scrambled display that's the blocker atm. |
Me either, but it seems that the GUI activity "ex" with has_statusbar == false doesn't update "updatables" (after fixing the crash by setting the title node's activity to that. This fix sort of makes sense if you consider the title displayed in the statusbar "owned" by the dashboard activity (where I set the activity and enable scrolling) 🤷🏻♂️
Any tips for debugging on the device? I noticed putting a slight task delay before the flush, so it might be a timing issue? |
Removing taking/giving the semaphore works, and also adding an assertion somehow magically fixes the issue too: // Flush/clear display as soon as we're able
JADE_ASSERT(gui_mutex);
JADE_SEMAPHORE_TAKE(gui_mutex);
display_flush();
JADE_SEMAPHORE_GIVE(gui_mutex); No clue why that would be the case, but commenting it causes the display failure, and then uncommenting fixes it. I get the feeling that I'm doing something wrong, but all I'm doing is changing the code and re-flashing with C-t-f in the |
The Waveshare Touch LCD 2 is an ESP32-S3 board with a capacitive touch screen and camera.