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

Bug?: Setting gpio active_low via sys/class

Thu May 09, 2019 7:08 pm

Hi

I think I've found a bug, and as far as I can tell, this is the right place to report it.

I'm trying to set active_low via sys/class for a GPIO input.but cannot get the pull up resistor to pull up. . For reference this is on a RPi 3 B+, with Debian Stretch fully updated.

I have a switch attached to pin 12, GPIO 18, via a resistor to 0V. The pull up is set high, which I can measure with a meter, if the pull up is set via a non /sys/class method.

If I enter the following:

Code: Select all

sudo su
echo 18 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio18/direction
echo 1 > /sys/class/gpio/gpio18/active_low
Then the pin should be set high.

Code: Select all

cat /sys/class/gpio/gpio18/active_low
confirms active_high has been set to 1

After entering this, I would expect the input to be pulled high, but putting a meter on it, the pin is not.

Is this a bug, or am I misunderstanding something here.

Thanks

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

Re: Bug?: Setting gpio active_low via sys/class

Thu May 09, 2019 7:52 pm

I'm not sure where this should be reported. Almost certainly not here as sysfs is a kernel thing. Given that sysfs is deprecated I wonder if anyone will be bothered.

As a matter of interest what do you expect to happen if the embedded system does not have internal pull-ups or pull-downs?

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

Re: Bug?: Setting gpio active_low via sys/class

Thu May 09, 2019 9:29 pm

Well, while researching the sysfs replacement, I found that one of the disadvantages of sysfs is it doesn't support pull up resistor setting. So, it's not a bug, it just never worked.

Thanks

Return to “Raspbian”