Posts: 4
Threads: 1
Joined: Sep 2020
Reputation:
0
Hi Guys,
This is my first time using this software and my first time on the forum so please forgive any silly mistakes. I am running 6.7.1 on a pi 3 b+.
I am not able to get the gpio pins to carry out the instructions set in the configuration. I have set multiple pins with the instruction:
"sudo, poweroff"
This does not seem to work, regardless of if I bring this pin to 3.3V or Gnd. I have been able to SSH in to the board and use all commands from there however. Is there anything I have overlooked or has anyone got any experience with this problem before?
Thanks,
Ciarán
Posts: 4
Threads: 1
Joined: Sep 2020
Reputation:
0
Hi Tim,
Cheers for such a quick reply, I put this question up late at night hoping for an answer maybe by end of work the next day but ye are lightning fast.
I tried removing sudo with no effect. I've also tried other commands such as mpc play etc and these don't seem to be workings when I connect my pin to Gnd or 3.3v.
Would there be anything in the settings which might default to off which would make moode ignore gpio pins entirely or do you have any other suggestions on what might fix this issue
Posts: 579
Threads: 16
Joined: Apr 2020
Reputation:
23
If you want to check if the hardware is still functioning, you can use the command tool gpio.
Needs admins rights so call it with sudo in front of it.
It the hardware is ok but the scripts gives problems, you can also use an overlay for it, by adding adding a line like to /boot/config:
dtoverlay=gpio-shutdown,gpio_pin=22,active_low=0,gpio_pull=off
Exact settings depend on you system button wiring.
Check /boot/overlays/README for more documentation about the overlays, contains some neat tricks ;-)
Posts: 4
Threads: 1
Joined: Sep 2020
Reputation:
0
09-10-2020, 06:09 PM
(This post was last modified: 09-10-2020, 07:50 PM by CHickey.
Edit Reason: Update on status of issue
)
Okay so I tried the suggestions above.
For Tim's suggestion of running buttons.py I got back:
"2020-09-10 18:36:37 sw_1: pin=7, enabled=1, bounce_time=1000, CMD=poweroff" but still no response from my button. The console was then in a loop so I had to ctrl-c out.
As regards bitlabs suggestion I checked out the gpios with a gpio readall before and after pressing the button. This brought the voltage on my chosen pin 7 from 1v to 0v.
I then customised the line of code for config.txt tosuit my situation but to no effect unfortunately although I am fuzzy as to what the last param should be set to.
I have now set gpio_pull=up which has fixed my issue and I now have a working power button
Still wondering what was wrong with the gpio handler, but I am able to work around it.
Thanks guys
Posts: 14,005
Threads: 319
Joined: Mar 2018
Reputation:
571
09-10-2020, 08:01 PM
(This post was last modified: 09-10-2020, 08:02 PM by Tim Curtis.)
Below is from the ( i ) in GPIO Config
NOTE: Use a comma to delimit arguments in the CMD field. Example: mpc,load,My Playlist
SAVE: Update the button configuration and restart GPIO button handler.
GPIO Pins
- The GPIO button handler configures pins as input / pull-up.
- The pins are 3V3. Pins GPIO2 and GPIO3 have fixed pull-up resistors.
- At power on the pins are set to input mode, pins 0-8 are pull-ups to 3V3, pins 9-27 are pull-downs to 0V.