LibrePilot Forum

General Category => General Discussion => Topic started by: Zucky on January 02, 2016, 08:09:42 pm

Title: How to Set Bluetooth Device via ComBridge CC3D
Post by: Zucky on January 02, 2016, 08:09:42 pm
The following is the process I performed with a Bluetooth module I purchased and configured for use with my CC3D.  Hopefully it helps others use the ComBridge feature in the CC3D as a USB to Serial converter for making  the changes to the settings on a Bluetooth module.  The may definitely be a simpler method, this one worked for me.  Be careful, as there are voltages at play and touching the wrong thing to the VCC could damage any of the components involved.

My setup:
That should cover the details, here are the steps;

1. Connect to your CC3D via USB and open the GCS

2. Configure the Hardware as below, take note of the ComBridge setting on the MainPort and USB VCP Port, as well as the 9600  baud rate on the Telemetry speed and ComUsbBridge speed.

3. Save this and then power off the CC3D and power it back up, forcing a restart.

(https://forum.librepilot.org/index.php?action=dlattach;topic=530.0;attach=1002)

4. Now connect your Bluetooth module using the serial cable to the MainPort, reversing the Tx and Rx connections.

(https://forum.librepilot.org/index.php?action=dlattach;topic=530.0;attach=1000)

Green = Rx
Orange = Tx
Red = VCC
Black = GRND

(https://forum.librepilot.org/index.php?action=dlattach;topic=530.0;attach=1004)

You can see how I have the Tx from the MainPort connected to the Rx on the Bluetooth module, then of course the Rx connected to Tx.

5. Connect USB to the CC3D, GCS should automatically connect to it, and install a new COM port, mine ended up being COM5.

6. Power up the vehicle with external power for the Bluetooth module.

7. Open a terminal program, I'm on Windows so I used Putty.

8. Set the serial connection to 9600, 8,n,1 and in my case COM5.  (Check your Device Manager for the COM port assigned to the bridge)

Once Putty opens, type the following;

AT

Note:
This should be in caps and no enter or return is pressed afterwards, you won't see this entry as there is no echo enabled on the device.

You should get an OK response, if so you are connected to the device, continue with the following commands in succession.  You can simple copy and paste these one by one into the terminal window one at a time.

AT+VERSION

AT+NAMELibrePilot

AT+BAUD7

The first commnad responds with the Bluetooth module code version is purely to prove you are properly connected.
The second command changes the name of the Bluetooth device to 'LibrePilot'.
The third one changes the baud rate to 57600, you can go higher, I start with this to make sure things are working.  Some users seem to have mixed results going higher to 115200.

9. Change the hardware settings in the CC3D as noted below.  Note the Telemetry speed and the ComUsbBridge speed are now 57600 to match the new speed the Bluetooth module was set to.

10. Save the configuration to the board.

11. Power down the board by pulling the USB and any external power.

(https://forum.librepilot.org/index.php?action=dlattach;topic=530.0;attach=1006)

12. Re-connect the USB and any external power for the Bluetooth and reconnect to the GCS via USB.

13. Using Putty again, reconnect to your virtual COM port using 57600,8,n,1.

When Putty opens type;

AT

You should get a response of OK just as before.

This confirms your connectivity of 57600 to the Bluetooth module.

14. In the GCS make the changes to set the CC3D board to the settings for the Bluetooth module as noted below.  Disabling the USB VCP Port and setting the MainPort to Telemetry.  Save the config to the CC3D and then remove all USB and external power source again.

(https://forum.librepilot.org/index.php?action=dlattach;topic=530.0;attach=1008)

15. Power up your vehicle, without a USB connection ensuring your Bluetooth module has power.

Note: Ensure you take all necessary safety precaustions relating to your vehicle when bench testing, REMOVE ALL PROPS.

16. Depending on your system connectivity, locate the Bluetooth connectivity software and pair the Bluetooth module.  My device had a default pairing ID of '1234'.

Once paired, you should have additional ports now added to your computer that were installed when the Bluetooth module was paired successfully.  Mine is COM6 as seen below in the Device Manager.

Windows Device Manager

(https://forum.librepilot.org/index.php?action=dlattach;topic=530.0;attach=1010)

17. Now open the GCS, with no USB connected and the Bluetooth module powered on in your vehicle, and choose the new COM port to connect with, Bluetooth should connect and telemetry is now active.  Remember that you changed the name of the device to LibrePilot, you should see this in your Bluetooth list when pairing and in your list of available Bluetooth devices.

These are the steps I used after reviewing a few posts and older videos for using the flashed firmware which is now part of the latest firmware of the GCS.  I may have missed some steps or made some errors, please feel free to make suggestions I will update this post to reflect them.

I had originally posted this information in the OpenPilot Wiki which is now no longer available.  It is the same information originally posted, I'm missing some updates I made which were recommendations from forum members and as I tweaked the steps.  It eventually made its way into the OpenPilot Wiki with some embeliishments from the OP Team.

Please forward any suggestions for changes or additional information, I wanted to keep the configuration clean and only using the CC3D board for the configuration so as to not include additional devices, such as an FTDI device.

I'm working on a similar tutorial for WiFi, just awaiting some parts.

Happy Flying!

Title: Re: How to Set Bluetooth Device via ComBridge CC3D
Post by: f5soh on January 02, 2016, 08:39:04 pm
Nice, good entry :)

Did you look at the wiki page ?
https://librepilot.atlassian.net/wiki/display/LPDOC/Setup+a+bluetooth+for+telemetry

Feel free to amend wiki page.
Title: Re: How to Set Bluetooth Device via ComBridge CC3D
Post by: Zucky on January 02, 2016, 08:55:43 pm
Thank you,
I did see the Wiki post, didn't even dawn on me to make any changes there for review.

My steps are more of a direct step by step to get people through the config, hopefully making them familar with the process.

WiFi is next.
Title: Re: How to Set Bluetooth Device via ComBridge CC3D
Post by: mottex on October 08, 2016, 11:42:34 am
Hi there

I hardly try to setup the Bluetooth module HC-05, according to your description. Unfortunately the Hardware Configuration page does not show the ComUsbBridge Speed, attached a screenshot.

Actually i am using GCS 16.09 RC 1, is this eventually an issue of the new GCS?

Thanks for help
Title: Re: How to Set Bluetooth Device via ComBridge CC3D
Post by: f5soh on October 08, 2016, 12:24:21 pm
Seems you are using the 16.09RC

Baudrate should be automatically set to the baudrate set in Putty.
Title: Re: How to Set Bluetooth Device via ComBridge CC3D
Post by: mmuserver on October 08, 2016, 01:10:10 pm
Hi...have you solve this issue....?

Sent from my SM-N9005 using Tapatalk

Title: Re: How to Set Bluetooth Device via ComBridge CC3D
Post by: mottex on October 08, 2016, 04:44:23 pm
Ok. Then i have an other Problem... I have downloaded putty frommen the mentioned link, but it des not look like the pictures that i have seen in the forum...

Can someone make a short description and original pics?

Thanx

P.S. I tried also https://forums.openpilot.org/topic/7337-bluetooth-module-configuration-software/ - it says: Module not found

 
Title: Re: How to Set Bluetooth Device via ComBridge CC3D
Post by: hwh on October 08, 2016, 07:28:58 pm
Hi...have you solve this issue....?...
What issue?  The setting was removed from GCS and it was coded to use whatever speed the program you're connecting with is using.  Much easier than needing to set the speed in two places.
Title: Re: How to Set Bluetooth Device via ComBridge CC3D
Post by: mmuserver on October 08, 2016, 07:32:26 pm
Bluetooth on cc3d librepilot...I'm going in to it for this project with android app librepilot soon...

Sent from my SM-N9005 using Tapatalk

Title: Re: How to Set Bluetooth Device via ComBridge CC3D
Post by: hwh on October 08, 2016, 07:36:30 pm
@mottex I've used putty off and on for years, it's always looked the same as you posted. What forum did you find where it looks different?  This is not the place for a basic tutorial on using putty, there are probably ones on other sites.

The openpilot forums and wiki have been gone for almost a year, that was why the info was posted here.

For the module not found it could be connected wrong or you could have one of the modules that are programmed to not startup in command mode.  http://www.instructables.com/id/AT-command-mode-of-HC-05-Bluetooth-module/ talks about getting them into command (AT) mode.
Title: Re: How to Set Bluetooth Device via ComBridge CC3D
Post by: hwh on October 08, 2016, 07:38:40 pm
Bluetooth on cc3d librepilot...I'm going in to it for this project with android app librepilot soon... ...
There's no issue, it works fine.  This thread is a tutorial on how to configure it
Title: Re: How to Set Bluetooth Device via ComBridge CC3D
Post by: mmuserver on October 08, 2016, 07:52:18 pm
Owhh ok...thanks..

Sent from my SM-N9005 using Tapatalk

Title: Re: How to Set Bluetooth Device via ComBridge CC3D
Post by: DonCarpincho on October 09, 2016, 05:41:13 am
I've a Revolution Mini. The device works well on MainPort but now I have MainPort and FlexiPort in use (SBUS and GPS).

As I understand I can use the Receiver Port to connect the Bluetooth device, with Pins 1=GND 2=VCC 7=TX and 8=RX, putting this port in Telemetry mode, but it didn't work Any idea? Can I use the SonarPort instead?
Title: Re: How to Set Bluetooth Device via ComBridge CC3D
Post by: hwh on October 09, 2016, 09:13:41 am
Pins 7/8 can't be used for telemetry on what the Chinese call a mini revo.  You need to look at the chart of pin usages on whatever site you purchased the mini revo from.  The one I've attached is the common one.  If you compare it with the real revo pinout in the wiki https://librepilot.atlassian.net/wiki/display/LPDOC/Revolution+Configuration#RevolutionConfiguration-ReceiverPort you'll notice that the real revo has a 10 pin receiver port and the mini revo has an 8 pin one.  The Chinese skipped pins 3 and 4 on the real revo so all the pin numbers but the first two are off by two.  Pins 7/8 are really 9/10.  Telemetry would be on 5/6.

Another effect of them skipping pins 3/4 is that you can't hook up a ws2811 led strip to that port since the pins it uses are missing.
Title: Re: How to Set Bluetooth Device via ComBridge CC3D
Post by: Mateusz on October 09, 2016, 09:37:43 am
Bluetooth on cc3d librepilot...I'm going in to it for this project with android app librepilot soon... ...
There's no issue, it works fine.  This thread is a tutorial on how to configure it

I read this now and I don't get what the problem was, but when I was configuring my HC-05 with FTDI USB-Serial adapter I remember it had some problems. Configuring it didn't work at first few times, and I thought my HC-05 is broken, then out of sudden it started working properly and responding. I am still using it without problems now with LP2Go Android app, and all is fine now.

If you had such a problem I suggest first checking HC-05 module itself if it's working. Best is to download Android serial bluetooth application (maybe blueterm or other, there are plenty fo them).
Connect your HC-05 with FTDI USB-Serial adapter to your laptop. Pair your phone with HC-05. Start Putty and try sending something from laptop to android terminal and other way around.
If that is working, then LP2Go should also work, and telemetry with LibrePilot should work.
Title: Re: How to Set Bluetooth Device via ComBridge CC3D
Post by: mottex on October 09, 2016, 11:18:14 am
Because i don't have an usb-ftdi adapter, i want to connect via the cc3d board.

So I am not sure if the port is right - i only have CopterControl Virtual COM Port (Com4) - see the screenshot.
Title: Re: How to Set Bluetooth Device via ComBridge CC3D
Post by: hwh on October 09, 2016, 07:01:50 pm
That is the correct port.
Title: Re: How to Set Bluetooth Device via ComBridge CC3D
Post by: mottex on October 09, 2016, 08:46:45 pm
Thanks! The quest go es on  8)
Title: Re: How to Set Bluetooth Device via ComBridge CC3D
Post by: mottex on October 11, 2016, 02:47:11 pm
I'm still trying to setup the BT HC-05 via Combridge. I tried several serial Terminal Programms like putty, etc. - I don't get any answers from the module!

It's in a seconds blinking state.

Pairing with my phone works, sending commands with the android app to the pc works. But the damn thing won't give me any replies to my AT commands...

Anyone an idea?

Thanks
Title: Re: How to Set Bluetooth Device via ComBridge CC3D
Post by: hwh on October 11, 2016, 10:32:30 pm
While I have read that some people have modules that startup in command mode all four of the modules I purchased start up in pass through mode unless I put in the jumper. If the instructions on how to get the HC module into command (AT) mode I linked to in reply #9 above don't work you'd have to do further research on your particular module.  Maybe contact the seller and ask them how to get it into command mode.

Have you tried swapping TX and RX wires just to make sure they're right?  That's usually the first thing I do if I'm somewhere that I don't have the test equipment to verify the pin out is correct.

And the usb-serial adapters like the FTDI one or CP2102 ones are really inexpensive, banggood sells them for around $3.   USB To TTL / COM Converter Module buildin-in CP2102 New (http://www.banggood.com/Wholesale-USB-To-TTL-COM-Converter-Module-buildin-In-CP2102-New-p-27989.html?p=SO28133399239201512V) is similar to the one I use.