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

Update Detect rfidoff function in gpio-buttons.py #869

Merged
merged 2 commits into from
Apr 6, 2020

Conversation

MalteHST
Copy link
Contributor

Adapted the RFID-Off function to the new gpio-buttons code structure. Works fine with the hardware hack for the USB-rfid reader described here:
#62

The rfidoff event is triggered when the used gpio is pulled down.

Adapted the RFID-Off function to the new gpio-buttons code structure. Works fine with the hardware hack for the USB-rfid reader described here:
MiczFlor#62

The rfidoff event is triggered when the used gpio is pulled down.
@@ -127,9 +128,9 @@ GPIO.setup(btn_volD , GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(btn_next , GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(btn_prev , GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(btn_halt , GPIO.IN, pull_up_down=GPIO.PUD_UP)
#GPIO.setup(btn_rfidoff, GPIO.IN, pull_up_down=GPIO.PUD_UP)
#GPIO.setup(btn_rfidoff , GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, why it’s changed from up to down?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cause the action should First be triggered after the gpio is pulled down or RFID chip ist removed.

@s-martin s-martin added this to the 2.0 milestone Mar 22, 2020
@UndIch
Copy link

UndIch commented Mar 22, 2020

can't get it to work - which pinout numbering must be used? mine is plugged in Physical pin 26
BCM pin 7, Wiring Pi pin 11. I used "7" in the script - but it won't stop upon removal - I placed a LED between the reader and grd to check if my soldering is faulty - but the Led is on as long as a raid chip is on it and turns of upon removal. Can't figure that one ...
What I did notice, after each reboot, the gpis-buttons in settings is deactivated?

@UndIch
Copy link

UndIch commented Mar 22, 2020

So I fixed the problem with the reboot and turned off gpis, and for the removal- wh.. I just changed the action to "halt.action" instead of "rfidoff_action" and now it at least stops... but why the rfidoff action is not working still needs to be figured out...

@MalteHST
Copy link
Contributor Author

You have to use the Pin number from BCM. So this is right.
Do you also use the Hardware hack described in the link of the description?
Or how is your reader connected to your BCM 7?

@MalteHST
Copy link
Contributor Author

For debugging your gpio-buttons.py script you could try to start it over the terminal/ssh by
sudo \home\RPi-Jukebox-RFID\gpio-buttons.py
If this doesn't show you any error than test all your buttons including the rfid chip.
In that way you can easily figure out whats wrong with the buttons or at which moment an action is triggered.

@UndIch
Copy link

UndIch commented Mar 22, 2020

I used the hardewarehack- and it did work before the new python version - and the „triggering“ seems to work as well - but the rfidoff_action seems to be the problem in my case - like mentioned before as soon as I change it (with identical pin numbering) to halt_action it does halt uppon removal.

@s-martin
Copy link
Collaborator

@MalteHST Could you check, if there's a up-to-date description in the wiki?

@MalteHST
Copy link
Contributor Author

No there is not. I didn´t found any description about the hardware hack and gpio-buttons.py adaption for this function.

@MalteHST
Copy link
Contributor Author

MalteHST commented Mar 29, 2020

Added a description to the wiki:
https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/Stop-on-removal-with-USB-RFID-Reader

Assigned it to the chapter Hacks. Please have a look if this is understandable enough.

@BerniPi
Copy link
Collaborator

BerniPi commented Apr 5, 2020

I used the hardewarehack- and it did work before the new python version - and the „triggering“ seems to work as well - but the rfidoff_action seems to be the problem in my case - like mentioned before as soon as I change it (with identical pin numbering) to halt_action it does halt uppon removal.

I have the exact same problem!
I found a solution:
def rfidoff_action(): check_call("./scripts/playout_controls.sh -c=playerpauseforce", shell=True)
"channel" is missing:
def rfidoff_action(channel): check_call("./scripts/playout_controls.sh -c=playerpauseforce", shell=True)

@MalteHST
Copy link
Contributor Author

MalteHST commented Apr 6, 2020

Of course you are right. Thanks. I' ve added "channel" to the Code. I think there ist no need for an additional pull request.

@BerniPi
Copy link
Collaborator

BerniPi commented Apr 6, 2020

Of course you are right. Thanks. I' ve added "channel" to the Code. I think there ist no need for an additional pull request.

Hi MalteHST,

i have an offtopic question.
I wanted to install phoniebox with the latest changes. I forked the repository and merged your changes in my fork. Then I changed the path of the oneline installscript.
The phoniebox gets installed, but i get the old gpio-buttons.py file.
Do you have a hint for me?

@MalteHST
Copy link
Contributor Author

MalteHST commented Apr 6, 2020

Sry but I´m not that familiar with forking and so on at github. But you could just copy the code after the installation of the develop branch.

@s-martin s-martin merged commit f7ccaf2 into MiczFlor:develop Apr 6, 2020
s-martin added a commit that referenced this pull request Apr 11, 2020
* save used git commit hash to version file (see #828)

* added first idea

* Get rid of debconf: falling back to frontend: Readline messages while installing

* Adapt for stretch dockerfile

* Added functions for logging

* Enable Logging during the installation

* Added config file information into logging

* Updated comments

* fixed flake8 warnings

* read current commit from Github

* Consolidate install scripts (#871)

* Remove duplicate chown/chmod

* Align stretch install scripts

* Remove stretch-install-spotify.sh script

* Add info about pkg installation (#879)

* Add info about pkg installation 

Fix for #818

* Update README.md

* added missing sudo

* Update Detect rfidoff function in gpio-buttons.py (#869)

* Update Detect rfidoff function in gpio-buttons.py

Adapted the RFID-Off function to the new gpio-buttons code structure. Works fine with the hardware hack for the USB-rfid reader described here:
#62

The rfidoff event is triggered when the used gpio is pulled down.

* Added Missing "Channel" to rfidoff Action

* add empty header context to spotify requests, fixes title and cover download (#884)

Co-authored-by: fhaertig <felix.haertig@ecube.de>

* Add info how to post logging info (#882)

* fixed flake8 warnings

Co-authored-by: Kiri <kiri@sockiri01.bbn.verigy.net>
Co-authored-by: Groovylein <kiriakos.antoniadis.kiri@gmail.com>
Co-authored-by: Micz Flor <micz.flor@web.de>
Co-authored-by: Fred G <fredg02@hotmail.com>
Co-authored-by: MalteHST <40899451+MalteHST@users.noreply.github.com>
Co-authored-by: lovethisshit <2253904+lovethisshit@users.noreply.github.com>
Co-authored-by: fhaertig <felix.haertig@ecube.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Detect RFID Removal - Play only with RFID on reader
4 participants