Sorry for the very basic question. I am trying to set a built-in pullup on GPIO pins and it doesn't seem to be working. Hardware is Pi 3B and 4B (I tried on both), OS is Raspbian 10 (buster). The wiringPi pin 0 (BCM pin 17) is not connected to anything:

% gpio mode 0 input 
% gpio mode 0 up 
% gpio read 0 

Should this pin not be reading back a 1 due to the pull-up? What am I missing?

  • Which model Pi? Which distribution?
    – joan
    Oct 31, 2019 at 19:45
  • Pi 4B and 3B. I tried on both. Current Raspbian (version 10 buster) OS. Oct 31, 2019 at 21:24
  • 2
    You should edit your question and/or the tags to include that information.
    – joan
    Oct 31, 2019 at 21:41
  • Have you tried gpio mode 0 in instead of input? wiringpi.com/the-gpio-utility lists in as the command for reading a pin.
    – Fred
    Nov 2, 2019 at 8:57

2 Answers 2


wiringPi pull-ups and pull-downs do not work on the Pi4B. The ways the pulls work has changed in the new BCM2711 SoC used in the Pi4B.

See this question.

As far as I know they do work correctly on the Pi3B (but I have not tested recently).


set the pullups in config.txt or use raspi-gpio command.

  • It'd be helpful if you'd explain how in more detail.
    – user96931
    Mar 23, 2020 at 18:23
  • This link contains the info on how to set up gpio pins at boot time y /boot/config.txt file. raspberrypi.org/documentation/configuration/config-txt/gpio.md Mar 24, 2020 at 23:30
  • other way that worked to me was explained at wiring.org. cd /tmp wget project-downloads.drogon.net/wiringpi-latest.deb sudo dpkg -i wiringpi-latest.deb (wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b) apliying this method you will end up with 2.62 version instead of 2.52. But I hope 2.62 will solve your problems and you will get everything working just using Gordon Henderson's great library. (Please do not send questions to his mail). Mar 24, 2020 at 23:39
  • the third option si to use raspi-gpio tool. The raspi-gpio tool is designed to help hack / debug BCM283x GPIO. Running raspi-gpio with the help argument prints this help. raspi-gpio can get and print the state of a GPIO (or all GPIOs) and can be used to set the function, pulls and value of a GPIO. raspi-gpio must be run as root. Use: raspi-gpio get [GPIO] OR raspi-gpio set <GPIO> [options] OR raspi-gpio funcs [GPIO] OR raspi-gpio raw Mar 24, 2020 at 23:49
  • hope this may be useful for you. I' bored making quarantine here in Argentina!!! Mar 24, 2020 at 23:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.