messenger library and processing

hej all,
i am trying to send data from processing to arduino with the messenger library...
when running my processing example sketch, that was supplied with the library, the sketch never starts.... :-?
i just get

Stable Library

Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
Opening: /dev/ttyUSB0
Opening the Serial port forces the Diecimila to reboot...
...so wait till the Arduino boots and send out a message..

also, if i quit the processing sketch and try again, i get an extra error in the console:

Stable Library

Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7

RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyUSB1

Opening: /dev/ttyUSB1
Opening the Serial port forces the Diecimila to reboot...
...so wait till the Arduino boots and send out a message...

so i never get out of this loop, and get the done waiting msg

while (port.available() == 0 ) {}; // Wait till Arduino boots
println("Done waiting.");

the only thing i changed in the code is the baud rate (to 2400)
what am i doing wrong?
what message is it that the arduino is supposed to send?

i am running this on ubuntu 9.04, arduino 0017 and processing 1.0.3

below is my arduino code

#include <Messenger.h>
// Instantiate Messenger object with the default separator (the space character)
Messenger message = Messenger(); 

// Create the callback function
void messageReady() {
  // Loop through all the available elements of the message
  while ( message.available() ) {
    Serial.print(message.readChar() );
  }
}


void setup() {
  
  // Initiate Serial Communication
  Serial.begin(2400);
  
  // Attach the callback function to the Messenger
  message.attach(messageReady);
  
  Serial.println("im ready");
}


void loop() {
  // The following line is the most effective way of using Serial and Messenger's callback
  while ( Serial.available() )  message.process(Serial.read () );
}

and the processing code is here

import processing.serial.*;

Serial port;                         // The serial port
String message = null;               // Incomming messages
String elements[] = null;            // Message elements
int values[] = {0,0,0,0,0,0};        // Values of the analog pins       


void setup() { 
  
  size(420,150); //La taille de notre fenêtre
 
  frameRate(30);
  stroke(255);
  
  println("Opening: "+Serial.list()[0]);
  port = new Serial(this, Serial.list()[0], 2400);
  println("Opening the Serial port forces the Diecimila to reboot...");
  println("...so wait till the Arduino boots and send out a message...");
  while (port.available() == 0 ) {}; // Wait till Arduino boots
  println("Done waiting.");
  port.write(13);    // Clear messages still hanging out in th buffer;
  port.write("50");    // Send the desired sampling rate as ASCII characters: 33 milliseconds
  port.write(13);    // End the message with a carriage return;
} 


void draw() { 

  background(0); 
  fill(255);
  
  while (port.available() > 0) {
   message = port.readStringUntil(13); // Read message until a carriage return
   if (message != null) {
     println(message);
    elements = splitTokens(message);
    for (int i =0; i < elements.length && i < 6; i++ ) {
      values[i] = int(elements[i]);
    }
   }
  }
  
  
  for (int i =0; i < 6; i++ ) {
     rect(12+(i*((width-24)/6.0)),25,((width-24)/6.0)-4,map(values[i],0,1024,0,100)); //
  } 
   
}

I think the Arduino doesn't reboot. At least, mine doesn't reboot the same.

I solved it by removing the while loop :

while (port.available() == 0 ) {}; // Wait till Arduino boots

Don't forget to print a carriage return to when you reply from Arduino.

void messageReady() {
  // Loop through all the available elements of the message
  while ( message.available() ) {
    Serial.print(message.readChar() );
  }
  //added
  Serial.print(13,BYTE);

}

That made it work for me.
Still I'm having some errors, so I'm figuring out some things too.
But at least this might got you started on the good road.

I made a matching Messenger library for Processing, so if anybody needs it just send me a message. It will be included in the next release of Messenger