-
Notifications
You must be signed in to change notification settings - Fork 398
Stop on removal with USB RFID Reader
This short description is a status summary of different issues and posts around the "stop on removal" feature. Based on the inital post from zxa which can be seen here: https://github.com/MiczFlor/RPi-Jukebox-RFID/issues/62
Some of you want that the audio is played as long as the rfid chip is on the reader and stops or pause when its removed. The problem is that the reader transmits the card number via USB only one time after it read it and there's no way via USB to "see" for the RPi if the card is still near the reader.
In many USB RFID Readers there is a green and red LED inside which shows the actual status of the reader. Green for: Seeing card as long as the card/chip stays in the reader range; Red for: no card. If you open your reader you will hopefully the something like this:
When the red led is on ("the idle state") there are approx. 2.7 V on point A and a few mV on point B. When the green LED is active (a card is near), there are 3.2 V on point B. This is almost exactly the voltage a GPIO of the RPi can bear. At next, you have to attach a 5k Ohm to point B (thanks to the manufacturer for the convenient soldering point in the board) and wire it with a free GPIO pin:
If you are using the PHATBeat from Pimoroni, BCM25 could be a convenient free pin for your setup. Please check this on your own.
The configuration of this feature is actually not considered during the one-line installation. Please update gpio_control.ini on your own. Over SSH type the following command in the terminal:
sudo nano /home/RPi-Jukebox-RFID/settings/gpio_settings.ini
Append
[RFIDDevice]
enabled: True
type: Button
pin: 21
pull_up_down: pull_up
functionCall: functionCallPlayerStop
Update the Pin depending which GPIO you use.
On the PCB bareboard of the reader you can find the actual revision of the layout.
While above example is for the most common pcb layout FP9291_1V5 there is a second layout called FP9291_2V0.
In above example the 3.2V on Point B can be measured if the green LED is on and a card is present. With PCB layout FP9291_2V0 it is exactly opposite behaviour:
If no RFID is detected by the reader 3.2V is on, while there is only minimal output if no RFID tag is present.
To achieve the stop on removal behaviour the gpio_control.ini must be slightly different:
sudo nano /home/RPi-Jukebox-RFID/settings/gpio_settings.ini
Append
[RFIDDevice]
enabled: True
type: Button
pin: 21
edge: rising
pull_up_down: pull_up
functionCall: functionCallPlayerStop
Exit and save the file afterwards.
If you now test a RFID chip (must not be registered, just readable with your reader) you should only get a feedback when you remove your chip.
Of course you have to activate GPIO over the Web-App to use this feature. Pay attention that you donΒ΄t have any double assignment for BCM pins in the gpio_settings.ini.
"LED voltage GPIO button" is pressed and stays in that state until the card is removed. Then the "released" event is triggered by the gpio-control. In gpio-cntrol the removal is defined to trigger "functionCallPlayerStop" from the playout controls. This means the audio is stopped by removal.
Thanks to: zxa , dertobes, see also https://github.com/MiczFlor/RPi-Jukebox-RFID/issues/1049
If you like Phoniebox, consider: buy me a coffee or PayPal
- Code: https://github.com/MiczFlor/RPi-Jukebox-RFID
- Phoniebox home page: English | Deutsch
Phoniebox is a contactless jukebox for the Raspberry Pi, playing audio files, playlists, podcasts, web streams and spotify triggered by RFID cards. All plug and play via USB, no soldering iron needed. Update: if you must, it now also features a howto for adding GPIO buttons controls.
Visit Phoniebox.de
π₯ Version 3
- β Releases
- π΅ Install Jukebox Version 3
- π Report a bug
- π Propose a feature
- βοΈ Feature Status
- π Documentation
- π©βπ» Development
- βοΈ Contributing
- π¦ Code
πΆ Version 2
- β Releases
- π΅ Install Jukebox Version 2
- π Report a bug
- βοΈ Features
- π Documentation
- βοΈ Contributing
- π¦ Code
Version 2 Pages
-
Setup / Upgrades
- Synchronising Phonieboxes in a local network
- Smart Home remote control with MQTT
- Hardware Pinout Overview
- Systemwide Equalizer
- Phoniebox with read-only Filesystem
- HiFiBerry Soundcard Details
- WM8960 Hi-Fi HAT
- PAM8403 Amplifier Power Off
- TPA3118 Amplifier Power Off and EMI improvement
- External Non USB Audio DAC ES9023, PCM5102, etc.
- On-board LEDs with fibre optics
- Setting GPIOs at boot time
- Stop on removal with USB RFID Reader
- Firmware update improves audio out
- Architecture