Forum Stats

  • 3,784,352 Users
  • 2,254,928 Discussions
  • 7,880,790 Comments

Discussions

Accesing GPIO using JAVA and Python/PHP

user10303583
user10303583 Member Posts: 5
edited May 26, 2014 6:30AM in Java ME Embedded

Hello All,

I apologize for posting this in the JAVA ME Embedded section. I had previously posted this under the JAVA Embedded MOOC section. I just realized then there is another space for JAVA ME issues.

I am accessing my GPIO pins using PHP and JAVA. However, there is an issue when the pin is exported as input/output by PHP (or manually) before it is accessed using JAVA.

As an example, when the pin is configured as output by my php code  (or manually echo 7 > /sys/class/gpio/export), I get an exception in my JAVA code when I try to create an instance of this GPIO pin (pin 7).

DeviceManager.open(7) throws the exception "[ERROR] [DAAPI] iso=-1:There is unexpected error, when open GPIO pin 7"

Is there a way to create an instance of GPIOPin for an pin that has already been exported out as an I/O?

Thanks,

Mahesh Ganapathy

Answers

This discussion has been closed.