I connected a LED to pin 11 as per this guide. And this works in the terminal to turn it on and off:

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

But when I try to use pi-gpio, with this code as per this guide:

var gpio = require("pi-gpio");
gpio.open(11, "output", function(err) {     // Open pin 11 for output
    gpio.write(11, 1, function() {          // Set pin 11 high (1)
        gpio.close(11);                     // Close pin 11

It gives this error message:

Error when trying to open pin 11
gpio-admin: failed to change group ownership of /sys/devices/virtual/gpio/gpio17/direction: No such file or directory

What's wrong with this? I have a Raspberry Pi 2 with Raspbian:

$ uname -a
Linux raspberrypi 4.1.7-v7+ #817 SMP PREEMPT Sat Sep 19 15:32:00 BST 2015 armv7l GNU/Linux
  • Use pinout.xyz to identify pins. WiringPi uses a different numbering system.
    – Dougie
    Dec 2, 2022 at 13:44

1 Answer 1


Hmm. Sounds like the install did not create the links for the libraries as expected. Try this answer: How to change gpio directory for node.js pi-gpio?

  • great, after applying the quick2wire-gpio-admin fix, it doesn't throw any errors, but it doesn't light up the LED :(
    – knocte
    Oct 20, 2015 at 0:17
  • Can you try the same test on another PI? Nov 24, 2015 at 20:32
  • @growlf could you include more detail in your answer, the link might answer the question, but if does not work at a later date your answer is useless
    – Darth Vader
    Apr 17, 2016 at 9:04

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.