ESP32-C3 with integrated GC9A01 - cheap touch controller

Where did you find the original bin file? I ahve one as well just want to be able to reset it if something goes wrong :slight_smile:

They were in the original file package I found from the supplier. The file moves around a bit so a direct link isn’t really possible from them, but I had a quick look and it currently seems to be here. Look for “1.28inch_ESP32-2424S012.zip”. Note that the server does not use SSL and you should always be careful when downloading files from an insecure site.

For copyright reasons - not to mention size - I don’t think I could put the whole archive in github, but have uploaded just the binary files required to restore the device to original demo state here.

1 Like

Thank you! Mine doesnt connect to wifi for some reason. I copied your latest code and edited it to my own sensors. But it wont connect. Any pointers?

Logs please.

Wild guess - double check your esphome secrets editor to make sure there’s no typo with your ssid and password. Also setup a dedicated 2.4ghz network for devices like this to use - they can have issues if you run 2.4 and 5 networks with the same ssid.

2 Likes

I already have another esp32 working with wifi so secrets should be fine. I will keep trying more tonight.

OK, then good luck. Triple check that there’s no typo in the yaml file eg:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

in the esphome device code, and

wifi_ssid: "myssid"
wifi_password: "mypassword"

in the secrets file, or ensure that if you use different names for those to change 'em to match exactly. If you make a typo with them, unlike with other esphome commands, the editor will not check and prompt you that there is an issue. You can also potentially boot the device up whilst it’s connected to the esphome server or your pc via https://web.esphome.io/ to view the logs as it starts to see what is happening. Again, my guess would be a typo in the code, or the device struggling to connect to the wifi. Cheers.

FWIW Interestingly, Waveshare have released this device.

It appears to be very similar to what we’ve been using, but with a handful of improvements including:

  • 32-bit LX7 dual-core processor, up to 240MHz (vs single-core processor, up to 160Mhz)
  • 512KB of SRAM and 384KB ROM, with onboard 2MB PSRAM and an external 16MB Flash memory (vs 400KB SRAM, 384KB and 4MB Flash)
  • CNC metal case with plastic base (vs all plastic)
  • 3-axis accelerometer and 3-axis gyroscope (does not have)
  • 30 multifunction GPIO pins (not even close)

All up, definitely better but more expensive - currently USD$20 on their website. Still, if you need something with more power, the ability to hook up multiple sensors, etc then this could be an option worth considering. The screen itself appears to be the same, so it’s likely that the code won’t need much tweaking.

As an aside, from a design perspective I suspect I actually prefer the cheaper case - it looks better with the rounded edges of the screen and is more compact. I suspect that the raised metal case might make it a little harder to touch something that is on the edge of the screen, and it is more likely that dust and other muck might end up in the crack between the screen and case. Hard to tell for certain without seeing one in person of course!

2 Likes

PSA - I bought another four of these, and although they look the same externally I found that I could not power them using a usb-c to usb-c cable from my laptop (used two different, known to work, cables as well as two different laptops). I was concerned that the things were dead but they worked when I tried a usb-a to usb-c cable. Not good. This implies that there has been some cost cuts with the termination resistors in the device - so a standards based USB-C power source will not turn on power.

On a more positive note, once I was able to power it up, I was able to use https://web.esphome.io/ to initialise and then install my own firmware.

On starting it also had a slightly different firmware installed, with the initial boot splash screen showing it is “powered by Guition”. It should still work for what I need it to do, but if your project requires you to power it from a usb-c source then you may want to avoid this updated version. Might be hard to identify when buying, but here’s some photos that might help.



Late reply, but might be useful to some. Mine wouldn’t connect to wifi and I couldn’t figure it out, then I went to put it back in the little plastic box and try later, and then spotted the tiny wifi antenna in the box! Plugged it in and all works perfectly :smiley:

1 Like

Good news LVGL Graphics — ESPHome

1 Like

Definitely good news - should make it a lot easier to develop more professional looking screens!

hello
Thank you for these code examples, I took 2 and already tested them on one, it works perfectly

FYI The most recent update to Esphome - ESPHome 2024.6.0 - 19th June 2024 — ESPHome - has introduced some breaking changes. For my example code there is just the one item that needs to be updated, specifically:

ota:
  password: !secret ota_password

needs to now be:

ota:
  password: !secret ota_password
  platform: esphome

I’ll update my example code. :slight_smile:

2 Likes

Anyone try to use this new code with the waveshare device (esp32-s3-touch-1.28)

# V1.0 - 1/7/2024
# Compiled and tested on esphome 2024.6.4 and HA 2024.6.4

substitutions:
  devicename: thelittlecircle
  friendname: The Little Circle
  location: guest
# Change the timezone to suit your location, or even just remove it - it will likely be picked up automatically
  timez: Australia/Melbourne
  board: esp32-c3-devkitm-1
# Display state on initial start
# Note that the screensaver only starts after the first touch of the display
# Change to ALWAYS_OFF if want the screen to be off after booting, ALWAYS_ON if want it on at start eg for initial troubleshooting
  screenstart: ALWAYS_OFF
# Timeout for the screen
  screensaver: 10 min
#GPIO pins for the LCD screen
  repin: GPIO1
  dcpin: GPIO2
# Note - you may see an error on compilation "WARNING GPIO2 is a Strapping PIN and should be avoided" - ignore this as you have no choice
# This error message may be removed via the "ignore_strapping_warning" option for the screen driver
  bkpin: GPIO3
  clpin: GPIO6
  mopin: GPIO7
  cspin: GPIO10
# GPIO pins for the touch screen
  sdapin: GPIO4
  sclpin: GPIO5
  intpin: GPIO8  

esphome:
  name: $devicename
  friendly_name: $friendname
  platformio_options:
    board_build.flash_mode: dio

esp32:
  board: $board
  framework:
    type: arduino

# Enable logging
# Change to avoid "Components should block for at most 20-30ms" warning messages in the log - an issue since 2023.7.0
# Not really a breaking change - it's an issue I suspect due to the device being slow and this error previously
# simply not being reported
logger:
  level: DEBUG #makes uart stream available in esphome logstream
  logs:
    component: ERROR
  #Turn off UART logging over RX/TX 
  baud_rate: 0

#uart:
#  rx_pin: GPIO20
#  tx_pin: GPIO21
#  baud_rate: 9600
#  id: uart_bus

# Enable Home Assistant API
api:
  encryption:
    key: !secret esphome_key

ota:
  platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "$devicename Fallback Hotspot"
    password: !secret wifi_password

captive_portal:


# Amazingly, ble_tracker now seems to work
# Things to note if using it:
# 1. Make sure you use https://web.esphome.io/ to wipe the device first and then upload the new image
# Do not use OTA after enabling esp32_ble_tracker: as it needs to change the partition to support the code
# 2. Comment out "#eight_bit_color: false" in the display section. Drawback is screen redraw is slower and colours less vibrant.
# 3. Don't be surprised if the thing locks ups or reboots randomly - this is bleeding edge
# 4. Refer to https://esphome.io/components/binary_sensor/ble_presence.html for more info

#esp32_ble_tracker:
#binary_sensor:
#  # Presence based on MAC address
#  - platform: ble_presence
#    mac_address: AC:37:43:77:5F:4C
#    name: "ESP32 BLE Tracker Google Home Mini"
#    min_rssi: -80dB
#  # Presence based on BLE Service UUID
#  - platform: ble_presence
#    service_uuid: '11aa'
#    name: "ESP32 BLE Tracker Test Service 16 bit"
#  # Presence based on iBeacon UUID
#  - platform: ble_presence
#    ibeacon_uuid: '68586f1e-89c2-11eb-8dcd-0242ac130003'
#    name: "ESP32 BLE Tracker Test Service iBeacon"



external_components:
  - source: github://GadgetFactory/[email protected] 
  - source: github://clydebarrow/esphome@lvgl_original
    refresh: 10min
    components: [ lvgl ]


# Still need this external driver to support the touch screen
# Supported added via https://github.com/esphome/esphome/pull/5941
# Currently testing

spi:
  mosi_pin: $mopin
  clk_pin: $clpin
# Don't use software - makes it crawl  
#  force_sw: True
#mosi = Master Out Slave In
#miso = Master In Slave Out or fermented bean paste. In this case, most likely the former rather than the latter. Doesn't matter as not used.

i2c:
  sda: $sdapin
  scl: $sclpin
  #Following helped someone get rid of the "Components should block" error messages but didn't for me
  #frequency: 400kHz
   
text_sensor:
#  - platform: ble_scanner
#    name: "BLE Devices Scanner"
  - platform: CST816S_touchscreen
    id: my_touchscreen


#-------------------------------------------
# lvgl Buttons
#-------------------------------------------    
lvgl:
  displays:
    - watchface
  touchscreens:
    - my_touchscreen
  pages:
  - id: main_page
    widgets:
      - label:
          align: CENTER
          text: 'Hello World!'

display:
  - platform: ili9xxx
    model: GC9A01A
    id: watchface
    reset_pin: $repin
    cs_pin: $cspin
    dc_pin: 
      number: $dcpin
      ignore_strapping_warning: true
      # The above is to remove the strapping pin warning message
 # The next are optional
#    width: 240
#    height: 240
# Disable this if using ble_tracker as the poor thing doesn't have enough memory 
# Enable it if not using ble_tracker as you will find the screen looks and responds better
# Disable this if you are encountering random reboots or other issues   
#    eight_bit_color: false
# How often to refresh the display
    update_interval: 1s
# Rotate the screen so usb socket is pointing down
#    rotation: 90
# No longer needed as integrated ili9xxx driver rotates the screen by default


tried this to use lvgl component…

Unfortunately I get this error. Looks like the touchscreen as defined in the CST component does not play well with the lvl component.

I know it is a “blind” try but I had to :slight_smile: hope it will be soon supported

For others, I have the waveshare Esp32-S3-touch-lcd-1.28-B. Here

I was able to get it to work by changing the PINs. I couldn’t get the touchscreen to work until I added the “resetPin” to the touchscreen section.

I am interested in trying the LVGL component as I am already using it on a esp32-s3-lcd-4.3

That’s because you are trying to use a text_sensor instead of a touchscreen platform. :crazy_face:. Just use the standard ESPHome CST816 touchscreen component.

2 Likes

Dooooooooh what a dumb

1 Like

Hi all,

Just wanted to share that I got one of these a while back and set up an example project using the native ESP-IDF developer tools. Don’t know anything about the software requirements for Home Assistant, but it should have all the correct pinouts and drivers.

2 Likes