paulv
Posts: 558
Joined: Tue Jan 15, 2013 12:10 pm
Location: Netherlands

poweroff no longer works on GPIO-28-31? [SOLVED]

Wed Jul 13, 2016 11:59 am

[UPDATE]
It turns out that GPIO port 28 and 29 on P5 are shorted to ground (3 Ohm and 5 Ohm) on my Model 1 A. Ports 30 and 31 work fine. I have never used these 4 ports, and never noticed any strange behavior on the others on P1. I see no evidence of an issue on the PCB with a strong magnifying glass. This Model A was used for several years running my HVAC system 24x7. Weird. I'm assuming I'm out of warranty? :cry:

------------------
It seems to me that the RPi.GPIO support and the dt-overlay for the poweroff is has very recently been removed and no longer supports the GPIO ports (28, 29, 30 and 31) on the P5 connector (available on the Model 1 A and B).

While it is a shame to take this support away, because of the limited number of GPIO ports on those two models. Because it is possible to "isolate the Model A and B in the config.txt file, there seems to be no harm to put it back in for just those two models, and only leave it out for the other models.

Can the disappearance please be confirmed?

Can it be put back?

Thank you!
Last edited by paulv on Thu Jul 14, 2016 9:06 am, edited 2 times in total.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2312
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: poweroff no longer works on GPIO-28-31?

Wed Jul 13, 2016 1:20 pm

No - it still exists:

Code: Select all

[email protected]:~$ dtoverlay -h i2s-gpio28-31
Name:   i2s-gpio28-31

Info:   move I2S function block to GPIO 28 to 31

Usage:  dtoverlay=i2s-gpio28-31

Params: <None>
Is it possible that your config.txt says:

Code: Select all

dtoverlay=i2s-gpio28-31-overlay   # WRONG
where it should say:

Code: Select all

dtoverlay=i2s-gpio28-31           # RIGHT
?

paulv
Posts: 558
Joined: Tue Jan 15, 2013 12:10 pm
Location: Netherlands

Re: poweroff no longer works on GPIO-28-31?

Wed Jul 13, 2016 6:32 pm

Hi Phil,

There is no such statement anywhere.
This is the config.txt file I use to move between my Models (1) A and B, and the Models 2B and 3B.
Up until a few weeks ago, this worked. Today, these ports do no longer (seem to?) work. It seems they are pulled to ground really hard, not with the 50K internal pull, even if I declare them as input. (the Python code is in the post as well, just using different ports)

This is the application I'm working on: viewtopic.php?f=37&t=150358
I finished my hardware design and wanted to build it inside the RPi housing.

Right now, I'm using this on a Model (1) A.

This is what I currently have in config.txt :

Code: Select all

[email protected]:~ $ sudo cat /boot/config.txt
# For more options and information see
# http://www.raspberrypi.org/documentation/configuration/config-txt.md
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800
#arm_freq_min=600

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on
gpu_mem=16

# Enable the hardware watchdog
#dtparam=watchdog=on

# Activating the poweroff overlay
dtoverlay=gpio-poweroff,gpiopin=25,active_low="y"
#dtoverlay=gpio-poweroff,gpiopin=29
Running the dtoverlay -h i2s-gpio28-31 command produces :

Code: Select all

Name:   i2s-gpio28-31

Info:   move I2S function block to GPIO 28 to 31

Usage:  dtoverlay=i2s-gpio28-31

Params: <None>
I didn't know about it, what does it do, and when do you need to use it?

I tried a new image today (2016-05-27-raspian-jessie-lite) and used raspi-config on the Model (1) B to configure it, thinking that would have changed things on the Model (1) A or B, but that image shows the same problem.

I switched back to my other image, and this is at :

Code: Select all

[email protected]:~ $ uname -a
Linux raspi-tst 4.4.13+ #894 Mon Jun 13 12:43:26 BST 2016 armv6l GNU/Linux
Weird!?

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2312
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: poweroff no longer works on GPIO-28-31?

Thu Jul 14, 2016 9:03 am

Armed with more details of your configuration I dug out an old Rev 2 Pi, soldered on a header and ran some tests. From what I can see the overlay is behaving as it should. The attached screenshot shows it running with GPIO29 and then GPIO25, using the active_low setting (you don't need to quote the 'y'). As you can see it works for me.

Perhaps you could try using raspi-gpio to toggle a few GPIOs and see what the behaviour is. The pin nominated for gpio-poweroff duty will be set to an output. Note that the GPIO level is determined from the voltage at the pin, even when the pin is configured as an output - if the pin is pull down strongly you will see that the level is always 0 even if it is being driven high.

Code: Select all

raspi-gpio get 29
raspi-gpio set 29 op dh
raspi-gpio get 29
raspi-gpio set 29 op dl
raspi-gpio get 29
raspi-gpio set 29 ip
raspi-gpio get 29
BTW the dtoverlay command allows overlays to be applied at runtime (some more successfully than others). I was just using the -h option to read the help info from /boot/overlays/README.
Attachments
gpio-poweroff.png
gpio-poweroff.png (54.79 KiB) Viewed 1522 times

paulv
Posts: 558
Joined: Tue Jan 15, 2013 12:10 pm
Location: Netherlands

Re: poweroff no longer works on GPIO-28-31? [SOLVED]

Thu Jul 14, 2016 9:11 am

Oh Phil, I caused you to waist needless efforts in trying to solve my problem.
I investigated the issue on my Model A this morning and tried to replicate it on my B's. They work fine.

Turns out, I have a defective Model A.
Ports 28 and 29 are shorted to ground. I never, ever assumed this would be the case, so I did not investigate my problem fully due to lack of time yesterday.

Thank you very much for diving in to this issue, sorry for wasting your time.

I owe you,

Paul
Last edited by paulv on Thu Jul 14, 2016 9:14 am, edited 1 time in total.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2312
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: poweroff no longer works on GPIO-28-31? [SOLVED]

Thu Jul 14, 2016 9:13 am

No you don't - just keep contributing to the community.

Return to “Device Tree”