Currently Stuck (2013)
I’m currently stuck, and can’t get my Processing application to reliably read two Bluetooth serial streams at the same time.
I have been successful only once, most of the time the sketch either won’t run or will run with only one bluetooth port connected (the other generates a port in use error).
Test setup: i have two arduino mini pros with one sparkfun bluetooth mate mounted on each. for testing i have each arduino continuously print “LEFT” or “RIGHT” over the serial port. the processing sketch determines which port it is receiving data from, reads the data and prints it out for debugging.
When i run the same code, but connect the arduinos via FTDI breakouts directly to my computer, i get no such problems. Because i’ve been able to connect to both bluetooth modules and receive data, i think that the problem is with the initialization of the bluetooth ports and/or with timing. I know very little about how the bluetooth connection is established and what goes on while it is active. if anybody has experience and can detect an obvious error in my setup, thought process or code, i would very much appreciate any help or advice i can get.
The code i have is pieced together from the “many serial ports” processing example and tom igoe’s arduino graph code.
Arduino forum post >> http://arduino.cc/forum/index.php/topic,73752.0.html
Processing forum post >> https://forum.processing.org/topic/reading-two-bluetooth-streams-into-one-sketch