Failed to open a handle to the device when opening GPIO pin

Arn Vanhoutte

Everytime I open a GPIO pin I get this exception:

WinRT information: Failed to open a handle to the device.
A resource required for this operation is disabled.

I can't seem to find much information for this on the internet. Probably because UAP is still in a preview. And I don't think something is wrong with my code, it is almost the same one from the Blink example:

GpioController gpio = GpioController.GetDefault();
if (gpio != null)
{
    var ledpin = gpio.OpenPin(11);
    ledpin.Write(_light ? GpioPinValue.High : GpioPinValue.Low);
    ledpin.SetDriveMode(GpioPinDriveMode.Output);
}
S.Spieker

Only a subset of pins are available to usermode. Most pins are reserved by the system and cannot be accessed from usermode.

As far as I know pin 11 is not available. Try pin 12 or 13.

List of available Pins:

GPIO#   Power-on Pull   Header Pin
4       PullUp           7
5       PullUp          29
6       PullUp          31
12      PullDown        32
13      PullDown        33
16      PullDown        36
17      PullDown        11
18      PullDown        12
19      PullDown        35
20      PullDown        38
21      PullDown        40
22      PullDown        15
23      PullDown        16
24      PullDown        18
25      PullDown        22
26      PullDown        37
27      PullDown        13
35      PullUp          Red Power LED
47      PullUp          Green Activity LED

Pi2 layout

Edit: Added missing GPIOs

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

PHP error failed to open stream/failed opening

From Dev

PHP error failed to open stream/failed opening

From Dev

libusb_open_device_with_vid_pid failed when trying to access USB device

From Dev

Want pulldown on gpio pin

From Dev

GPIO interrupt triggered by different pin

From Dev

"Handle is invalid" error when opening SqlConnection

From Dev

Opening MapKit pin in Maps

From Dev

Opening MapKit pin in Maps

From Dev

How to prevent "Unable to open MTP device" popups from opening?

From Dev

"This GPIO pin already exists:" GPIO 1 Exception on Second Time

From Dev

rpi-gpio pin always high/low

From Dev

Session Variable not accessible when opening website on other device [php code]

From Dev

How to handle options when opening a file passed as argument?

From Dev

java.io.filenotfoundexception open failed eacces (permission denied) on device

From Dev

java.io.filenotfoundexception open failed eacces (permission denied) on device

From Dev

Failed to open root LUKS device on LVM during boot

From Dev

What happen when you open/close a handle?

From Dev

Unable to write to a GPIO pin despite file permissions on /sys/class/gpio/gpio18/value

From Dev

Unable to write to a GPIO pin despite file permissions on /sys/class/gpio/gpio18/value

From Dev

Failed to open stream when uploading image to server

From Dev

Failed to open stream when uploading image to server

From Dev

Failed to get open extension when use delta

From Dev

Command Line to open ReadMe file when opening project in Visual Studio

From Dev

Programmatically open markdown-preview in Atom when opening a markdown file

From Dev

UI Bootstrap - how to prevent tooltip opening when dropdown is open

From Dev

Windows 10, Keep Start Menu open when opening apps

From Dev

Geany: Open a new instance per workspace when opening a file in that workspace

From Dev

Keep Finder from opening when no other apps are open

From Dev

Why There Is No Need To Open A New Thread When Opening A Socket Connection In iOS

Related Related

  1. 1

    PHP error failed to open stream/failed opening

  2. 2

    PHP error failed to open stream/failed opening

  3. 3

    libusb_open_device_with_vid_pid failed when trying to access USB device

  4. 4

    Want pulldown on gpio pin

  5. 5

    GPIO interrupt triggered by different pin

  6. 6

    "Handle is invalid" error when opening SqlConnection

  7. 7

    Opening MapKit pin in Maps

  8. 8

    Opening MapKit pin in Maps

  9. 9

    How to prevent "Unable to open MTP device" popups from opening?

  10. 10

    "This GPIO pin already exists:" GPIO 1 Exception on Second Time

  11. 11

    rpi-gpio pin always high/low

  12. 12

    Session Variable not accessible when opening website on other device [php code]

  13. 13

    How to handle options when opening a file passed as argument?

  14. 14

    java.io.filenotfoundexception open failed eacces (permission denied) on device

  15. 15

    java.io.filenotfoundexception open failed eacces (permission denied) on device

  16. 16

    Failed to open root LUKS device on LVM during boot

  17. 17

    What happen when you open/close a handle?

  18. 18

    Unable to write to a GPIO pin despite file permissions on /sys/class/gpio/gpio18/value

  19. 19

    Unable to write to a GPIO pin despite file permissions on /sys/class/gpio/gpio18/value

  20. 20

    Failed to open stream when uploading image to server

  21. 21

    Failed to open stream when uploading image to server

  22. 22

    Failed to get open extension when use delta

  23. 23

    Command Line to open ReadMe file when opening project in Visual Studio

  24. 24

    Programmatically open markdown-preview in Atom when opening a markdown file

  25. 25

    UI Bootstrap - how to prevent tooltip opening when dropdown is open

  26. 26

    Windows 10, Keep Start Menu open when opening apps

  27. 27

    Geany: Open a new instance per workspace when opening a file in that workspace

  28. 28

    Keep Finder from opening when no other apps are open

  29. 29

    Why There Is No Need To Open A New Thread When Opening A Socket Connection In iOS

HotTag

Archive