processing takes over my serial monitor!


i’m trying to get processing and arduino to speak with each other, mostly processing sending data to arduino. the communication sort of works, im clearly getting something through. but i have problems debugging. i would like to use the serial monitor in arduino, but when processing is running, i get the error msg:

Error inside Serial.<init>() Unknown Application






      at java.awt.Component.processMouseEvent(Unknown Source)

      at java.awt.Component.processEvent(Unknown Source)

      at java.awt.Container.processEvent(Unknown Source)

      at java.awt.Component.dispatchEventImpl(Unknown Source)

      at java.awt.Container.dispatchEventImpl(Unknown Source)

      at java.awt.Component.dispatchEvent(Unknown Source)

      at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)

      at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

      at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

      at java.awt.Container.dispatchEventImpl(Unknown Source)

      at java.awt.Window.dispatchEventImpl(Unknown Source)

      at java.awt.Component.dispatchEvent(Unknown Source)

      at java.awt.EventQueue.dispatchEvent(Unknown Source)

      at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

      at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

      at Source)

is this normal? i can’t have the serial monitor running while communicating with processing?



No, this is not going to work. Today I had, by accident, processing and arduino listening to the same serial port. They both showed some output but incomplete. It looked like missing characters from arduino where visible in processing and vv. It toke me while to figure out that there was nothing wrong with the program. Processing was running on a different desktop so I didn't have both apps in 1 view. I am still suprised the OS didn't complain.

If you could hook up more than 2 devices on a serial port how would you address each device?

I have tried this too and it does not work.. Processing can use its serial library to talk to the Arduino, but once it is doing this the serial port is not accessible to the Arduino IDE. Good luck


wow! quick replys! thanks! :D

is there some other way to get output from arduino while processing is running? i guess i could send the msgs back to processing and display them there? or perhaps use a monitoring software? - - - i've seen serproxy on the download page, and i have a feeling it might be useful. but i can see no description of the program anywhere?

If you're using Processing to read the serial data, then, yea, just print it out in Processing (with the print() or println() functions). If you're not using the serial port from Processing at all (remove the import processing.serial.* line from the top of your sketch), then it shouldn't take over the serial port; you might have to quit it and restart though. If you're using Processing to send data to the board, you'll probably also need to use Processing to read and display the data coming back.