ahmetsemihparlak / arduino

Automatically exported from code.google.com/p/arduino
0 stars 0 forks source link

New processing library in 0017 breaks serial communication #103

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There's a few guides out there that describe how to interface the arduino
with a PC and Java.

http://www.arduino.cc/playground/Interfacing/Java
http://silveiraneto.net/2009/03/01/arduino-and-java/

In both of their tutorials, they use Processing's app.Preferences to sniff
the device that the PC sees the arduino as. Their code runs along the lines of:

Code:

Preferences.init();
CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(
            Preferences.get("serial.port"));

This works fine and dandy up until 0017, which upgraded to Processing 1.0.3

Since the last time arduino updated its Processing library, the Preferences
class has since changed init's method signature to:

Code:

static protected void init(String cmdlineargs) 

http://dev.processing.org/source/index.cgi/tags/processing-1.0.3/app/src/process
ing/app/Preferences.java?rev=5503&view=markup

And thus causing an interesting dilemma. The quick hack to get around this
signature change would be to first make the class trying to implement this
functionality to extend processing.app.Preferences, and to simply pass a
String to init.

Unfortunately, this does not solve the problem as Preferences starts
throwing more NullPointerExceptions, probably related to the subclassing of
Preferences.

I'm using an Arduino Mega on Ubuntu 9.04 32bit with Sun's java

Original issue reported on code.google.com by jbermu...@gmail.com on 2 Sep 2009 at 5:02

GoogleCodeExporter commented 9 years ago
Sorry, you'll need to find a different way of sniffing the serial port.  Or you 
can try filing a bug report with 
Processing and see if they'll change the way this works (which would then get 
carried over to Arduino).

Original comment by dmel...@gmail.com on 24 Sep 2009 at 12:00