Bluetooth

Introduction

Want to make your CupCake even more awesome? Then why not make it wireless! Be the first on your block to have a Bluetooth enabled factory and say goodbye to wires. :)

(Note: With this mod, you will be able to wirelessly use the control panel, start/stop builds, etc, but you must do your actual builds from SD card as there is too much latency to print via Bluetooth.)

Tools

So to get started, here are all the tools you'll need:

  1. 1 CupCake CNC (Gen3 Electronics)
  2. Wire Cutters
  3. Wire Strippers
  4. Jumper Wire
  5. Soldering iron with your favorite solder
  6. Break Away Female Headers
  7. Bluetooth Mate
flickr:5367847720

The Bluetooth Mate and the Break Away Female Headers can be purchased from SparkFun. Buying both of those parts will cost you about $66. Not too bad to make your bot wireless. :)

Now that we have the parts list out of the way, let's begin! (evil scientist laugh here)

Remove the RepRap Motherboard

First, let's disconnect the RepRap motherboard and take it off the bot.

flickr:5367238493
  • Start pulling the connectors off
flickr:5367241381
  • Carefully unbolt the board
flickr:5367851986
  • Done!

Bluetooth Mate Connector

Now that the RepRap motherboard is off, let's get to making our connector for the Bluetooth Mate.

Get out the female headers and your clippers and cut a 6 pin header off.

flickr:5367852802
  • The tools for this step
flickr:5367244871
  • Snip 6 pins off

When you're finished it should look like this.
flickr:5367855468

Heat up the soldering iron and get ready to now solder the 6 pin header to the Bluetooth Mate.

flickr:5367245739

When soldering on the connector the orientation should look like the picture below. The female inserts are on the side of the PCB where you see the little Bluetooth module.

flickr:5367246389

Now that we have the right orientation, let's solder those pins!

flickr:5367247173

Great! Now that the Bluetooth Mate is all ready to go, it's time to work on getting the RepRap board ready. Since the serial connection on the motherboard isn't providing VCC to power the module, we're going to connect the VCC and GND pins on the serial connector to the free VCC and GND pins on the RepRap board.

Modify RepRap Motherboard

(Note: Once you have made this modification, do not try to use your USB serial cable without disconnecting the red VCC wire first. In theory, it might be okay, but if one of your regulators is off by a hair, bad things could happen.)

Cut two wires about 11cm in length and strip both of the ends.

flickr:5367247813

Take the RepRap board and flip it over. Solder the red wire into the VCC hole and the black wire onto the GND hole located right under the ribbon connectors for the stepper motors (only the red wire is necessary, the black ground wire is optional). Here's a picture to help show what's going on.

flickr:5367859074


flickr:5367248559

Once you have those soldered on, take the other ends and connect them to the VCC and GND of the serial connector. Here's a picture to show where they should go.

flickr:5367859480

This is what it should look like when you're done.

flickr:5367249787

Now that we have our RepRap motherboard and Bluetooth Mate ready to go, let's connect them together and then put the RepRap board back onto the bot.

flickr:5367860472


flickr:5367862838

Connect Everything Back Up

Sweet! Our little CupCake is now super fly. :) Now take a quick break because we're all most finished. The next thing we have to do is get the Bluetooth Mate talking to the computer and then getting ReplicatorG able to connect to it. I'll go over how to set this up for Mac and Windows computers.

flickr:5367863788

Setup Bluetooth Mate and ReplicatorG on a Mac

To get your Mac talking to the Bluetooth Mate, first turn on your CupCake so the Bluetooth board is powered. Then go to System Preferences.

flickr:5367627877

Once there, click on the Bluetooth icon.

On this menu click on the + button on the left to setup a new device.

flickr:5368238328

After a few seconds your computer should locate the Bluetooth module and it will be named FireFly-DC9A.

flickr:5368238438

Once you've selected the device, click continue. It will now try to pair but will probably come back with an message saying it was unsuccessful. No worries. From here click on Passcode Options.

flickr:5367628177

On this dialog, select "Use a specific passcode" and type in 1234 in the input box next to it.

flickr:5367628359

After clicking ok, it should successfully pair. Your computer is now talking to the Bluetooth module! :)

flickr:5367628467

Now that the computer is talking to the Bluetooth Mate, we need to slow its baud rate down a bit so that the RepRap motherboard can successfully communicate with it. By default the Bluetooth module is set at a baud rate of 115200. We need it running at 38400.

So to do this, open up a brand new terminal window. Now before we start typing anything, there's something I should point out. In order for us to change the baud rate we need to put the Bluetooth Mate into command mode first. This can only be done within 60 seconds of when the module is first powered. So we'll go ahead and get our terminal window ready with what we're going to type and then we'll reset the CupCake.

flickr:5368239044

In the terminal window type: screen /dev/tty.FireFly-DC9A-SPP

Now before you press enter, reset your CupCake. Once you've done that, quickly press enter once the machine has powered back on. You may not be able to connect the first few times so keep trying until your 60 seconds is up. To know if you have successfully connected, a little green LED should be light on the Bluetooth Mate.

Once you're in and connected, type $$$. The Bluetooth module should respond with CMD.

flickr:5367629251

If you get no response, you might have lost your 60 second window of opportunity. If so, exit Screen by pressing Control-a and then Control-\ and then try the above steps again.

Great, so now we are in command mode. We don't need to worry about time limits anymore. :) From here, go ahead and press 'd' then 'enter'. A bunch of information should be displayed on your screen about the device.

flickr:5367629533

Now let's change the baud rate. Type in SU,38 and then press enter. The module should respond back with an AOK. If you get an ERR response, make sure you typed it in correctly.

flickr:5368240038

Guess what? We're now done with the Bluetooth mate! It's now ready to communicate with the CupCake. From here, type '- - -' to exit out of command mode and then press Control-a and then Control-\ to exit Screen.

Go ahead and reset your CupCake so the new changes will take effect on the Bluetooth Mate. Fire up ReplicatorG and go into Machine > Serial Port.

flickr:5367630091

You should see /dev/tty.FireFly-DC9A-SPP as an option. Click on it and you should then be connected! If it's not connecting, it sometimes takes a few times for it to finally work. After you get it to successfully connect, ReplicatorG connects to it really fast.

flickr:5368240502

Setup Bluetooth Mate and ReplicatorG on a PC

To get your Windows PC talking to the Bluetooth Mate, first turn on your CupCake so the Bluetooth board is powered. Then click on Start > Settings > Control Panel.

flickr:5367630319

Once there, click on Bluetooth Devices.

flickr:5368240870

On this dialog click Add Wireless Device to setup a new device.

flickr:5368240964

After a few seconds your computer should locate the Bluetooth module and it will be named FireFly-DC9A.

flickr:5367630811

Once you've selected the device, click next. It will now ask you to select a pairing option. Choose "Enter the device's paring code".

flickr:5367630929

On this dialog, type in 1234 and then click Next.

flickr:5367631029

After clicking Next it should successfully pair. Your computer is now talking to the Bluetooth module! :) If windows is showing an error that it couldn't pair successfully, try it again. It took me a couple of times before it worked.

flickr:5368241550

Once you're done adding the device, you should see the Bluetooth Devices menu again and in the list you should see our newly added device. Double clikc on it and then select the Services tab. Make sure SPP is checked and take note of the COM port number. On my computer it was 3. You can close all of these windows.

flickr:5367631429

Now that the computer is talking to the Bluetooth Mate, we need to slow its baud rate down a bit so that the RepRap motherboard can successfully communicate with it. By default the Bluetooth module is set at a baud rate of 115200. We need it running at 38400.

So to do this, we're going to use Putty to configure it. Putty is a free telnet client that is great for communicating with serial devices. Download it here. Before we start using Putty, there's something I should point out. In order for us to change the baud rate we need to put the Bluetooth Mate into command mode first. This can only be done within 60 seconds of when the module is first powered. So we'll go ahead and get Putty ready and then we'll reset the CupCake.

flickr:5368241898

In Putty, select the Session category on the left and then click the Serial radio button under connection type. From here, type in COM3, or whatever your Bluetooth COM port number is, and then type 115200 in the Speed text box.

Now before you click Open, reset your CupCake. Once you've done that, quickly click the Open button when the machine has powered back on. To know if you have succesfully connected, a little green LED should be light on the Bluetooth Mate.

Once you're in and connected, type $$$. The Bluetooth module should respond with CMD.

flickr:5368241956

If you get no response, you might have lost your 60 second window of opportunity. If so, exit Putty and then try the above steps again.

Great, so now we are in command mode. We don't need to worry about time limits anymore. :) From here, go ahead and press 'd' then 'enter'. A bunch of information should be displayed on your screen about the device.

flickr:5367631713

Now let's change the baud rate. Type in SU,38 and then press enter. The module should respond back with an AOK. If you get an ERR response, make sure you typed it in correctly.

flickr:5367631791

Guess what? We're now done with the Bluetooth mate! It's now ready to communicate with the CupCake. From here, type '- - -' to exit out of command mode and then close Putty.

Go ahead and reset your CupCake so that the new changes will take effect on the Bluetooth mate. Fire up ReplicatorG and go into Machine > Serial Port.

flickr:5367632027

You should see your Bluetooth COM port as an option and in my case it is COM3. Click on it and you should then be connected! If it's not connecting, it sometimes takes a few times for it to finally work. After you get it to successfully connect, ReplicatorG connects to it really fast.

flickr:5367632179

It's Over!

Well that's it. Hopefully this little tutorial helped get your CupCake talking wirelessly. Living in the future is awesome! :)

Unless otherwise stated, the content of this page is licensed under GNU Free Documentation License.