esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
292 stars 36 forks source link

inkplate6 configured with model inkplate_10 has incorrect buffer size until first full update in 1 bit mode #2944

Closed kvisle closed 2 years ago

kvisle commented 2 years ago

The problem

Prerequisites:

The first partial updates before a full update will render incorrectly, as demonstrated in the two screenshots here: https://imgur.com/a/IwqidsA

The lambda used to draw the image is written in the example yaml.

Which version of ESPHome has the issue?

2a8668ea60ea51a5906efac7c89e1c1baab1d23a

What type of installation are you using?

pip

Which version of Home Assistant has the issue?

No response

What platform are you using?

ESP32

Board

esp32dev

Component causing the issue

inkplate6

Example YAML snippet

esphome:
  name: inkplate10
  platform: ESP32
  board: esp32dev

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "pwpwpw"

wifi:
  ssid: "fofofo"
  password: "afafaf"

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

captive_portal:

switch:
  - platform: restart
    name: "Inkplate Reboot"
    id: reboot

  - platform: gpio
    id: battery_read_mosfet
    pin:
      mcp23xxx: mcp23017_hub
      number: 9
      inverted: true

  - platform: template
    name: "Inkplate Greyscale mode"
    lambda: return id(inkplate_display).get_greyscale();
    turn_on_action:
      - lambda: id(inkplate_display).set_greyscale(true);
    turn_off_action:
      - lambda: id(inkplate_display).set_greyscale(false);

sensor:
  - platform: adc
    id: battery_voltage
    update_interval: never
    attenuation: 11db
    pin: 35

i2c:

mcp23017:
  - id: mcp23017_hub
    address: 0x20

binary_sensor:
  - platform: status
    name: "Inkplate Status"
    id: system_status

  - platform: gpio
    name: "Inkplate Touch Pad 1"
    pin:
      mcp23xxx: mcp23017_hub
      number: 10
  - platform: gpio
    name: "Inkplate Touch Pad 2"
    pin:
      mcp23xxx: mcp23017_hub
      number: 11
  - platform: gpio
    name: "Inkplate Touch Pad 3"
    pin:
      mcp23xxx: mcp23017_hub
      number: 12

display:
- platform: inkplate6
  id: inkplate_display
  model: inkplate_10
  update_interval: 60s

  ckv_pin: 32
  sph_pin: 33
  gmod_pin:
    mcp23xxx: mcp23017_hub
    number: 1
  gpio0_enable_pin:
    mcp23xxx: mcp23017_hub
    number: 8
  oe_pin:
    mcp23xxx: mcp23017_hub
    number: 0
  spv_pin:
    mcp23xxx: mcp23017_hub
    number: 2
  powerup_pin:
    mcp23xxx: mcp23017_hub
    number: 4
  wakeup_pin:
    mcp23xxx: mcp23017_hub
    number: 3
  vcom_pin:
    mcp23xxx: mcp23017_hub
    number: 5

  lambda: |-
    it.fill(COLOR_ON);
    it.line(0, 0, 1200, 825, COLOR_OFF);
    it.line(1200, 0, 0, 825, COLOR_OFF);

Anything in the logs that might be useful for us?

No response

Additional information

Using the example config, the lambda is set to draw a X over the entire inkplate10-display. It will only look correct after the first partial update, which happens after 10 minutes.

jesserockz commented 2 years ago

Yeah when making changes recently I realised that when using partial update, the first display should always be a full update. esphome/esphome#3013 fixes this.