esphome / issues

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

PCF8574 driver - setup not getting called #4672

Open behines opened 1 year ago

behines commented 1 year ago

The problem

I am using a PCF8575 with all 16 pins configured as inputs. My testing (modifying the code with inline logging statements) indicates that PCF8574Component::setup() and PCF8574GPIOPin::setup() are never getting called at startup (or ever).

The net of that is that PCF8574Component::writegpio() never gets called, so the pins never get a "1" written to them as is required for them to function correctly as inputs.

[TL;DR: In my circuit, the inputs are floating normally, sometimes get shorted to ground. My device is a NXP PCF8575 with the internal 100 uA current source that performs a weak pull-up function.]

The device works okay. I was able to force configuration of the pins at the end of config by hacking dump_summary(), and I see that gpiowrite() does get called in this case:

std::string PCF8574GPIOPin::dumpsummary() const { char buffer[32]; snprintf(buffer, sizeof(buffer), "%u via PCF8574", pin); if (pin==15) parent->setup(); return buffer; }

Is there something I need to do to cause setup() to get called? Or is this a bug?

Which version of ESPHome has the issue?

2023.4.0

What type of installation are you using?

Docker

Which version of Home Assistant has the issue?

Not using Home Assistant in this test

What platform are you using?

ESP32

Board

ESP32-DevKitC V4

Component causing the issue

PCF8574

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

github-actions[bot] commented 11 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

behines commented 11 months ago

I am the original submitter of this bug. Responding to the bot. The bug still exists as far as I know, should not be closed.