ESPHome - HUB75 with P5 matrix help needed

Hi everyone.

A project I have began working on centers around using a HUB75 matrix panel.

For the controller, I am using a Huidu HD-WF2 controller board which I have updated the firmware to ESPHome.

The matrix panel I have chosen for my first attempt at doing something like this has turned out to be rather challenging to set up. I have gotten a P5 outdoor 64x32 1/8 scan, which is not playing nice with ESPHome.
The matrix panel works when using the original Huidu firmware and programming with their software, HDShow or HD2020. Through the configuration settings I would choose the HD-WF2 board, and then select the P5 outdoor matrix with 64x32 1/8 and all was good.

With ESPHome, I have tried quite a few different settings based on hours of searching for info. This panel is stated as being 1/8 scan and is causing me grief. For example using the following config setting, of which from searching were suggestions to try actually make the matrix a jumbled mess, so they do not help at all:

scan_wiring: SCAN_1_8_32PX_HIGH
and
scan_wiring: FOUR_SCAN_32PX_HIGH

Does anyone have any suggestions or have experience with the P5 outdoor 64x32 matrix panels? Unfortunately there is no manufacturer info on the back so I can’t search for specs with that info.

yaml I simplified, based on the example from a git repository in the comment section (I removed the “custom-component” in order to use ESPHome’s integrated hub75 component). It should draw a red box around the perimeter of the panel and print one line of “Hello world!” at coordinate (2,2):

# led-matrix-hub75-huidu-wf2.yaml -- ESPhome config for the HUIDU HD-WF2 LED matrix controller
#
# (C) 2023 Hajo Noerenberg
#
# Usage: See https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA/issues/433
#
# http://www.noerenberg.de/
# https://github.com/hn/esphome-configs
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3.0 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/gpl-3.0.txt>.
#

esphome:
  name: led-matrix-hub75-huidu-wf2
  friendly_name: LED matrix Huidu HD-WF2
  platformio_options:
    board_build.flash_mode: dio

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino

# Enable logging
logger:

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

ota:
  - platform: esphome
    password: "#######################"

web_server:
  version: 3
  port: 80
  
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

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

captive_portal:

i2c:
  sda: 41
  scl: 42

time:
  - platform: pcf8563
    address: 0x51
    id: pcf8563_time
  - platform: homeassistant
    on_time_sync:
      then:
        pcf8563.write_time:

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

display:
  - platform: hub75
    id: huidu_wf2_x1
    board: huidu-hd-wf2
    panel_width: 64
    panel_height: 32
    clock_phase: false
    lambda: |-
      auto red = Color(255, 0, 0);
      auto blue = Color(0, 0, 255);
      auto rtc = id(pcf8563_time).now();
      //it.line(4, 25, 1 * rtc.second, 25, blue);
      //it.rectangle(2, 2, 62, 28, red);
      it.rectangle(0, 0, 63, 31, red);
      //it.strftime(7, 3, id(roboto), "%Y-%m-%d", rtc);
      //it.strftime(7, 14, id(roboto), "%H:%M:%S", rtc);
      it.print(2, 2, id(roboto), blue, "Hello World!");

switch:
  - platform: gpio
    id: led_run
    pin: 40

binary_sensor:
  - platform: gpio
    id: test_key
    pin:
      number: 17
      inverted: true

The P5 panel at aliexpress:
https://www.aliexpress.com/item/1005009097702362.html?spm=a2g0o.productlist.main.1.74aatVzWtVzWr2&algo_pvid=5d05e2a6-7a03-4168-96ca-f1e45ac8b5f2&algo_exp_id=5d05e2a6-7a03-4168-96ca-f1e45ac8b5f2-0&pdp_ext_f={"order"%3A"37"%2C"eval"%3A"1"%2C"fromPage"%3A"search"}&pdp_npi=6%40dis!CAD!15.10!13.89!!!74.86!68.86!%402103129017711037371908483eb668!12000047902247895!sea!CA!805986400!X!1!0!n_tag%3A-29919%3Bd%3A6a00e09c%3Bm03_new_user%3A-29895&curPageLogUid=kxMD19evJVtD&utparam-url=scene%3Asearch|query_from%3A|x_object_id%3A1005009097702362|_p_origin_prod%3A

Thanks for any help,
Craig

I think you should inspect what shift drivers your panel uses.

Hi thanks @Karosm .
With your suggestion I’ve removed additional configurations and tried just the drivers listed in the ESPHome documentation. Unfortunately no luck.

I can’t zoom in on the actual chips on the display board, they are very glossy and are illegible when I zoom in. I’ll see if can figure out a way to get a clear image.

However… while attempting that I found a label on the board I didn’t see before - P5-1921-3264-8S-S3.
Searching with this gave me some new info, which here are some of the highlights.

  • Likely denotes the driver IC or panel series (commonly associated with ICN2037/ICN2038 or FM6126A chips)
  • Driver Support : This panel uses 1/8 scan (8S) , so it requires E pin (address line 4) for row addressing. The E pin must be connected (e.g., to GPIO32) when using ESP32-based drivers.
  • ESP32 Compatibility : The ESP32-HUB75-MatrixPanel-DMA library and ESPHome hub75 component support this panel type, provided the correct scan_wiring: SCAN_1_8_64PX_HIGH is set.

To simplify things further I connected an ESP32-WROOM-32E as I saw some info about the HD-WF2 board that may make it incompatible (long story short I realised it was a WF4 board I had used successfully. I forgot I started setting up the WF2 but got impatient and stopped, then just flashed ESPHome on it). Per the info above this P5 display board needs the E pin set. The WF2 controller per what I have seen does not have one exposed and can’t be set, thus me reverting to the ESP32 dev board.
With the above info I have come across, I unfortunately still have not had any success. I’ve been reading through a GIT issue of the 1/8scan matrix displays and it appears there should be a way, but it’s a bit of info-overload. I need to go through it again a few more times.

I appreciate your help of course. And if there are any other suggestions I would be grateful for the help. I selected this specific board as it will be outside exposed to the elements otherwise I’d just buy a different P5 with ‘normal’ settings.

Thanks,
Craig