Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: GPIO pins setting Play Pause
#1
Hello,

on 6.7.1, I have this script to shutoff Moode. With 7.0.1, I tried to use GPIO config page (see image) but it does not work.
the button is plug on GPIO 5 and Ground.
Does it need to be on 3.3v pin instead of ground? Does it matter? Is it the same for every GPIOs.
And is it even the right command (sudo poweroff)?
And what would be the command for Play and Pause (2 buttons/switches)?

Alain


Attached Files Thumbnail(s)
   
Reply
#2
(12-30-2020, 12:57 AM)Alaini93 Wrote: Hello,

on 6.7.1, I have this script to shutoff Moode. With 7.0.1, I tried to use GPIO config page (see image) but it does not work.
the button is plug on GPIO 5 and Ground.
Does it need to be on 3.3v pin instead of ground? Does it matter? Is it the same for every GPIOs.
And is it even the right command (sudo poweroff)?
And what would be the command for Play and Pause (2 buttons/switches)?

Alain

Read the note prominently displayed on the GPIO config page.

Regard,
Kent
Reply
#3
ok thanks, so if I understand correctly what pull up means, it's that GPIO 0 to 8 must be connected to 3.3v, correct?

And about arguments in CMD?
Reply
#4
(12-30-2020, 02:27 AM)Alaini93 Wrote: ok thanks, so if I understand correctly what pull up means, it's that GPIO 0 to 8 must be connected to 3.3v, correct?

And about arguments in CMD?

Sorry, I was being too cryptic. The part of the note I was thinking about is the instruction to delimit the arguments in the CMD field with commas, so "sudo,poweroff" not "sudo poweroff".

As for the pins, I'll let those who've actually used the GPIO walk you through the details.

Regards,
Kent

ETA: PS - note also the additional information available in the 'i' popup on the 'Save' line in the GIO Config panel.
Reply
#5
thank you
Reply
#6
Hello,
 so, I found here some stuff.

I created myscript.sh

Code:
#!/bin/bash
mpc play
mpc pause


and put it under /home/pi/
then ran
Code:
sudo chmod +x /home/pi/myscript.sh

Gpio setting is like shown in picture.
All GPIOs are connected to ground.

Only the shutoff button is working, GPIO 26

What could be wrong?

Alain


Attached Files Thumbnail(s)
   
Reply
#7
The CMD's for each if the three buttons should be like below. No need for script.

mpc,play

mpc,pause

poweroff
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#8
Hi Tim,
Poweroff is working but that's it.

I connected for instance my first button to GPIO 13, that is pin 33, and to ground, pin 34
I didn't do the connection like shown in first picture (with resistors and connection to 3.3 and ground).
Should I?


Attached Files Thumbnail(s)
       
Reply
#9
Hi Tim,

 it's working, yeah, I'm so happy.
I just used other GPIOs (17-22-27, lower pins numbers), connected to ground.
one more thing resolved, next  Smile .

Thanks
Reply


Forum Jump: