User avatar
ddwwcc
Posts: 7
Joined: Wed Jan 02, 2019 11:06 am
Contact: Website

Setting the GPIO pull up resistor

Wed May 08, 2019 11:24 am

Hi

I'm trying to get a simple button input to GPIO working, with a particular program I'm using, which uses a cut down version of Debian Stretch. For reference the program is QLC+ 4.12.1 on a RPi 3 B+, but cannot get the pull up resistor to pull up.

I have a switch attached to pin 12, GPIO 18, via a resistor to 0V. The switch works, if testing using a non QLC+ install. On the non QLC+ install (Pi Presents on a standard Raspian install) I can put a meter on pin 12, and see that the pin is pulled up.

On the QLC+ install, I am setting the pull up resistor, by entering this:

Code: Select all

echo 18 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio18/direction
echo 1 > /sys/class/gpio/gpio18/active_low
After entering this, I would expect the input to be pulled high, but putting a meter on it, the pin is not.

I know there are other ways of doing this, but 1) I would like to know why this specifically is not working, and 2) This will be the most convenient way of configuring QLC+

I'm obviously missing a bit of configuration, but unsure what it is.

Any help would be appreciated.

User avatar
rpdom
Posts: 14744
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Setting the GPIO pull up resistor

Wed May 08, 2019 11:52 am

I don't believe you can set the pull-up/down values via the sysfs interface.

If you have Wiring Pi installed you can use the gpio command to set the optiosn you want

Code: Select all

gpio -g mode 18 up
That configures BCM gpio 18 to input with the internal pull-up set.

User avatar
ddwwcc
Posts: 7
Joined: Wed Jan 02, 2019 11:06 am
Contact: Website

Re: Setting the GPIO pull up resistor

Wed May 08, 2019 1:13 pm

I general google around says I can, although I agree this is not definitive.

This doc, for instance says I can:

http://raspberrypi.znix.com/hipidocs/topic_gpiodev.htm

As I said, It's a cut down version, so has very little installed, hence the swapping cards to check hardware.

User avatar
joan
Posts: 14079
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Setting the GPIO pull up resistor

Wed May 08, 2019 2:24 pm

Surely that either works with the sysfs interface or it doesn't?

If it works why ask a question?

User avatar
ddwwcc
Posts: 7
Joined: Wed Jan 02, 2019 11:06 am
Contact: Website

Re: Setting the GPIO pull up resistor

Wed May 08, 2019 3:13 pm

Because I can't get it to work.

User avatar
joan
Posts: 14079
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Setting the GPIO pull up resistor

Wed May 08, 2019 3:21 pm

I tried the commands on GPIO 4. It doesn't work for me either.

It never used to work, apparently it still doesn't work.

Use a non-sysfs alternative.

User avatar
ddwwcc
Posts: 7
Joined: Wed Jan 02, 2019 11:06 am
Contact: Website

Re: Setting the GPIO pull up resistor

Thu May 09, 2019 6:51 pm

Looks like a bug, then. I'll put in a bug report.

Return to “Troubleshooting”