ESPHome use on a Adafruit Matrix Portal M4

I’ve tried to setup a Adafruit Matrix Portal M4 based 64x32 display using this ESP Wrapper: GitHub - TillFleisch/ESPHome-HUB75-MatrixDisplayWrapper: Custom ESPHome component which wraps the ESP32-HUB75-MatrixPanel-DMA library into a ESPHome display component.
But I can’t seem to connect to the Matrix Portal after compiling. Has anyone used a Cortex M4 based device successfully?
Error in the log:
ERROR Please try running esptool.py --before default_reset --after hard_reset --baud 115200 --port /dev/ttyACM1 --chip esp32 write_flash -z --flash_size detect 0x10000 /data/build/info-display/.pioenvs/info-display/firmware.bin 0x1000 /data/build/info-display/.pioenvs/info-display/bootloader.bin 0x8000 /data/build/info-display/.pioenvs/info-display/partitions.bin 0xe000 /data/cache/platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin locally.

code:

esphome:
name: info-display
friendly_name: info display
platformio_options:
lib_deps:
- SPI
- Wire
- Adafruit BusIO
- adafruit/Adafruit GFX Library
- GitHub - TillFleisch/ESP32-HUB75-MatrixPanel-DMA: An Adafruit GFX Compatible Library for the ESP32, ESP32-S2, ESP32-S3 to drive HUB75 LED matrix panels using DMA for high refresh rates. Supports panel chaining.

external_components:

  • source: github://TillFleisch/ESPHome-HUB75-MatrixDisplayWrapper@main
    esp32:
    board: esp32dev
    framework:
    type: arduino

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: “Info-Display Fallback Hotspot”
password: “”

captive_portal:

I have had some success with changing the board to esp32-s3-devkitc-1
It flashes and shows up in home assistant. I only have brightness and power. I can not get anything to print on the display

I may have messed up the pin out. I’ll look into it more when I have time.

This yaml works for my matrix portal s3

esphome:
  name: esphome-web-c76b40
  friendly_name: Matrix Portal

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino
    
external_components:
  - source: github://TillFleisch/ESPHome-HUB75-MatrixDisplayWrapper@main

font:
  # gfonts://family[@weight]
  - file: "gfonts://Roboto"
    id: roboto
    size: 20

display:
  - platform: hub75_matrix_display
    id: matrix
    width: 64
    height: 32
    R1_pin: 42
    G1_pin: 41
    B1_pin: 40
    R2_pin: 38
    G2_pin: 39
    B2_pin: 37
    A_pin: 45
    B_pin: 36
    C_pin: 48
    D_pin: 35
    E_pin: 21
    LAT_pin: 47
    OE_pin: 14
    CLK_pin: 2
3 Likes

have you gotten this working? I have the same device and would like to see if I can get ESPhome working with it

1 Like

I ended up not being able to get esphome to work with Adafruit’s Matrix Portal M4. I setup the Matirix Portal to receive messages over MQTT instead. I used the Arduino IDE in the Matrix Portal. Works, but on occasion the Matrix Portal stop receiving MQTT messages has to be rebooted.

Hello,

this config is really working for you?
I have the Same S3 Matrix Portal with an HUB75 Matrix and I simply cant get it to work. Through I have an 32x16 portal but this really should not make things more difficult …

esphome:
  name: esphome-web-c76b40
  friendly_name: Matrix Portal

substitutions:
  xscrollpadding: "5" # in pix
  scroll_speed: .09s

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino
    
external_components:
  - source: github://TillFleisch/ESPHome-HUB75-MatrixDisplayWrapper@main
interval:
  - interval: 0.1s
    then:
      lambda: |-
        id(partlycloudy).next_frame();
        id(cloudy).next_frame();
        id(fog).next_frame();
        id(windy).next_frame();
  - interval: 0.1s
    then:
      animation.next_frame: cloudy

font:
  - file: /config/esphome/fonts/MatrixChunky8X.ttf
    id: mono
    size: 8
    glyphs:  |
      ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz°
  - file: "gfonts://Roboto"
    id: roboto
    size: 12  
  - file: "gfonts://Micro 5"
    id: micro
    size: 20
color:
  - id: teal
    hex: 00CED1
  - id: blue
    hex: 7B68EE
  - id: brown
    hex: D2691E
  - id: orange
    hex: FFA500
  - id: green
    hex: 008000
  - id: pink
    hex: FF69B4
  - id: purple
    hex: 9400D3
  - id: red
    hex: FF0000
  - id: yellow
    hex: FFFF00

display:
  - platform: hub75_matrix_display
    id: matrix
    width: 64
    height: 32
    R1_pin: 42
    G1_pin: 41
    B1_pin: 40
    R2_pin: 38
    G2_pin: 39
    B2_pin: 37
    A_pin: 45
    B_pin: 36
    C_pin: 48
    D_pin: 35
    E_pin: 21
    LAT_pin: 47
    OE_pin: 14
    CLK_pin: 2
    brightness: 64
    update_interval: 32ms
    lambda: |-
      if (id(weather).state == "sunny") {
      id(sunny).next_frame();
      it.image(2, 10, id(sunny), COLOR_ON, COLOR_OFF);
      }

      if (id(weather).state == "lightning-rainy") {
      id(rainylight).next_frame();
      it.image(2, 10, id(rainylight), COLOR_ON, COLOR_OFF);
      }

      if (id(weather).state == "rainy") {
      id(rainy).next_frame();
      it.image(2, 10, id(rainy), COLOR_ON, COLOR_OFF);
      }

      if (id(weather).state == "partlycloudy") {
      id(partlycloudy).next_frame();
      it.image(2, 10, id(partlycloudy), COLOR_ON, COLOR_OFF);
      }

      if (id(weather).state == "cloudy") {
      id(cloudy).next_frame();
      it.image(2, 10, id(cloudy), COLOR_ON, COLOR_OFF);
      }

      if (id(weather).state == "clear-night") {
      id(clearnight).next_frame();
      it.image(2, 10, id(clearnight), COLOR_ON, COLOR_OFF);
      }

      if (id(weather).state == "fog") {
      id(fog).next_frame();
      it.image(2, 10, id(fog), COLOR_ON, COLOR_OFF);
      }

      if (id(weather).state == "windy") {
      id(windy).next_frame();
      it.image(2, 10, id(windy), COLOR_ON, COLOR_OFF);
      }


      it.strftime(10, 0, id(mono), id(purple),"%b %d", id(homeassistant_time).now());
      it.strftime(37, 0, id(mono), id(orange), "%I:%M", id(homeassistant_time).now());

      if (id(outsidetemp).has_state()) {
        it.printf(14, 10, id(mono), id(pink), "%.1f°", id(outsidetemp).state);
      }

      if (id(motion).state) {
        id(pacman).next_frame();
        it.image(0, -15, id(pacman), COLOR_ON, COLOR_OFF);
      } else {
        
      static int16_t xpos = it.get_width();
      const char * text = id(quote).state.c_str();

      int x_start, y_start;
      int width, height;
 
      it.get_text_bounds(0, 22, text, id(mono), TextAlign::TOP_LEFT, &x_start, &y_start, &width, &height); 

      if(xpos < -1 * (width + $xscrollpadding)) {xpos = it.get_width();}
 
      if(width <= it.get_width()) {xpos = 0;}
 
      it.print(xpos, 22, id(mono), id(red), TextAlign::TOP_LEFT, text); 
      xpos--;
      }
switch:
  - platform: hub75_matrix_display
    matrix_id: matrix
    name: "Power"
    id: power

number:
  - platform: hub75_matrix_display
    matrix_id: matrix
    name: "Brightness"
# Enable logging
logger:

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

ota:
  safe_mode: true

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-C76B40"
    password: "n5SZyllaF9nO"

captive_portal:



animation:
  - file: /config/www/gif/pac-man.gif
    id: pacman
    resize: 64x64
    type: RGB565
  - file: /config/esphome/weather/sunny.gif
    id: sunny
    resize: 10x10
    type: RGB565  
  - file: /config/esphome/weather/cloudy.gif
    id: cloudy
    resize: 10x10
    type: RGB565
  - file: /config/esphome/weather/partlycloudy.gif
    id: partlycloudy
    resize: 10x10
    type: RGB565  
  - file: /config/esphome/weather/clearnight.gif
    id: clearnight
    resize: 10x10
    type: RGB565
  - file: /config/esphome/weather/fog.gif
    id: fog
    resize: 10x10
    type: RGB565
  - file: /config/esphome/weather/windy.gif
    id: windy
    resize: 10x10
    type: RGB565
  - file: /config/esphome/weather/rainylightening.gif
    id: rainylight
    resize: 10x10
    type: RGB565
  - file: /config/esphome/weather/rainy.gif
    id: rainy
    resize: 10x10
    type: RGB565
image:
  - file: mdi:television-classic
    id: game
    resize: 20x20

binary_sensor:
  - platform: homeassistant
    id: motion
    entity_id: binary_sensor.driveway_motion_motion
    name: "Drive-way motion"
time:
  - platform: homeassistant
    id: homeassistant_time      
    timezone: America/Chicago 
text_sensor:
  - platform: homeassistant
    name: "Weather Forecast From Home Assistant"
    entity_id: weather.forecast_central_hub
    id: weather
    internal: true
  - platform: homeassistant
    name: "Matrix Text"
    entity_id: input_text.led_matrix_text
    id: led_matrix_text
    internal: true
  - platform: homeassistant
    id: quote
    entity_id: sensor.daily_quote
    attribute: q
    internal: true
  - platform: homeassistant
    id: author
    entity_id: sensor.daily_quote
    attribute: a
    internal: true

sensor:
  - platform: homeassistant
    id: outsidetemp
    entity_id: sensor.outside_temp_temperature
    internal: true

Thats my entire setup. It works Im pulling a sensor for temp and a quote of the day.

Reviving an old thread, did you get all your images from online somewhere or your own creations?

I made the Gif’s in photoshop