Skip to content

Stop on removal with USB RFID Reader

s-martin edited this page Dec 15, 2020 · 6 revisions

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

Purpose / Issue:

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.

Hardware Modification:

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.

Script Modification:

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_control.ini

Append

[RFIDDevice] enable: True Type: Button Pin: 21 pull_up: True functionCall: functionCallPlayerStop

Update the Pin depending which GPIO you use.

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.

For further explanation:

"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

Home

πŸ”₯ Version 3

Version 3 Pages

Nothing yet

🎢 Version 2

Version 2 Pages

Installation

Specials

RFID Reader

Sound card configurations

Hardware Buttons

Displays (LED, LCD, Matrix, etc.)

Hacks

Bluetooth

AirPlay

MPD tricks

For Developers

Clone this wiki locally