Thread Tools
This thread is privately moderated by athertop, who may elect to delete unwanted replies.
Dec 08, 2016, 06:53 AM
RC fanatic
Thread OP
Discussion

Configuring HC-05 and HC-06 bluetooth adapters


Technically, the world of RC modelling has never had it so good as we have it right now. This has been mostly made possible of course due to better understanding and communication - all of this is down to the internet and the platforms it hosts for sharing our ideas like the RCGroups forum. In these groups, we are able to bring together our ideas and get people involved in producing some really well integrated solutions, using many different combined technologies which are available today. What's more, if we have an idea and we want to see it produced physically, we now have access to the components and the means to have our bespoke designs manufactured. Again, all made possible by companies being able to form because of access to a wider audience of potential customers - all because of the internet.

My introduction to the Ultimate LRS project (thread here) has really opened my eyes to what is possible when people put their heads together. Aside from the closed source ULRS 2 software itself, developed by IT Luxembourg, the array of hardware solutions being developed by the ULRS community is truly staggering and joy to be a part of. Aside from the ULRS hardware itself, the integration solutions now available for ULRS are many, and new ides for integrations are continually emerging. So exciting times indeed!

One such technology which works well with ULRS is Bluetooth - more specifically, this is to allow a serial connection via bluetooth, providing us wireless connectivity from our laptop/tablet ground station software to the serial connection provided by ULRS. In practise, this serial connection will likely provide us a data connection to our flight controller installed in our model (I.e. the serial connection at the Tx will connect over the radio link to a similar connection on the Rx where it is connected to our flight controller/autopilot).

In my case the ULRS data connection is provided by the Pixhawk flight controller mounted inside a Zeta Science fx-61 Phantom flying wing. This has a telemetry port configured to provide Mavlink data (at 19.2kBaud), connected to the ULRS Rx serial connection, which is then accessible in our ULRS transmitter board on the ground. Having a bluetooth adapter providing easy wireless access to this ground based mavlink telemetry connection makes things far more manageable in the field - for example to connect our laptop or tablet which runs our ground station software (such as Mission Planner, APM Planner, Q Ground Control, and also tablet based apps such as Tower).

Having a Mavlink telemetry connection at ground level also offers additional telemetry possibilities - for example we can connect the Mavlink-FrSkySPort teensy solution which will take this ULRS provided mavlink feed and output FrSky smartPort compatible telemetry to our Taranis radio - this then provides the required telemetry data to a custom telemetry screen which we view on the Taranis LCD screen. See the wiki here for details of the project: https://github.com/Clooney82/MavLink_FrSkySPort/wiki

So, back to the subject of Bluetooth - Integrating a bluetooth adaptor into the ULRS solution is much like integrating it into any solution where you need a serial connection via a BT 'slave' device (note that the following text describes using both device types as BT slave devices), so the following text will hopefully be useful as a general purpose guide for configuring these complex little adapters.

Given that I spent over an hour re-configuring both a HC-05 and a HC-06 module, I thought I’d share my experience here for both device types to hopefully help those who need to do the same. What's needs to be understood, is that these two devices are very different in their feature set, and these differences come through in how we configure each of them:

Connection - this is the same for both board types - just connect your regular FTDI adapter:
Tx->Rx on BT board
Rx-> Tx on BT board
Gnd>Gnd on BT board
Vcc->Vcc on BT board (this should be 5v)
Getting the board into programming/command mode:
HC-05 - This is the more advanced BT adapter of the two - it supports both Master and Slave BT modes. In order to configure this model, we need to appreciate that upon powering this board, it does not accept AT commands by default. To reconfigure it we need first to get the board into command mode. To do this, we need to follow a specific process/sequence when powering the board and to make this happen we can use a clever wiring trick.

So, where your FTDI adaptor connects to your BT board there is a 4 pin connector (standard servo connector type), unplug this and release and remove the 5v Vcc crimp socket/cable from the plastic plug housing, and then reconnect the plug back to the BT adapter as normal (but with the power connector missing).
Now with the BT adapter orientated with the antenna at the top, we need to provide a separate 5v supply to the top-rightmost connection of the surface mounted BT board (this is pin 34 - aka the ‘Key’ connection).
Name: HC-05.jpg
Views: 83
Size: 67.2 KB
Description:
Now this is the tricky part! To do this I suggest using a short length of wire stripped from a servo extension with a male pin still crimped to just one end - this will be our PCB probe! Strip 10mm of insulation from the other end of the wire and wrap the bared copper strands around the crimp shoulder of the Vcc pin which was removed from the main connector. Our PCB probe at the other end of this wire is then pushed against the ‘Key’ pad (top-right side) just under the antenna. Whilst holding that connection in place, carefully slide the removed Vcc plug connector back inside the plastic plug which is connected to the header at the bottom of the board. This will apply the main power to the board. Once the board has power, if all went well, then the LED will flash every 0.5 seconds and you will be in AT (programming)mode. If this worked then feel free to release that temporary probe from the top-right ‘key’ pad. If the LED is flashing more frequently, then you didn’t do it right so try again. Remember, whilst holding that probe to the top-right pad then apply the main power.

HC-06 - this is the simpler board of the two. It operates always and only in Slave mode, so as soon as its powered up it is already in a position where it can be re-configured. Simples!
Programming connection baud rate:
HC-05 - In programming/command mode this board is always configured to a baud rate of 38400 (this is not to be confused with the UART baud rate which we will be configuring here.

HC-06 - As this board is powered it is instantly in slave mode, and in this mode it also accepts AT commands. Therefore, our programmer connection baud rate will need to be set to whichever UART baud rate was previously configured on this board. A new board will likely come configured configured for either 38400 baud or 9600baud. Bear in mind though that if you have already configured this board (to say 115200), then the programming baud rate will be whatever UART rate you configured it for previously.
Re-configuration (software):
HC-05 - I personally use the Arduino IDE Serial console to program this board. Make sure that Arduino is configured for the correct port (for your FTDI adaptor) and in the serial console window, configure this for “38400” baud and “Both NL and CR”. If you need to change these, then close the serial console and re-open it to start the console with the correct settings already in place. put on the CAPS lock and type AT<enter> it should respond with OK. To set a baud rate of 57600, enter the command:
Code:
AT+UART=57600,0,0<enter>
This should return: OK. To check the current baud rate setting, enter the command:
Code:
AT+UART?
This should return: UART=57600,0,0 if all went well.

HC-06 - this is far more complex to program. On a Mac I have achieved this using the terminal window (unfortunately, the Arduino IDE serial console does not work well with this BT adapter as it does not echo responses from the adapter to the console window). So launch terminal and check out the devices by entering ls -l /dev/<enter> and in that list there should be a device which starts with: tty.usbserial-xxxxx copy the name of this device to the clipboard, then enter the command:
Code:
screen /dev/tty.usbserial-xxxxx 38400
(where tty.usbserial-xxxxx is the device name and 38400 is the baud rate your BT adapter is currently configured for). Getting the right baud rate might take some experimentation. Once the correct command has been entered typing AT (and waiting approx 1 second) will return OK. The HC-06 adaptor automatically accepts commands within 1 second of when typing starts, so its most often not possible to enter complex commands in manually here. Instead we should type the command: AT+BAUD7 into a text editor, and select and copy this to the clipboard, then paste it into the terminal window all in one go. Changing the baud rate will instantly cause the connection to the board to be lost. To reconnect, follow the same process of running the screen command, but this time use the baud rate 57600, and it should reconnect and in doing so, confirm that the baud rate has been changed.

For Windows users - I would suggest experimenting with HyperTerminal or some other terminal app such as Tera Term, connecting these to the appropriate com port for your FTDI adapter.
That’s it!

Some useful docs:
HC-05 AT Command set
HC-05/06 Manual
Footnote: Even though the HC-05 board requires some extra steps to get into programming mode, once there it is far easier to program than the HC-06. If you have the choice between both of these boards I would highly recommend the HC-05 board.
Last edited by athertop; Jul 08, 2018 at 04:33 AM. Reason: manual links fixed
Sign up now
to remove ads between posts
Feb 21, 2017, 04:09 PM
Registered User
The default mode of the HC-05 is master. Did you configure it to slave? Or was yours defaulted to slave?
Feb 24, 2017, 08:57 AM
RC fanatic
Thread OP
Defaulted to slave in my case.

Sent from my Nexus 6P using Tapatalk
Jun 15, 2018, 09:37 AM
Registered User
FotoAmg's Avatar
Hi! pl.s help me I have the SPP-C HC-06 / BT06 HC-06, BOLUTEK Firmware V2.2, Bluetooth V2.1 version accoding to design
http://www.martyncurrey.com/bluetoot...-06-BT06_HC-06
as it is a one small chip HC-06, at 9600baud I connected to serial monitod via FTDI adapter, not using arduino to set AT commands just the FTDI adapter and arduino ide serial monitor.
I wanted to set baud to 1200 so used AT+BAUD1 it accepted teh command but since than it does not respond to AT or send any readable character when powercycle at any baud usind the serial monitor and that FTDI adapter how can I reset it back to factory mode withut figuring out bad rate and working AT mode again?
Here I copy paste what is sends as info whenpower cycle at different bauds:
1200
2400 ⸮⸮
4800 Tq!DW⸮⸮
9600 ⸮& Fb )⸮!⸮b
19200 ⸮⸮⸮DiCC⸮n;⸮0⸮⸮[email protected]⸮a;⸮0⸮
38400 ⸮⸮⸮⸮⸮⸮|⸮pΌ8
57600 ⸮⸮⸮⸮x<⸮⸮⸮x<
74880 ⸮⸮⸮⸮
115500 ⸮⸮⸮⸮
230400 ⸮⸮
Strange that at 1200baud mode nothing shown even from power cycle tred many computers etc..
Jul 08, 2018, 08:38 AM
RC fanatic
Thread OP
@FotoAmg - you appear to have done the correct thing to change your HC-06 to 1200baud. As I explain above, this is certainly the more complex board to configure. In your example, connecting at 1200baud should be the correct way, and entering AT (without hitting enter key) should respond with OK.
Jun 03, 2019, 12:25 PM
Registered User
SorePaws's Avatar
Paul, do you not have PMs turned on? I wanted to ask you if you found a solution to the ULRS lock out, I have some new boards that have arrived but waited two day to see if the config program would come back and it hasn't. I have to wait till at least next weekend now.

Send me a message if you know of a workaround.
Jun 03, 2019, 01:15 PM
RC fanatic
Thread OP
Quote:
Originally Posted by SorePaws View Post
Paul, do you not have PMs turned on? I wanted to ask you if you found a solution to the ULRS lock out, I have some new boards that have arrived but waited two day to see if the config program would come back and it hasn't. I have to wait till at least next weekend now.

Send me a message if you know of a workaround.
There is no work around. We are at the mercy of the dev. He often over promises and under delivers. That's the problem with a closed source project. I have learned to live with it. He will sort the unlock before long as he always does. Your right to be annoyed though.

Sent from my Nexus 6P using Tapatalk
Jun 03, 2019, 03:13 PM
Registered User
SorePaws's Avatar
Thank you. I don't mind closed source so much but the restrictions seem a bit too much, it doesn't need to phone home really. Yeah would be nice to test these boards then I can release the files for others to see if they work well.
Jun 03, 2019, 03:16 PM
RC fanatic
Thread OP
Quote:
Originally Posted by SorePaws View Post
Thank you. I don't mind closed source so much but the restrictions seem a bit too much, it doesn't need to phone home really. Yeah would be nice to test these boards then I can release the files for others to see if they work well.
Best to keep reminding flipflap on the ULRS forum. That's what usually calls him to action.

Sent from my Nexus 6P using Tapatalk
Jun 03, 2019, 04:06 PM
Registered User
SorePaws's Avatar
I decided to order some hardware and get coding, could be fun to write an LRS, I've written RF radios in the past although my brain is a lot slower these days.
Oct 21, 2019, 03:40 PM
Registered User
Hi guys
I have problem getting the HC-05 working with telemetry 915hz as bridge

I tried 57600 buad and tried master and sleeve but everytime I see the hc_05 in my bluetooth lists in my tablet I put the password 1234 then when I open QGC software choosing the 57600 then find the HC-05 then connect but its freez and nothing happening
It's not connecting at all
Only one time connected for 1 second and the QGC freezes and couldn't finish the green bar to the end

Please help if you can
OZZY
Dec 02, 2019, 08:26 AM
Registered User
Quote:
Originally Posted by omar450
Hi guys
I have problem getting the HC-05 working with telemetry 915hz as bridge

I tried 57600 buad and tried master and sleeve but everytime I see the hc_05 in my bluetooth lists in my tablet I put the password 1234 then when I open QGC software choosing the 57600 then find the HC-05 then connect but its freez and nothing happening
It's not connecting at all
Only one time connected for 1 second and the QGC freezes and couldn't finish the green bar to the end

Please help if you can
OZZY
Reverse tx and rx but before you have to set up your HC-05 with an ftdi


Quick Reply
Message:
Thread Tools