Skip to content
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

🐛 | RC522 cards not detected #2405

Closed
oliboss opened this issue Jul 25, 2024 · 2 comments
Closed

🐛 | RC522 cards not detected #2405

oliboss opened this issue Jul 25, 2024 · 2 comments
Labels
bug future3 Relates to future3 development needs triage

Comments

@oliboss
Copy link

oliboss commented Jul 25, 2024

Version

3.5.3

Branch

future3/main

OS

Raspbian Bookworm 12 - 32 bit

Pi model

Raspberry Pi 4

Hardware

  • RFID reader RC533
  • HiFi AMP HAT TAS5713 Amplifier Audio Module

What happened?

Current behavior:

  • Jukebox is working in terms of playback, library, etc.
  • After using break-system-packages on pip installs the RFID reader could be selected and the install script installed all python dependencies
  • RFID reader is connected according to the schema on the website
  • This simple python script shows the ids from different cards / tokens
#!/usr/bin/env python3
import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522
reader = SimpleMFRC522()

try:
        id, text = reader.read()
        print(id)
        print(text)
finally:
        GPIO.cleanup()
  • When going in the web interface, select "add a card" and presenting a card nothing happens

Expected behavior:

  • Card should be recognized

Logs

error.log.1

25.07.2024 16:42:19 -  650:plugs.py           - jb.plugin            - ShutdownThread  - ERROR    - Ignoring failed package atexit function: 'rfid.atexit()'
25.07.2024 16:42:19 -  651:plugs.py           - jb.plugin            - ShutdownThread  - ERROR    - Reason: AttributeError: 'NoneType' object has no attribute 'stop'
25.07.2024 16:42:19 -  652:plugs.py           - jb.plugin            - ShutdownThread  - ERROR    - Detailed reason:
Traceback (most recent call last):
  File "/home/user/RPi-Jukebox-RFID/src/jukebox/jukebox/plugs.py", line 648, in close_down
    results.append(func(**kwargs))
                   ^^^^^^^^^^^^^^
  File "/home/user/RPi-Jukebox-RFID/src/jukebox/components/rfid/reader/__init__.py", line 264, in atexit
    reader.stop()
  File "/home/user/RPi-Jukebox-RFID/src/jukebox/components/rfid/reader/__init__.py", line 136, in stop
    self._reader.stop()
    ^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'stop'

Configuration

rfid.yaml

rfid:
  readers:
    read_00:
      module: rc522_spi
      config:
        spi_bus: 0
        spi_ce: 0
        pin_irq: 24
        pin_rst: 25
        mode_legacy: false
        antenna_gain: 4
        log_all_cards: false
      same_id_delay: 1.0
      log_ignored_cards: false
      place_not_swipe:
        enabled: false
        card_removal_action:
          alias: pause

More info

No response

@oliboss oliboss added bug future3 Relates to future3 development needs triage labels Jul 25, 2024
@plimptm
Copy link

plimptm commented Jul 26, 2024

Have you read through this issue thread for bookworm related issues? There are known issus with gpio.

As of now, you do have to pip swap rpi-gpio with rpi-lgpio.

@oliboss
Copy link
Author

oliboss commented Jul 28, 2024

Thanks a lot for the quick reply.

I got it to work with the lpio replacement but it stopped working soon after - which most likely is due to some other issue.

@oliboss oliboss closed this as completed Jul 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug future3 Relates to future3 development needs triage
Projects
None yet
Development

No branches or pull requests

2 participants