 }
 
 void sendPingReply() {
+    writeRGBColor(YELLOW);        
+
     OSCMessage m("/exo/tt/ping/reply");
     m.add((int32_t) micros());
     
-    sendOSC(m);  
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-
-OSCMessage messageIn;
-
+    sendOSC(m);
+    
+    writeRGBColor(GREEN);        
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+  
 void loop() {    
 #ifdef USE_BLUETOOTH
-    // this must be kept in loop() to receive events via Amarino
-    //meetAndroid.receive();  
-
-    if (int size = SLIPSerial.available() > 0) {
+    int done = SLIPSerial.endofPacket();
+    
+    int size;
+    OSCMessage messageIn;
+    while ((size = SLIPSerial.available()) > 0) {
+        writeRGBColor(GRAY);
+
         while (size--) {
-            messageIn.fill(SLIPSerial.read());
-            
-            // note: we may start writing before we are done reading available bytes
-            if (SLIPSerial.endofPacket()) {
-                receiveOSCMessage(messageIn);
-            }
+            int c = SLIPSerial.read();
+            messageIn.fill(c);
+            //sprintf(errstr, "received a byte: %d. bytes: %d, size: %d, hasError: %d", c, messageIn2.bytes(), messageIn2.size(), messageIn2.hasError());
+            //sendInfo(errstr);
         }
     }
+    done = done || SLIPSerial.endofPacket();
+    if (done) {
+        if (messageIn.hasError()) {
+            sendOSCMessageError(messageIn);
+        } else {
+            receiveOSCMessage(messageIn);       
+        }
+        
+        messageIn.empty();
+    }
 #endif
-
+    writeRGBColor(BLACK);
+    
     readKeys();
     
     if (keyState != lastKeyState) {
         colorDebug();
-//sprintf(errstr, "input changed from %d to %d\n", lastKeyState, keyState);
-//ƒsendInfo(errstr);  
         
         // bells and whistles
         if (keys[4] == HIGH) {


const unsigned long WHITE = 0xffffff;
const unsigned long RED = 0xff0000;
const unsigned long YELLOW = 0xffff00;
const unsigned long GREEN = 0x00ff00;
const unsigned long CYAN = 0x00ffff;
const unsigned long BLUE = 0x0000ff;
const unsigned long PURPLE = 0xff00ff;
const unsigned long BLACK = 0x000000;

unsigned long currentRGBColor = 0;


////////////////////////////////////////////////////////////////////////////////

void sendError(const char *message) {
    writeRGBColor(ORANGE);    
    
    OSCMessage m("/exo/tt/error");
    m.add(message);

    sendOSC(m);
    
    writeRGBColor(RED);        
}

void sendInfo(const char *message) {
    writeRGBColor(BLUE);        

    OSCMessage m("/exo/tt/info");
    m.add(message);

    sendOSC(m);
    
    writeRGBColor(CYAN);        
}

void sendKeyEvent(const char *keys) {
    OSCMessage m("/exo/tt/keys");
    m.add(keys);

    sendOSC(m);
}

void sendLightLevel() {
