Skip to content

Comments

Add lgpio support and improve flow sensor pulse handling#8

Open
gumazza wants to merge 11 commits intoPiBrewing:mainfrom
gumazza:main
Open

Add lgpio support and improve flow sensor pulse handling#8
gumazza wants to merge 11 commits intoPiBrewing:mainfrom
gumazza:main

Conversation

@gumazza
Copy link

@gumazza gumazza commented Jan 25, 2026

This PR adds full support for lgpio, replacing RPi.GPIO, which is deprecated
and no longer reliable on newer Raspberry Pi OS versions (Bullseye/Bookworm).

Key changes

  • Replaced RPi.GPIO with lgpio
  • Fixed lost pulse issues by keeping callback references
  • Removed classic debounce logic (which caused missed pulses)
  • Added software-based physical pulse filtering
  • Default GPIO remains configurable via CraftBeerPi UI
  • Compatible with CraftBeerPi 4 installed via pipx
  • Tested on Raspberry Pi 4

Why this is needed

RPi.GPIO is deprecated and causes unreliable pulse detection on modern systems.
lgpio is the recommended replacement and is actively maintained.

Backward compatibility

  • Sensor configuration remains unchanged in the UI
  • Default GPIO behavior preserved
  • No breaking changes for existing recipes

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.

1 participant