RaspberryPiMan
Posts: 6
Joined: Mon Jul 21, 2014 1:24 am

Access raspberry USB port by Java ME Embedded 8

Mon Jul 21, 2014 1:38 am

Hello everyone....
I'm a newbie to the raspberry world...
I configured my raspberry to work according to this tutorial http://www.oracle.com/webfolder/technet ... Setup.html, and so far everything run very smoothly :D . However, I need help to access my raspberry usb port that's connected to Arduino UNO board so I can send and receive data.
Any code samples, tutorials or useful websites please.
Thanks in advance.

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Access raspberry USB port by Java ME Embedded 8

Mon Jul 21, 2014 6:54 am

Can't you communicate with the Arduino via its virtual serial port ? Plain USB would be much more cumbersome.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

RaspberryPiMan
Posts: 6
Joined: Mon Jul 21, 2014 1:24 am

Re: Access raspberry USB port by Java ME Embedded 8

Mon Jul 21, 2014 2:18 pm

I connected the raspberry pi and Arduino via direct usb communication according to this tutorial:
http://blog.oscarliang.net/connect-rasp ... usb-cable/
In this tutorial you just need to setup Arduino IDE on the Raspberry and by using python you can import a (serial library) and make them talking to each other.
Now I want to use the same type of connection but this time I want to control arduino from Java ME Embedded 8 installed on my PC, The IDE I am using for java is NetBeans 8 (last version) that's connected to raspberry pi by using java emulator 8.
I couldn't find (so far) any tutorial of how you can do such thing by java. I tried the code here
http://playground.arduino.cc/interfacing/java
but it's not working, when I use the RXTX library raspberry pi throws an exception:
TooManyListenerException.
When I use the Ardulink library, the Raspberry throws an exception:
UnsupportedClassVersionException.
please any help!!

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Access raspberry USB port by Java ME Embedded 8

Mon Jul 21, 2014 6:36 pm

I would suggest switching to Java SE instead. It is supported on the Pi and should make this way easier.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
Douglas6
Posts: 4874
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Access raspberry USB port by Java ME Embedded 8

Mon Jul 21, 2014 7:47 pm

I have zero experience with serial in Java, so I'm happy to help out. :)

1. Ardulink looks like it's pretty heavyweight for what you want, I'd avoid the complications.
2. RXTX has a pretty stinky reputation over at StackOverflow; I'd try something else.
3. You might give JSSC a try, as suggested in that link.
4. I think it's a good idea to start with Java SE, as ghans suggests, get that working, and then see if you can build it with Java ME.

RaspberryPiMan
Posts: 6
Joined: Mon Jul 21, 2014 1:24 am

Re: Access raspberry USB port by Java ME Embedded 8

Tue Jul 22, 2014 12:32 am

I think this is the only option I have now :( , I will try the Java SE embedded, but I have another question.

Does the Java SE embedded support running 24x7 hours?
In the documentation of Java ME Embedded, it mentioned that it supports the 24x7 running.
This feature is very important for my project.

Thank you very much guys for your help :D ...

User avatar
Douglas6
Posts: 4874
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Access raspberry USB port by Java ME Embedded 8

Tue Jul 22, 2014 1:00 am

Java SE (which is not embedded) runs hundreds of thousands (millions?) of applications 24x7 every day. Where's the problem?

Earymgn
Posts: 1
Joined: Wed Feb 25, 2015 8:05 pm

Re: Access raspberry USB port by Java ME Embedded 8

Wed Feb 25, 2015 8:10 pm

@RaspberryPiMan

Did you do any progress on that project?

I want to connect a Pi and Arduino via USB-Cable too and found the Python tutorial too. As this is realy simple its working but i want to write an android app and want to use JAVA to get the communication workin.

If you have any progress please give us a post

Return to “Beginners”