Installing ESPhome on GEEKMAGIC Smart Weather Clock (smalltv/pro)

Hello, i try you’re code but i have the code error:
ValueError: Component ID st7789v_st7789v was not declared to inherit from Component, or was registered twice. Please create a bug report with your configuration.
when i put you’re repo.

See Installing ESPhome on GEEKMAGIC Smart Weather Clock (smalltv/pro) - #38 by nickrout

Sorry, but i don’t understand why don’t work.
There is the code for test:

esphome:
  name: test
  friendly_name: test
  comment: Living room ESP32 controller
  area: Living Room

esp8266:
  board: esp12e
 
# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: ""

ota:
  password: ""

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

# Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: ""
    password: ""

captive_portal:

time:
  - platform: homeassistant
    id: homeassistant_time

font:
  - file: 'fonts/OpenSans-Regular.ttf'
    id: font1
    size: 30

color:
    - id: color_green
      red: 0%
      green: 100%
      blue: 0%

sensor:

  # Uptime sensor
  - platform: uptime
    name: "Uptime"

  # WiFi Signal sensor
  - platform: wifi_signal
    name: "WiFi Signalstärke"
    update_interval: 60s

spi:
  clk_pin: GPIO14
  mosi_pin: GPIO13
  interface: hardware
  id: spihwd

output:
  - platform: esp8266_pwm
    pin: GPIO05
    frequency: 20 Hz
    id: pwm_output

light:
  - platform: monochromatic
    output: pwm_output
    name: "Backlight"



display:
  - platform: st7789v
    model: "Custom"
    spi_id: spihwd
    height: 240
    width: 240
    offset_height: 0
    offset_width: 0
    dc_pin: GPIO02
    reset_pin: GPIO04
    #backlight_pin: GPIO25
    eightbitcolor: True
    #update_interval: never
    update_interval: 5s
    id: disp
    spi_mode: mode3
    lambda: |-
      it.printf(0, 0, id(font1), id(color_green),"Test1");
      it.printf(1, 1, id(font1), id(color_green),"Test2");
      it.printf(10, 10, id(font1), id(color_green),"Test3");
      it.printf(100, 100, id(font1), id(color_green),"Test4");
      

I have a esp8266 whith lcd 10 pin
The screen on but not display.
Thank you, for you’re help, it’s very nice :wink:

Hi,

Latest ESP Home releases with “spi_mode : mode3” in display configuration will work with ESP32 but not with ESP8266 which is still suffering for hwd RAM limitation preventing frame buffer usage.
Some latest changes in ESPHome are not compatible with my previous fork branch that allowed to skip frame buffer usage and allows esp8266 with ST7789. I need to work on this.

Okay, thanks for all your work :slight_smile: . I await your return on the subject.

Hello,
i test ok on arduino
whith this code:

#include <Adafruit_GFX.h>
#include <Adafruit_ST7789.h>

#define TFT_DC    0    
#define TFT_RST   2 
#define TFT_CS    5  
Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);

void setup() {
  Serial.begin(9600);
  Serial.print(F("Connexion ok"));
  tft.init(240, 240, SPI_MODE2); 
  tft.setRotation(2);
 
  tft.fillScreen(ST77XX_BLACK);
  testdrawtext("Hello Word", ST77XX_WHITE);
  
}

void testdrawtext(char *text, uint16_t color) {
  tft.setTextSize(3);
  tft.setCursor(0, 0);
  tft.setTextColor(color);
  tft.setTextWrap(true);
  tft.print(text);
}


void loop() {

}

you can use this work for esphome it’s ok for the screen.

Hi,

I have created an update esphome branch for ST7789v and ESP8266 compatible with esphome 202312 release

external_components:
  - source:
      type: git
      url: https://github.com/rletendu/esphome.git
      ref: st7789_nobuffer_202312
    refresh: 0s
    components: [st7789v]

together the spi mode option

spi_mode : mode3

This allows the no pro version of the Geekmagic gadget to work.

For the pro version with esp32 SOC the default latest esphome with appropriate spi mode3 option is working out of the box.

5 Likes

I’ve just received a smalltvpro direct from geekmagic and just wanted to thankyou all for the work on this. (ordered two but the other is the 8266 variant :-/ )

It is a nice small display in a box and after first updating it to their own newest firmware i followed the instructions in this thread and now i have it showing the time from ESPhome

Time to customize - pun intended :slight_smile:

2 Likes

Does anyone now how to put it flash mode ?
I have done a 1st good flash with ESPhome. And after changing the YAML, now it down not boot at all.

@breti @rletendu
Is this picture correct ?

No. The square pad is pin 1.

1 GND
2 TXD0
3 RXD0
4 3V3
5 GPIO0
6 RST

Thanks a lot.
I still have a an error message when I try

What exactly are you trying to do?

Everything was working fine with the esphome firmware (I was just displaying some Tes1, Test2…). And I have added in the yaml some bluetooth stuff.
When I have updating the firmware (OTA), the screen was dark. My router was able to see the smalltv pro connected, but the device was not accessible with ESPHOME (offline).
So now I am trying to push a new “simple firmware” to be able to come back to a normal situation using an usb-TTL.
But I ma not able to push.

Here is how I have done the connection (wire)

smalltv  | usbttl
-----------| -------
GND.    | GND
TX.       | RX
RX.      | TX
3V3.    |  3V3
`ˋ`
I am suspecting that the smalltv device needs to be in a boot mode or something like this.

First of all: The picture shows a smalltv (ESP-12F), not a smalltv pro. Which device do you use?

I took the picture of the 1st message but here is the real picture with the wire that I did.



The ESP32 will enter the serial bootloader when GPIO0 is held low on reset. So try to connect GPIO0 to GND, connect to power, disconnect GPIO0 and try to upload your code again.

Same issue. I think I have brick it.

You can’t “brick” it with software.

And you are right.
now It is back in esphome. The display is not working (I have something wrong in the yaml probably.

Thank you so much @breti for the help

1 Like