[UPDATE: We now sell a Bluetooth set that has all this pre-setup for you. If you get that, no need to read further!]. We're going to be adding Bluetooth connectivity to more 3DR products in the coming months, but there's no need to wait. Right now you can add Bluetooth connectivity yourself with cheap third-party bluetooth modules. Connecting the APM and Pixhawk via Bluetooth is a great way to do basic setup and mission planning with your laptop (Mac, PC or Linux) or Android phone or tablet, without the need to carry and connect a 3DR radio and OTG cable. You’re limited to Bluetooth range (about 50m), but for wireless setup before launch, this works fine. Mission Planner (Windows), APM Planner (Mac, Windows, Linux), DroidPlanner and AndroPilot (both Android) all support Bluetooth connectivity.
This tutorial will show you how to connect two kinds of commonly available Bluetooth modules (shown above) to APM or Pixhawk.
The process consists of three steps:
- Configuring the modules so they’re running at 57600 baud
- Physically connecting the modules to APM/Pixhawk
- Connect via BT to your Android device or laptop and a GCS app (pair the module with your device)
Option 1: Setup with RN-42 and RN-41 Bluetooth modules
Connect the module with an XtreamBee adapter board and this cable
TO GET THE COMMAND PROMPT
You can use any serial terminal program (the terminal in the Arduino IDE is shown), but there are a few things you need to do:
- You must enter command mode within 60 seconds of powering up the board
- The board can’t be already wirelessly paired with a device (such as your phone or tablet)
- The default baud rate is usually 115200. We need to change that to 57600 baud. But for the first connection, to get the command prompt for this change, we’re going to start at 115200.
- To get to command mode, you need to select “No line ending” in your terminal program, then enter “$$$” [enter]. After that, the terminal program needs to be in “Newline” mode, as shown below. Crazy, but that’s the way Roving Networks set it up. Now you know!
First, ensure that your terminal baud rate is at 115200 and “No line endings” is selected. Then plug in your module and within 30 seconds type “$$$” [enter]. You should get the return message “CMD”.
Once you have that, switch your terminal program to “Newline” for the rest of the commands.
Now you can enter commands. To switch to a 57600k baud rate the command would be "SU,57" (A full list of commands is here, although you won’t need them for this change). Once you reboot the board, that baud change will take effect.
Congrats, you’re done! Now you’re ready to use it with APM/Pixhawk. See the bottom of the post for instructions on how to use the GCS apps with Bluetooth.
-------------------------
Option 2: Setup with cheap ($10) HC-05 Arduino Bluetooth Module
Full instructions are here, but the basics are below:
You can make your own cable by swapping some wires in the standard 3DR telem-to-Xbee adapter cable. For clarity’s sake, I’ve used some color-coded wires above to show what goes where.
Here’s a neater cable that I’ve made with some regular breakaway header pins:
This same custom cable will allow you to plug it into a regular FTDI cable (shown below) so you can change the configuration of the Bluetooth board to switch the default baud rate from 9600 baud to 57600 baud.
Once you’ve plugged the board into your FTDI cable and plugged that into your computer, it will show up in your computer as a serial port. The LED on the board should be blinking red, not blue. You should NOT wirelessly pair the Bluetooth model with any device at this point; if it the LED is blue that means that it’s paired with something, so if that’s the case make sure that you unpair it first. At that point you can use any serial terminal to communicate with the Bluetooth module. For the sake of this demo, we’ll use the serial terminal built into Arduino.
First, select the port assigned to your FTDI cable (it probably won’t be 26, as shown below, and on a Mac it may show us as “tty-usbserial”):
Ensure that the serial terminal baud rate is set for 9600 baud and “No line ending”, as shown.
Type AT [return]. The board should return “OK”. That means that all is well and you’re talking to the board. If you don’t get a return, check your wiring and make sure that the Bluetooth board is showing a blinking red LED (powered on) and is not blue (paired with something).
Now we can change the baud rate to 57600. The command for that is “AT+BAUD7 [return]”, as shown. If this is a success, it will report back “OK57600”, as shown below. If so, you’re done! Unplug the board and you’re ready to use it with APM/Pixhawk.
-------------------
Now that you have your module working, you just need to pair with your device. On Android, this is the Bluetooth settings. Set your device to "discoverable" and you'll see the module show up. Then pair it. If it asks for a code, type "1234".
Once it's paired you can connect with either Android app: DroidPlanner 2 and Andropilot. On Andropilot, there's a button marked "Bluetooth" on the main screen. On DroidPlanner, go to the settings menu (top left) and under "Telemetry Connection Type" select Bluetooth and the module you've paired with it.
Both of these modules work great with either app!
Comments
@Richard: The FTDI pins are accessible on the Bluetooth Bridge. It requires you open the case up but it's just 4 screws. There are FTDI pins for the Bluetooth module and separate FTDI pins for the telemetry radio. You just have to unsolder the pads that pair the two radio's tx/rx lines together and then you can program it up for updates. It will take less than 10 minutes to do, 5 minutes if you have everything set out to desolder, upload firmware, and solder it back up. All the information is on the wiki I linked to and has been updated after I sent them feedback on the process.
@Bill
re-MFi you forgot painfully slow! Thanks for the info gonna go with your wifi suggestion. Longer range I think too. And it will works with MavPilot.... someday :[ It sure will be nice to broom the OTG!!
@Richard: The Bluetooth SSP (Serial Port Profile) on iOS devices is encrypted. To use it you need to go through the Apple MFi (Made For iDevices) program. That can be expensive. You can use BluetoothLE, but the data rate is too slow. I've found using WiFi works great, and avoids the previous problems mentioned
@Ryan
ahhh Okay got it thanks!
Richard, I only have my phone paired to Bluetooth for "listening" and the laptop connected to the FTDI cable via USB for TX and RX. IF you try to connect the TX on the BT and Laptop mission planner doesn't work.
FYI here's two other links of info on the same subject just for anybody's benifit
Bill @ communistech prefers the wifi rout over blue tooth not sure why yet I would sure like some clarity on that.
http://www.communistech.com/blog/support/
Here's a $10 option for blue tooth on the remote side just for super close flights or probably more practically speaking just for a cheap way to connect to APM for set up / param adjustments. This set up is similar to the Dji Phantom which uses BT for initial set up but does not have full blown long rage telemetry [ unless you feel like spending another $400 or so ].
http://diydrones.com/profiles/blogs/connecting-your-phone-tablet-or...
Thanks guys for the clarifications! I really appreciate it!
Being as I already have a spare RFD900 I think I will try and make a bridge like Ryan made. The event39 is nice too I only wish they had incorporated an accessible FTDI port like Ryan did for firmware updates. By like you [ healthyfatboy] say it's not impossible to do. Plus that set up has a battery with charger so not overpriced at all I don't think.
@Ryan... I can see your logic with your set up. Much more practical really to make param adjustments with the PC than trying to do that on a little phone. I'm still fuzzy on the set up though. Two questions.
Does this mean you have both your phone and your pc 'paired' with you bridge?
If you did connect the TX wires between the BT module and the RFD900 wouldn't that simply mean you could send commands to the plane / quad from either the pc or your phone?
Thx
@Richard
The Bluetooth Bridge will work with the RFD900. If you look at the Kickstarter page, the 915MHz reward at $139 states it works with the 3DR 915MHz and RFD900 radios.
I have one of the Event39 bridges and it works great. I wanted to update that radio to SiK 1.9 from the 1.7 that was on and it's pretty simple if you know what you're doing. I worked with Jeff over this last week to get that working and it's now up on the Wiki at the bottom explaining how to update the firmware on the unit. It only takes about 10 minutes once you know what you're doing.
http://event38.wikispaces.com/Bluetooth+Bridge
Again, it's a great product and works well. I've used it primarily for checking things out using Mission Planner and making sure it all works but once I have my ducks in a row with my plane and quad, that's what I'll be using with my tablet as I don't have a USB 3DR radio anymore, just air modules.
The FTDI cable is for the connection to Mission Planner and also the 5V. You could eliminate the FTDI and power with a separate battery. It would then be similar to the Event 38 setup. I just find it easier to have my laptop at the field for adjustments during flights/missions and the Bluetooth for my phone which is on my RC TX for monitoring.