I just starting with Raspberry PI and I have first problem with understanding what's happen with GPIO. I have installed wiringPI and after call readall GPIO. 7 is set to 1 and I can't change it to 0 by gpio write 7 0.

Here is the screenshoot: enter image description here

Changing value via Pigs also doesn't work: enter image description here

  • Have you tried it with sudo? – Steve Robillard Feb 8 '15 at 16:20
  • Yes, I tried. I tried with different pins and it doesn't work with wPi 0 too. But works with wPi: 2 and 3 (without sudo). – Sławomir Rosiek Feb 8 '15 at 16:21
  • What does pigs report? (sudo pigpiod then pigs w 4 0 r 4 w 4 1 r 4) – joan Feb 8 '15 at 16:38
  • @joan - I'm unable to install pigs. After calling make it hang on this: gcc -03 -Wall -c -o pigpio.o pigpio.c. – Sławomir Rosiek Feb 8 '15 at 16:58
  • It probably isn't hanging. The compilation of pigpio.c takes three minutes on a Pi. Be patient. – joan Feb 8 '15 at 17:02


su root

You will need the root password. sudo alone is a PITA for the next few steps because of redirection.

cd /sys/class/gpio

If you see a gpio7 directory there already, skip the next step.

echo 7 > export

There should now be a gpio7 directory.

cd gpio7
echo out > direction
echo 0 > value
cat value

The last command should report 0. If not, as joan says, something mysterious is going on with the hardware.

| improve this answer | |
  • wiringPi has been updated and should now work on a Pi 2. pigpio does not currently work on a Pi 2 (in fact it will hang the machine). – joan Feb 8 '15 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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