This project is read-only.
1
Vote

Could not find file "/sys/class/gpio/gpio4"

description

Hey

I have followed this guide:

https://pisharp.codeplex.com/wikipage?title=Using%20LibGpio

My code and democode compiles fine in Visual Studio but on the Raspberry Pi i get an error

I can see it is missing a file. When I look in: /sys/class/gpio there is no gpio4 folder.
How do I get this folder??

When testmode active : LibGpio.Gpio.TestMode = true; - there are no errors but then I can't use the GPIO

Error:

Unhandled Exception:
System.IO.FileNotFoundException: Could not find file "/sys/class/gpio/gpio4"
File name: '/sys/class/gpio/gpio4'
at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00000] in <filename unknown>:0
at System.IO.Directory.CreateDirectory (System.String path) [0x00000] in <filename unknown>:0
at PiSharp.LibGpio.LibGpio.Export (BroadcomPinNumber pinNumber) [0x00000] in <filename unknown>:0
at PiSharp.LibGpio.LibGpio.SetupChannel (BroadcomPinNumber pinNumber, Direction direction) [0x00000] in <filename unknown>:0
at RaspberryGPIO1.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not find file "/sys/class/gpio/gpio4"
File name: '/sys/class/gpio/gpio4'
at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00000] in <filename unknown>:0
at System.IO.Directory.CreateDirectory (System.String path) [0x00000] in <filename unknown>:0
at PiSharp.LibGpio.LibGpio.Export (BroadcomPinNumber pinNumber) [0x00000] in <filename unknown>:0
at PiSharp.LibGpio.LibGpio.SetupChannel (BroadcomPinNumber pinNumber, Direction direction) [0x00000] in <filename unknown>:0
at RaspberryGPIO1.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0

comments