Skip to content

Conversation

@gumazza
Copy link

@gumazza gumazza commented Jan 19, 2026

Summary

This PR fixes a critical issue where activating one PCF8574 output would unintentionally disable the others.

Changes

  • Write full 8-bit state to PCF8574 (required by hardware)
  • Added async I2C bus lock
  • Added persistent state across CBPi4 restarts
  • Added support for multiple PCF8574 devices (0x20–0x27)
  • Added sequential relay test action
  • Updated CBPi4 API imports (CBPiActor)

Hardware tested

  • Raspberry Pi 4
  • PCF8574
  • ULN2803 relay driver
  • Relays active LOW

Result

  • Outputs are now fully independent
  • Multiple relays can be active simultaneously
  • Stable behavior under concurrent actor updates

### Summary
This PR fixes a critical issue where activating one PCF8574 output would unintentionally disable the others.

### Changes
- Write full 8-bit state to PCF8574 (required by hardware)
- Added async I2C bus lock
- Added persistent state across CBPi4 restarts
- Added support for multiple PCF8574 devices (0x20–0x27)
- Added sequential relay test action
- Updated CBPi4 API imports (CBPiActor)

### Hardware tested
- Raspberry Pi 4
- PCF8574
- ULN2803 relay driver
- Relays active LOW

### Result
- Outputs are now fully independent
- Multiple relays can be active simultaneously
- Stable behavior under concurrent actor updates
@avollkopf
Copy link
Member

I will look into it, but it'll take some time as I will be travelling the next coouple of days.

Quick question after brief review: Where do you get the "/tmp/pcf8574_state.json" file from.

This might not be working for others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants