phiten / esphome-ikea-led-matrix

esphome custom component for IKEA's LED matrix Frekvens & Obegränsad
25 stars 8 forks source link

Only random pixels jumping all around #2

Open nagyrobi opened 1 year ago

nagyrobi commented 1 year ago

Hi @phiten,

I just tried your config with a brand new Obegränsad display and a Wemos D1 mini (original controller removed from the panel). Unfortunately all I get are just random pixels jumping all around.

Only brighthess works.

My config is:

substitutions:
  device_name: obegraensad-ledmtx-1
  friendly_name: "LED matrix 1"
  device_description: "IKEA Obegränsad LED mátrix 1"
  device_ip: 192.168.1.21

esphome:
  name: ${device_name}
  platform: ESP8266
  board: d1_mini
  platformio_options:
    lib_deps:
      - Wire                            # Also required by GFX.
      - SPI                             # Also required by GFX.
      - adafruit/Adafruit BusIO         # Required by GFX Library.
      - adafruit/Adafruit GFX Library   # Required for FrekvensPanel.
      - me-no-dev/ESPAsyncTCP
  project:
    name: esphome,robi.${device_name}
    version: ${device_description}

external_components:
  - source: github://phiten/esphome-ikea-led-matrix@master
    components: [ obegraensad_panel ]

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  reboot_timeout: 15min
  manual_ip:
    static_ip: ${device_ip}
    gateway: 192.168.1.254
    subnet: 255.255.255.0
  use_address: ${device_ip}

logger:

api:
  reboot_timeout: 15min
  encryption:
    key: !secret encryption_key

ota:
  password: !secret ota_password

status_led:
  pin:
    number: GPIO2
    inverted: true

light:
  - platform: monochromatic
    name: ${friendly_name} Brightness
    output: matrix_brightness
    restore_mode: RESTORE_DEFAULT_ON

output:
  - platform: esp8266_pwm
    id: matrix_brightness
    pin:
      number: GPIO14 #obegraensad EN; WemosD1 D5
      inverted: True

binary_sensor:
  - platform: gpio
    name: ${friendly_name} Pushbutton
    pin:
      number: GPIO13 #WemosD1 D7
      inverted: true

time:
- platform: sntp
  id: local_clock
  timezone: Europe/Budapest
  servers: 
    - 192.168.1.254

font:
  - file: "custom/04B03.ttf"
    id: b03
    size: 8

display:
  - platform: obegraensad_panel
    rotation: 90
    latch_pin: 12 #obegraensad CLA; WemosD1 D6
    clock_pin: 04 #obegraensad CLKDI; WemosD1 D2
    data_pin: 05 #obegraensad IN; WemosD1 D1

    lambda: |-
      it.strftime(4, 0, id(b03), "%H", id(local_clock).now());
      it.strftime(4, 8, id(b03), "%M", id(local_clock).now());

Any idea? I wonder do I need pull-ups on the outputs (I think those are needed for inputs only).

I downloaded the TTF font from https://dl.dafont.com/dl/?f=04b_03

nagyrobi commented 1 year ago

I tried exchanging the latch, clock and data pins between each other but no success.

nagyrobi commented 1 year ago

Very interesting. When I power the wemos through USB, which has the 5V pin connected to VCC of the panel, the panel and display works fine (panel draws 5V power through wemos's USB input), shows the clock.

When it's the other way around, powering the panel through its original cable and let the wemos draw its 5V power from the panel (wemos draws 5V power through the panel), random pixels all around.

In all cases wemos runs nicely as Home Assistant detects it, brightness works etc.