Intel® Makers
Intel® Edison, Intel® Joule™, Intel® Curie™, Intel® Galileo
Announcements
Welcome - This is a Peer-to-Peer Forum only. Intel has discontinued these products but you may find support from other customers on this Forum
9868 Discussions

exception in mraa

RHori3
Beginner
1,008 Views

Dear community members,

I am playing around Intel Edison's GPIO with mraa using Java, and got an exception shown below when I executed the sample code (BlinkIO.java):

Exception in thread "main" java.lang.UnsatisfiedLinkError: mraa.mraaJNI.ERROR_PLATFORM_ALREADY_INITIALISED_get()I

at mraa.mraaJNI.ERROR_PLATFORM_ALREADY_INITIALISED_get(Native Method)

at mraa.Result.(Result.java:24)

at mraa.Gpio.dir(Gpio.java:67)

at BlinkIO.main(BlinkIO.java:58)

I searched this exception name, but I got no further information about the details of the exception description

"Exception in thread "main" java.lang.UnsatisfiedLinkError: mraa.mraaJNI.ERROR_PLATFORM_ALREADY_INITIALISED_get()I".

Could anybody tell me what this exception means?

Best regards,

0 Kudos
3 Replies
idata
Community Manager
124 Views

Hello Ryosuke,

 

 

Thank you for your interest in our Intel products.

 

 

Have you tried any other sample code? Do you still get the exception on other sample code?

 

Also please try this code below and let me know if it works:import mraa.Gpio; public class EdisonTest { static { try { System.loadLibrary("mraajava"); } catch (UnsatisfiedLinkError e) { System.err.println("Native code library failed to load."); System.exit(1); } } public static void main(String[] args) throws InterruptedException { Gpio gpio = new Gpio(11); gpio.dir(Dir.DIR_OUT); int state = 1; while (true){ gpio.write(state); state = (state==1?0:1); Thread.sleep(1000); } } } Regards, Octavian
RHori3
Beginner
124 Views

Hello Octavian,

Thank you very much for your reply. I am very grateful for your help.

I tried to execute some other samples and the code you suggested, but I still get the same exception:

Exception in thread "main" java.lang.UnsatisfiedLinkError: mraa.mraaJNI.ERROR_PLATFORM_ALREADY_INITIALISED_get()I

at mraa.mraaJNI.ERROR_PLATFORM_ALREADY_INITIALISED_get(Native Method)

at mraa.Result.(Result.java:24)

at mraa.Gpio.dir(Gpio.java:67)

at EdisonTest.main(EdisonTest.java:43)

The exception always occurs at the line where the direction of the pin is set.

I wonder if the meaning of the exception helps to solve the problem.

Best regards,

Ryosuke

idata
Community Manager
124 Views

Hello Ryosuke,

 

 

Please tell me what commands are you running to compile and run the BlinkIO.java example.

 

Also what version of mraa do you have installed and which Edison image are you using?

 

 

Regards,

 

Octavian
Reply