2

With my raspbian I used to use the command gpio. Unfortunately, I forgot how I installed it, or if it came installed by default in Raspbian.

Now I'm playing with UbuntuCore for RaspberryPi, and I have the need of using this command again, but it's not clear how to install it.

By googling around, I've seen people recommending installing these packages:

sudo apt-get install python-pip python-dev
sudo pip install RPi.GPIO
sudo pip install wiringPi
sudo pip install gpio

But that doesn't bring the gpio command, apparently.

The commands I want to launch via gpio are this kind:

gpio mode 0 out
gpio write 0 1
gpio write 0 0

How can I install gpio?

knocte
  • 157
  • 1
  • 1
  • 8
  • The tool that provides a syntax you describe should come with wiringpi http://wiringpi.com/the-gpio-utility/ – Ghanima Aug 27 '16 at 23:40
  • I already said that I installed wiringPi through sudo pip install and that doesn't make gpio command appear – knocte Aug 27 '16 at 23:41
  • I had the same problem in debian, solve -> https://command-not-found.com/gpiodetect – Rodrigo Santos Jul 01 '22 at 00:47
  • Just joining the party and though I tried the above mentioned solutions, none worked with my Rpi4b. However this site had a solution that worked for me: https://category.yahboom.net/blogs/news/raspberry-pi-1?comment=133519966524#comments – pademo57 Feb 10 '23 at 17:25
  • @pademo57 you should post that as an answer, not a comment – knocte Mar 06 '23 at 03:28

5 Answers5

4

A little bit late, but as can be found here: http://wiringpi.com/download-and-install/ simply type

sudo apt-get install wiringpi

This installs the gpio command.

Dmitry Grigoryev
  • 27,928
  • 6
  • 53
  • 144
Rene
  • 41
  • 1
2
docker run --rm --device /dev/ttyAMA0:/dev/ttyAMA0 --device /dev/mem:/dev/mem --privileged -ti python:2 /bin/sh
apt-get update && apt-get install git-core sudo
git clone https://github.com/WiringPi/WiringPi --depth 1
cd WiringPi/
./build
gpio readall
2

sudo pip install won't work, because it is NOT a Python program.

The following answer explains how to install it and also how to get the missing man pages. https://raspberrypi.stackexchange.com/a/51378/8697

Milliways
  • 59,890
  • 31
  • 101
  • 209
  • wiringpi doesn't seem to be available for this version of ubuntu (ubuntu-core snappy?) – knocte Aug 28 '16 at 02:07
  • 1
    If it is not in the distribution, you can always install it from source http://wiringpi.com/download-and-install/ – Milliways Aug 28 '16 at 02:30
0

I think your pip is pip3 you can try this code.

sudo apt install python-pip3 python-dev
sudo pip3 install RPi.GPIO
sudo pip3 install wiringPi
sudo pip3 install gpio
MatsK
  • 2,791
  • 3
  • 16
  • 20
pradip
  • 1
0

This is wiringpi.com.

As of the end of 2023, you'll not find anything here anymore. It's gone.

Email if you want - if you know my email address. Work it out.

-Gordon

d3vopz
  • 1