-
Notifications
You must be signed in to change notification settings - Fork 401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace RPi.GPIO with rpi-lgpio for V2 legacy #2469
base: develop
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 12700220430Details
💛 - Coveralls |
I had similar issues and did the same thing. Now everything is working 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is not sufficient. If the pi-rc522
package is installed later on, the dependency for RPi.GPIO
is resolved and installed. In the end both libs are installed (rpi-lgpio
and rpi-gpio
) which breaks the reader.
Possible solution:
On installation of the pi-rc522
package the option "--no-deps" needs to be added, to not install the RPi.GPIO
package.
.../components/rfid-reader/RC522/requirements.txt
# RC522 related requirements
# You need to install these with `sudo python3 -m pip install --upgrade --force-reinstall --no-deps -q -r requirements.txt`
spidev
pi-rc522==2.3.0
.../components/rfid-reader/RC522/setup_rc522.sh#L26
sudo python3 -m pip install --upgrade --force-reinstall --no-deps -q -r "${JUKEBOX_HOME_DIR}"/components/rfid-reader/RC522/requirements.txt
Downside: if any other package is installed, which has a RPi.GPIO
dependecy, the reader breaks again. But i did not find any option to block a single package in pip.
Also if the rpi-lgpio
package would not be installed before, the reader is also non-functional (but as it is listed in our main reqiurement, this is negligible).
Any other/better ideas?
Another option would be to use the pi-rc522-gpiozero from @hoffie. But i did not test it yet. |
Co-authored-by: Alvin Schiller <[email protected]>
Good catch! […]
For me the downside would be ok as we don’t want to add new functionality to V2 (= no new packages) - nevertheless I’m aware so far we updated many things on V2 although we didn’t want to. maybe we can add a test to CI, which at least recognizes, if we install RPi.GPIO again. |
Turns out there are some more problems, regarding compatibility to bullseye. I also tried to keep Also the order of de-/installation of the two libs is important. It must be a deinstallation first, otherwise imports are broken What seems to work now (final tests pending, but ci looks good. Commit with the changes will follow):
|
Also to mention are some incompatibilities of the libs. See rpi-lgpio differences
|
Co-authored-by: s-martin <[email protected]>
Following the discussion in #2313 replacing RPi.GPIO with rpi-lgpio
@hoffie @varac