Bluetooth + Arduino - Major problem! Please help!

Hi!

I've been having a hardtime at the Bluetooth pairing on a (new) MacbookPro running OSX 10.6.8.
I'm using LilyPad Arduino together with a Bluetooth Mate Silver to pass data to Processing.

I've already done all the tutorials I could find for pairing Bluetooth with OSX, and I keep having the same problem:

Everytime the power supply connection of Lilypad (or even the bluetooth itself) fails for any reason, even for a very little time ("blinking" the power), bluetooth simply looses its connection to OSX (and consequentially, to Processing, or even Arduino's software serial port!).

So everytime this happens, I have to close Processing, click on System Preferences>Bluetooth>Edit Serials (http://www.quando.art.br/transfer/screen-problem-bluetooth.png) and just them, after a while, OSX recognizes the signal, and I can re-open Processing and start communicating again!

This is a major problem to my current project (an audiovisual installation - http://namainstrument.tumblr.com), and it may inviabilize it entirely. As it is a soft circuit hand-held, it is very possible that for some reason the power suply of Arduino blinks. I really need that when this happens, Processing and OSX regains connection to the Bluetooth serial port automatically.

Does anyone knows a workaround for this?
Is this occasioned by a misfunctioning of any of my devices, or perhaps a misconfiguration of them?

I really need some light on this.

Thank you!

Hello,
I have to admit to not knowing much about Bluetooth...

I think it would be expected that you would lose bluetooth connectivity if the Lillypad loses power. I'm not sure what other behavior you would expect.

Obviously, I would expect that there should be a way to regain connectivity when power was re-applied.

I know I've had some issues with arduino when I close the serial port, and then re-access it. The arduino will auto re-boot by default; something about the way it works when you update code. There is a way to hook up a capacitor across the reset line to prevent re-boot.

Maybe these notes will help? http://arduino.cc/playground/Main/DisablingAutoResetOnSerialConnection

Good luck,
Chris.

This is a problem of the Mac. If you would do the same thing on a linux box you would have no problem as you can assign a fix device to a bluetooth connection which will be re-established once the bluetooth device get accessible again.

Maybe something similar is possible on the Mac too, ask on a Mac forum.

chrisjx:
Hello,
I have to admit to not knowing much about Bluetooth...

I think it would be expected that you would lose bluetooth connectivity if the Lillypad loses power. I'm not sure what other behavior you would expect.

Obviously, I would expect that there should be a way to regain connectivity when power was re-applied.

I know I've had some issues with arduino when I close the serial port, and then re-access it. The arduino will auto re-boot by default; something about the way it works when you update code. There is a way to hook up a capacitor across the reset line to prevent re-boot.

Maybe these notes will help? http://arduino.cc/playground/Main/DisablingAutoResetOnSerialConnection

Good luck,
Chris.

Thanks, Chris! I'll have a look at this, and perhaps figure out how I could test it on my Lilypad.

pylon:
This is a problem of the Mac. If you would do the same thing on a linux box you would have no problem as you can assign a fix device to a bluetooth connection which will be re-established once the bluetooth device get accessible again.

Maybe something similar is possible on the Mac too, ask on a Mac forum.

Thanks, pylon. Could you perhaps point me how this is done on a Linux? I could test on it to see if this is the case, and nonetheless it would help me getting the Mac solution.

Chris, I've just done a simple test (I don't know why I haven't done it already). Perhaps the problem is with Arduino (as you suggested), or even Mac itself, not Bluetooth.

If I start transmitting serial data via USB (FTDI Basic), and suddenly powers off and on again, Processing just looses itself! He can't continue transmitting data... I don't know if it should, or if the problem is at the Mac system, but I think this settles that the problem is not at Bluetooth itself.

Do do that on linux (using the command line, GUI tools are available but they differ from distribution to distribution) you have to do (I assume the bluetooth service to be started already, as most distributions do by default):

You might have to create the device node, check with:

ls -l /dev/rfcomm0

If you don't get a response from that command, issue the following command:

mknod --mode=666 /dev/rfcomm0 c 216 0
hcitool scan

you'll get the bluetooth address in front of your devices name. Copy that address for the next command ("04:05:34:a4:b7:12" is the copied address):

rfcomm bind 0 04:05:34:a4:b7:12 1

No you can use any serial application, config the serial port to be /dev/rfcomm0 and the connection will be established. Eventually for the first pairing the password will be asked.

Hi all,

I tried Xbee today, and it just functioned perfectly out of the box.
I think I'll go with it - due to my really short time schedule.
However, I'll give a try on both solutions posted regarding Bluetooth when I have the time.

Thanks!