user7022: I bought a HC-06 Module for my Arduino Uno the other day, yesterday it arrived and I'm having trouble using it with the Arduino IDE.
I set it up, connecting 5V, GND and RX/TX crossed. After a bit of searching, it shows up on the bluetooth settings on the macbook. When I click "connect", it fails, after I click "Options", then set the Pin to 1234 it says "Connected". The LED on the HC-06 is still blinking (which is OK I guess, since I'm not yet communicating).
I have a Sketch running on the Uno that prints out some text. When I open the serial monitor (after connecting like above) it works, displaying the values I expect. However, after closing the serial monitor the HC-06 changes to "not connected" on the mac.
Also, if I try to upload code via the Arduino IDE it states: avrdude: ser_open(): can't open device "/dev/tty.HC-06-DevB": Resource busy
ioctl("TIOCMGET"): Inappropriate ioctl for device or throws a processing.app.SerialException: Fehler beim Öffnen des seriellen Ports "/dev/tty.HC-06-DevB". (German for "Error while opening Serial Port "/dev...." ").
Do I have to configure the HC-06 or the Arduino IDE in any way to make this work, and, if so, how can I do that?
Edit:
I've also connected TX and RX uncrossed, though that alone doesn't solve the problem.
Thanks in advance for your Support!

user6740: If I remember correctly, you do not want to cross TX and RX.
Usually, you cross TX/RX because you are looking at it from the opposite side - the PC's TX is the Arduino's RX and vice-versa.
However, in the case of BlueTooth, the HC-06 has the same perspective as the Arduino - TX (transmit) is TX on the HC-06, since that is what the HC-06 transmits (over Bluetooth).
Also, if you are connect your Arduino via USB, the TX & RX are also connected via USB; I don't know if this would cause cross-talk. It shouldn't (so long as you don't send to your Arduino using Bluetooth AND USB at the same time), but it may. Also, as you're programming the Arduino using Bluetooth, you may get the Arduino's responses coming back to you via Bluetooth.
ADDITIONAL:
Go read http://arduino.cc/en/Hacking/Bootloader?from=Tutorial.Bootloader - this is all about the bootloader.
It seems from that that current bootloaders run at 19200, some older ones run at 9600. There are commands to program the speed on HC-06 - instructions can be found at http://www.instructables.com/id/AT-command-mode-of-HC-05-Bluetooth-module/ (this covers the hc-06 too).
Based on the bootloader tutorial, I think you have "less than a second" (only two specific boards are mentioned, so this is a best guess; I am amazed that it is this long, I expected a few milliseconds). If you have a USBISP, you could compile and upload a new firmware, with settings more to your liking - this is outside the scope of this article.
Another option is to create a completely separate uploader - an AtTiny could do it. Connect the AtTiny to the serial port, and then get the AtTiny to reset and program the board, or even program it via ICSP. This is a lot of work, and also outside the scope of this article.

user6740: Regarding the ability to upload, that is correct - you won't be able to upload code via Bluetooth. In addition to providing a serial connection, the USB connection does something extra (hold reset, I think), when you upload via serial-over-usb.

user313: The on-board USB-to-serial pulses the reset line to start the bootloader. HC-0x don't have the extra signal available that USB uses for that so you'll have to manually reset the Arduino just as - or very slightly after - you click to start the upload on your Mac; you may need to experiment to get the timing right, but once you know it, it isn't hard to do. Keep Rx & Tx crossed as you do for Bluetooth terminal communication. And even with all that, I've never achieved anything like USB upload speeds (baud rate for baud rate) using Bluetooth.
Update:
In brief, it could be timing, baud-rate, or pairing.
I find it easy to get the timing: hold reset / click (and let go) the upload button / release reset. It doesn't need to be so fast that it's a challenge to coordinate but do it faster than counting seconds.
Your HC-06's baud rate will have to match the baud-rate your boot-loader expects. It looks like Uno's bootloader's use 19200 baud (and there are some way older ones that used 9600). My bare, pre-programmed chips' boot-loaders from Adafruit.com use 57600 baud. Your preferences.txt file should contain a line like 'atmega328o.upload.speed=115200'; assuming you're able to upload via USB, then use this baud rate for the HC-06. (The path to your preferences file is displayed on the Arduino IDE's preferences dialog.)
The 'Resource busy' message sounds like your Mac isn't paired with your HC-06. In the MacOS Bluetooth System Preferences pane, pair the Mac with the HC-06 and be sure HC-06's LED is on steady (not blinking).

7022: <p>I bought a HC-06 Module for my Arduino Uno the other day, yesterday it arrived and I'm having trouble using it with the Arduino IDE.</p>

<p>I set it up, connecting 5V, GND and RX/TX crossed. After a bit of searching, it shows up on the bluetooth settings on the macbook. When I click "connect", it fails, after I click "Options", then set the Pin to 1234 it says "Connected". The LED on the HC-06 is still blinking (which is OK I guess, since I'm not yet communicating).</p>

<p>I have a Sketch running on the Uno that prints out some text. When I open the serial monitor (after connecting like above) it works, displaying the values I expect. However, after closing the serial monitor the HC-06 changes to "not connected" on the mac.</p>

<p>Also, if I try to upload code via the Arduino IDE it states: <code>avrdude: ser_open(): can't open device "/dev/tty.HC-06-DevB": Resource busy
ioctl("TIOCMGET"): Inappropriate ioctl for device</code> or throws a <code>processing.app.SerialException: Fehler beim Öffnen des seriellen Ports "/dev/tty.HC-06-DevB".</code> (German for "Error while opening Serial Port "/dev...." ").</p>

<p>Do I have to configure the HC-06 or the Arduino IDE in any way to make this work, and, if so, how can I do that?</p>

<p><strong>Edit:</strong>
I've also connected TX and RX uncrossed, though that alone doesn't solve the problem.</p>

<p>Thanks in advance for your Support!</p>
 6740: <p>If I remember correctly, you do not want to cross TX and RX.</p>

<p>Usually, you cross TX/RX because you are looking at it from the opposite side - the PC's TX is the Arduino's RX and vice-versa.</p>

<p>However, in the case of BlueTooth, the HC-06 has the same perspective as the Arduino - TX (transmit) is TX on the HC-06, since that is what the HC-06 transmits (over Bluetooth).</p>

<p>Also, if you are connect your Arduino via USB, the TX &amp; RX are also connected via USB; I don't know if this would cause cross-talk. It shouldn't (so long as you don't send to your Arduino using Bluetooth AND USB at the same time), but it may. Also, as you're programming the Arduino using Bluetooth, you may get the Arduino's responses coming back to you via Bluetooth.</p>

<p>ADDITIONAL:</p>

<p>Go read <a href="http://arduino.cc/en/Hacking/Bootloader?from=Tutorial.Bootloader" rel="nofollow">http://arduino.cc/en/Hacking/Bootloader?from=Tutorial.Bootloader</a> - this is all about the bootloader.</p>

<p>It seems from that that current bootloaders run at 19200, some older ones run at 9600. There are commands to program the speed on HC-06 - instructions can be found at <a href="http://www.instructables.com/id/AT-command-mode-of-HC-05-Bluetooth-module/" rel="nofollow">http://www.instructables.com/id/AT-command-mode-of-HC-05-Bluetooth-module/</a> (this covers the hc-06 too).</p>

<p>Based on the bootloader tutorial, I think you have "less than a second" (only two specific boards are mentioned, so this is a best guess; I am amazed that it is this long, I expected a few milliseconds). If you have a USBISP, you could compile and upload a new firmware, with settings more to your liking - this is outside the scope of this article.</p>

<p>Another option is to create a completely separate uploader - an AtTiny could do it. Connect the AtTiny to the serial port, and then get the AtTiny to reset and program the board, or even program it via ICSP. This is a lot of work, and also outside the scope of this article.</p>
 6740: <p>Regarding the ability to upload, that is correct - you won't be able to upload code via Bluetooth. In addition to providing a serial connection, the USB connection does something extra (hold reset, I think), when you upload via serial-over-usb.</p>
 313: <p>The on-board USB-to-serial pulses the reset line to start the bootloader. HC-0x don't have the extra signal available that USB uses for that so you'll have to manually reset the Arduino just as - or very slightly after - you click to start the upload on your Mac; you may need to experiment to get the timing right, but once you know it, it isn't hard to do. Keep Rx &amp; Tx crossed as you do for Bluetooth terminal communication. And even with all that, I've never achieved anything like USB upload speeds (baud rate for baud rate) using Bluetooth.</p>

<p>Update:<br>
In brief, it could be timing, baud-rate, or pairing.</p>

<p>I find it easy to get the timing: hold reset / click (and let go) the upload button / release reset. It doesn't need to be so fast that it's a challenge to coordinate but do it faster than counting seconds.</p>

<p>Your HC-06's baud rate will have to match the baud-rate your boot-loader expects. It looks like Uno's bootloader's use 19200 baud (and there are some way older ones that used 9600). My bare, pre-programmed chips' boot-loaders from Adafruit.com use 57600 baud. Your <code>preferences.txt</code> file should contain a line like 'atmega328o.upload.speed=115200'; assuming you're able to upload via USB, then use this baud rate for the HC-06. (The path to your preferences file is displayed on the Arduino IDE's preferences dialog.)</p>

<p>The 'Resource busy' message sounds like your Mac isn't paired with your HC-06. In the MacOS Bluetooth System Preferences pane, pair the Mac with the HC-06 and be sure HC-06's LED is on steady (not blinking).</p>
