Imagine getting ESP-Home on this device

(13) 2.1-Inch Round Display with Magnetic Encoder Knob #ESP32S3 - YouTube

2.1 Inch 480*480 Circular Ips Color Lcd Display And Magnetic Encoder Knob Esp32-s3 Module N16r8 Ips Display St7701 2.4g Wi­fi - Integrated Circuits - AliExpress

6 Likes

Working on it.

Found an LVGL library for esphome (super easy to create ui’s with LVGL and Squareline Studio). But this SPI chip isn’t supported by the default eSPI library used, so it doesn’t work.

I’m currently trying to program it using Arduino IDE with MQTT/REST API to get it working as a thermostat.

5 Likes

Can you share the library link please?

Already a thread on this, but yes, this on ESPHome would be fantastic.

Link:

But like I mentioned, the SPI chip for the display is not supported by the eSPI library used.
You can modify the code to work with this library, but it’s quite a hastle:

1 Like

Did you get it working in ESPHOME?

Some more recent work can be found from @lukasz-tuz :point_down:

1 Like

Thanks for pulling me in to this thread :grinning_face_with_smiling_eyes:

A year ago or so I wanted to build a rotary device like this on my own, using 3D printed chassis and ESPHome - because I couldn’t find an off the shelf one.

Built a custom PCB with an esp module, printed a chassis, but kinda failed on the mechanics of it :laughing: Fast forward a few months and these are all over the internet, on the cheap side, no less. Progress!

Still, I’d love to have one of these devices working with ESPHome and lvgl. It’ll take time, but we’ll get there :slight_smile:

2 Likes

How would one go about trying to use the Arduino_GFX lib in esphome?

1 Like

did you get this working? I’m struggling with SPI pins, they re the same as the RGB pins so won’t compile

so, I got everything working except the screen, no idea where to go from here, anyone else made progress?

OK so I got it working thanks to the awesome people at HA :slight_smile:

I can’t join discord group, in the web simply no loading, in the app it says that the link takes you to a server or channel that I don’t have access to

Help

think getting it working with MQTT is the most easy i guess.

Solved lcd problem using only dev branch for st7701s:



external_components:
  - source:
      type: git
      url: https://github.com/esphome/esphome
      ref: dev  # Usa la versione di sviluppo (dev)
      #component: st7701s
    components:  # Specifica i componenti che desideri importare
      - st7701s  # Ad esempio, un display o altro componente

thanks to @kto for display yaml:

display:
  - platform: st7701s
    id: ${device_name}_display
    spi_mode: MODE0
    data_rate: 10MHz
    color_order: RGB
    # XXX DEBUG
    show_test_card: true
    # XXX
    dimensions:
      width: 480
      height: 480
    cs_pin: 21
    de_pin: 39
    vsync_pin: 48
    hsync_pin: 40
    pclk_pin:
      number: 45
      ignore_strapping_warning: true
    pclk_frequency: 15MHz
    pclk_inverted: false
    hsync_pulse_width: 10
    hsync_back_porch:  10
    hsync_front_porch: 10
    vsync_pulse_width:  2
    vsync_back_porch:  12
    vsync_front_porch: 14
    data_pins:
      blue:
        - number: 47                # LCD_D0  = b0
          allow_other_uses: true
        - number: 41                # LCD_D1  = b1
          allow_other_uses: true
        - 0                         # LCD_D2  = b2
        - 42                        # LCD_D3  = b3
        - 14                        # LCD_D4  = b4
      green:
        - 8                         # LCD_D5  = g0
        - 13                        # LCD_D6  = g1
        - 18                        # LCD_D7  = g2
        - 12                        # LCD_D8  = g3
        - 11                        # LCD_D9  = g4
        - 17                        # LCD_D10 = g5
      red:
        - 10                        # LCD_D11 = r0
        - 16                        # LCD_D12 = r1
        - 9                         # LCD_D13 = r2
        - 15                        # LCD_D14 = r3
        - 46                        # LCD_D15 = r4
    init_sequence:
      # Reference: wireless-tag sample code: 
      # https://github.com/wireless-tag-com/ZX2D10GE01R-V4848/blob/ad21b3659527618fdd752cc0801b0a36f6c5e52c/main/screen.c
      - [0xFF, 0x77, 0x01, 0x00, 0x00, 0x13]
      - [0xEF, 0x08]
      - [0xFF, 0x77, 0x01, 0x00, 0x00, 0x10]    # CMD2_BKSEL (already in esphome ST7701S::write_init_sequence_)
      - [0xC0, 0x3B, 0x00]                      # Scan line
      - [0xC1, 0x0B, 0x02]                      # VBP
      - [0xC2, 0x07, 0x02]
      - [0xCC, 0x10]
      - [0xCD, 0x08]                            # RGB format | ?565??? 666??
      - [0xB0, 0x00, 0x11, 0x16, 0x0e, 0x11, 0x06, 0x05, 0x09, 0x08, 0x21, 0x06, 0x13, 0x10, 0x29, 0x31, 0x18]   # IPS | 255 | 251 | 247 down | 239 | 231 | 203 | 175 | 147 | 108 | 80 | 52 | 24 | 16 | 8 down | 4 | 0
      - [0xB1, 0x00, 0x11, 0x16, 0x0e, 0x11, 0x07, 0x05, 0x09, 0x09, 0x21, 0x05, 0x13, 0x11, 0x2a, 0x31, 0x18]   # IPS | 255 | 251 | 247 down | 239 | 231 | 203 | 175 | 147 | 108 | 80 | 52 | 24 | 16 | 8 down | 4 | 0
      - [0xFF, 0x77, 0x01, 0x00, 0x00, 0x11]
      - [0xB0, 0x6d]                            # VOP  3.5375+ *x 0.0125 | 5D
      - [0xB1, 0x37]                            # VCOM amplitude setting
      - [0xB2, 0x81]                            # VGH Voltage setting | 12V
      - [0xB3, 0x80]
      - [0xB5, 0x43]                            # VGL Voltage setting | -8.3V
      - [0xB7, 0x85]
      - [0xB8, 0x20]
      - [0xC1, 0x78]
      - [0xC2, 0x78]
      - [0xD0, 0x88]
      - [0xE0, 0x00, 0x00, 0x02]
      - [0xE1, 0x03, 0xA0, 0x00, 0x00, 0x04, 0xA0, 0x00, 0x00, 0x00, 0x20, 0x20]
      - [0xE2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
      - [0xE3, 0x00, 0x00, 0x11, 0x00]
      - [0xE4, 0x22, 0x00]
      - [0xE5, 0x05, 0xEC, 0xA0, 0xA0, 0x07, 0xEE, 0xA0, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
      - [0xE6, 0x00, 0x00, 0x11, 0x00]
      - [0xE7, 0x22, 0x00]
      - [0xE8, 0x06, 0xED, 0xA0, 0xA0, 0x08, 0xEF, 0xA0, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
      - [0xEB, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00]
      - [0xED, 0xFF, 0xFF, 0xFF, 0xBA, 0x0A, 0xBF, 0x45, 0xFF, 0xFF, 0x54, 0xFB, 0xA0, 0xAB, 0xFF, 0xFF, 0xFF]
      - [0xEF, 0x10, 0x0D, 0x04, 0x08, 0x3F, 0x1F]
      - [0xFF, 0x77, 0x01, 0x00, 0x00, 0x13]
      - [0xEF, 0x08]
      - [0xFF, 0x77, 0x01, 0x00, 0x00, 0x00]
      - [0x36, 0x00]                            # MADCTL_CMD (already in esphome ST7701S::write_init_sequence_)
      - [0x3A, 0x66]                            # COLMOD 55/50=16bit(RGB565); 66=18bit(RGB666); 77?????3AH?=24bit(RGB888)
      - [0x11]                                  # SLEEP_OUT (already in esphome)
      - delay 120ms
      - [0x29]                                  # DISPLAY_ON (already in esphome)
      - delay 20ms

and @bjm for give me hope

Now work all perfectly, only few thinks to fix like speed and smooth display graphic operation, all the other sensor and led control are OK

Thanks all

1 Like

Whats the project look like?