Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » Gpio pin already exist Exception
Gpio pin already exist Exception [message #1609501] Tue, 10 February 2015 06:36 Go to next message
manikandan panchabihesan is currently offline manikandan panchabihesanFriend
Messages: 3
Registered: February 2015
Junior Member
I am working on kura in that blinking LED light by using pi4j with gpio in raspberry pi. But it is working first time.When running second time i got the below error,

com.pi4j.io.gpio.exception.GpioPinExistsException: This GPIO pin already exists: GPIO 1
com.pi4j.io.gpio.impl.GpioControllerImpl.provisionPin(GpioControllerImpl.java:507)
com.pi4j.io.gpio.impl.GpioControllerImpl.provisionDigitalOutputPin(GpioControllerImpl.java:645)
com.pi4j.io.gpio.impl.GpioControllerImpl.provisionDigitalOutputPin(GpioControllerImpl.java:672)
Re: Gpio pin already exist Exception [message #1614169 is a reply to message #1609501] Fri, 13 February 2015 04:34 Go to previous messageGo to next message
manikandan panchabihesan is currently offline manikandan panchabihesanFriend
Messages: 3
Registered: February 2015
Junior Member
I found out the solution,

add below line,

gpio.unProvisioning(pin);

at the end ... Its really working...

[Updated on: Fri, 13 February 2015 04:34]

Report message to a moderator

Re: Gpio pin already exist Exception [message #1614992 is a reply to message #1614169] Fri, 13 February 2015 16:32 Go to previous message
Luca Dazi is currently offline Luca DaziFriend
Messages: 15
Registered: December 2014
Junior Member
Hello,
that kind of issue is dued to the fact that both jdk.dio and pi4j will not acquire a GPIO pin if it is already exported to the user space.
Unprovisioning (or Closing) the pin once it is no more needed is a best practice when dealing with GPIOs.

By the way, starting from Kura 1.1.0, you can use the provided jdk.dio library instead of pi4j.

Luca
Previous Topic:How to install bundle without starting it
Next Topic:Problem using SPI with Kura on a Raspberry Pi
Goto Forum:
  


Current Time: Tue Apr 23 13:15:00 GMT 2024

Powered by FUDForum. Page generated in 0.02698 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top