Moode Forum
[SOLVED] GPIO pins setting Play Pause - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7)
+--- Thread: [SOLVED] GPIO pins setting Play Pause (/showthread.php?tid=3308)



GPIO pins setting Play Pause - Alaini93 - 12-30-2020

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


RE: GPIO pins setting - TheOldPresbyope - 12-30-2020

(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


RE: GPIO pins setting - Alaini93 - 12-30-2020

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?


RE: GPIO pins setting - TheOldPresbyope - 12-30-2020

(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.


RE: GPIO pins setting - Alaini93 - 12-30-2020

thank you


RE: GPIO pins setting - Alaini93 - 01-02-2021

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


RE: GPIO pins setting - Tim Curtis - 01-02-2021

The CMD's for each if the three buttons should be like below. No need for script.

mpc,play

mpc,pause

poweroff


RE: GPIO pins setting - Alaini93 - 01-02-2021

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?


RE: GPIO pins setting - Alaini93 - 01-03-2021

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