We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
strange error, arduino (Read 2538 times)
strange error, arduino
Jul 4th, 2007, 7:02am
 
Hi gang... newbie question, desperate:

I'm trying to run the tutorial file at http://itp.nyu.edu/physcomp/Labs/Serial

I'm using an Arduino... latest Arduino, latest Processing, OSX 10.4.10...

I've run the setup command, etc. and things were working fun, but now when I try to run the code, I get this:

RXTX Warning:  Removing stale lock file. /var/lock/LK.001.009.000
error, disabling serialEvent() for /dev/tty.usbserial-A4000PQS
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Is this a Java 1.5 problem?? Anybody?
Re: strange error, arduino
Reply #1 - Sep 12th, 2007, 10:54am
 
I found this topic as I was having the same problem.

It turns out that writing to a PrintWriter in the serialEvent() method when the PrintWriter is non-existing caused the problem.
If you aren't using a PrintWriter then it might be that you're referring to some other uninstantiated variable in your serialEvent method?
Re: strange error, arduino
Reply #2 - Sep 13th, 2007, 1:04pm
 
Okay, for anyone else who has this problem: I'm not quite sure exactly why it occurs. Assignments to uninstantiated variables in serialEvent() will definitely do the trick, but in my current code it will occur one time and won't the next time I run the exact same code. I'm thinking it might have something to do with conflicting messages over serial (reading and writing at the same time), but I can't be sure.

If anyone knows the definite solution to this problem, I would be most grateful!
Re: strange error, arduino
Reply #3 - Oct 9th, 2007, 2:22am
 
I had the same problem.
It turns out that the following line in the code needed a different number in the [0] space, my USB port is in the [2] space so I changed the code from "port = new Serial(this, Serial.list()[0], 9600);"   to  "port = new Serial(this, Serial.list()[2], 9600);"

hope that helps.
Page Index Toggle Pages: 1