Open alex-mextner opened 7 months ago
also, I searched the internet intensively, one of the links: https://community.home-assistant.io/t/esphome-compilation-error-74hc595/649622
d1 mini lite pinout for reference: https://www.wemos.cc/en/latest/d1/d1_mini_lite.html
In this issue even spi is unreliable, but with slightly different problems https://github.com/esphome/issues/issues/5120
After a few switches, it stops powering on or off my output LED and miss one or more switches, dephasing between the esphome switch state and real output state.
In my case:
Slightly more detailed error I got when have tried to compile:
INFO ESPHome 2024.3.1
INFO Reading configuration /config/esphome/esp-alert-matrix.yaml...
Failed config
sn74hc595: [source /config/esphome/esp-alert-matrix.yaml:36]
Pin 4 is used in multiple places.
- [source /config/esphome/esp-alert-matrix.yaml:36]
id: sn74hc595_hub
latch_pin:
number: 4
mode:
output: True
input: False
open_drain: False
pullup: False
pulldown: False
analog: False
inverted: False
oe_pin:
number: 12
mode:
output: True
input: False
open_drain: False
pullup: False
pulldown: False
analog: False
inverted: False
sr_count: 1
spi_id: spi_bus1
Pin 4 is used in multiple places
Pin 12 is used in multiple places
Pin 12 is used in multiple places
Speaking about gpio wiring. I said it's unreliable and diagram looks messy. anyways I see 8 bit sent, latch okay?, and 3 bits are set? Is it looks okay for you?
Your description is incomprehensible. The view of the bit-banging output is expected and looks ok. The timings are completely fine. Try explaining again without going all over the place. One config, one issue.
The problem
I tried many config variations. since obviously incorrect one from documentation through many other variants from the network.
even reading the source code and help of chatgpt 4 were not helpful.
source of error 1: https://github.com/esphome/esphome/blob/release/esphome/pins.py#L119 source of error 2: https://github.com/esphome/esphome/blob/master/esphome/components/sn74hc595/__init__.py#L63
btw, look message is too generic and hides possible details of what exactly wrong.
Incorrect documentation ("Over SPI"): https://www.esphome.io/components/sn74hc595#over-spi
What I tried: 1
2
3 adding
allow_other_uses: true
to sn74hc595option 2 without spi_id
using GPIOn pin numbers as alternative
using different pins, avoiding setting oe_pin
7 many other trials with config...
Why spi
Actually it works over gpio, however it's really unreliable, so i'm trying spi hoping best. I checked out the signal diagram using the logical analyser and the signal looks wrong, inconsistent, non-symmetric
I'll attach the picture.
Also, i tried different options with wiring and configuring OE pin. disable it and wire to GND, enable and pull-up, and more. I restarted the device every time.
Ideas
Looks, It's issue of wemos configuration incompatibility near to pin mapping under the hood.
Which version of ESPHome has the issue?
2024.3.1
What type of installation are you using?
Home Assistant Add-on
Which version of Home Assistant has the issue?
2024.3.3
What platform are you using?
ESP8266
Board
Wemos D1 Mini Lite
Component causing the issue
sn74hc595
Example YAML snippet
Anything in the logs that might be useful for us?
No response
Additional information
No response