How does one remove a bluetooth service connection in the SDP on a mac inside Processing?

Everything was working perfectly until about a month ago with my project. (I suspect a JAVA update is the culprit)

I can use the tty serial port Processing lists to connect to my RN-41 bluetooth unit just fine after an initial pairing of bluetooth/arduino and my mac. Everything works perfectly.

The issue that popped up recently is that once I close my processing sketch (clearing and closing the serial port connection in the process) the hardware (RN-41) disconnects from the Mac momentarily and then reconnects only to leave the serial port hanging open. This means I can't reopen the serial port (which functioned the first time after pairing) the next time I open my Processing project. I have even tried sending a communication that causes the RN-41/Arduino to enter command mode and disconnect by using the AT 'K' command. This works to disconnect but the unit waits a little bit and (I suspect) upon the next query for nearby Bluetooth devices from the Mac, reopens the connection.

If I remove the Bluetooth device from my Mac and then repair, everything works again on the initial connection.

Some research leads me to believe the issue MAY be that the service connection in the SDP on the Mac side is left after an initial connection. Does anyone know how to address that and remove it from within Processing?

I found this, which I'm also going to look into- http://www.oracle.com/technetwork/articles/javame/index-140411.html

There's this fix, but I don't want to have to go the command line every time I want to exit my Processing project- http://stackoverflow.com/questions/15464475/how-to-setup-serial-communication-in-processing-to-dev-rfcomm0

I may also look into just forcing the Arduino/RN-41 to continue to disconnect via AT command every time through the main loop until the bluetooth receives a valid incoming communication from Processing. But that seems really ugly and kind of cruel. (Also a little concerned about abusing the AT disconnect command on the RN-41 as I may have ran into bricking issues with that in the past.)

Any help, links or head scratching much appreciated. Frustrating in that it worked perfectly when I set the project aside as done. Now it doesn't. Weird.

Sign In or Register to comment.