The initial modifications to the Reprap 3D Printer firmware called Marlin are ready for public testing. I’m using it now to control the printer wirelessly and run jobs from its SD card. The code is at https://bitbucket.org/terawattindustries/marlin-bt (master branch). Communication speed between Arduino and BT is @ 115.2kbps. UPDATE: default speed is now 500K in firmware means set your BT module accordingly.
I’m using the Bluetooth module discussed in a previous post. The Bluetooth setup costs about $25. Terawatt Industries is manufacturing a PCB design so this attaches directly onto RAMPS and will work with RepRap power sources without an adapter board as shown.
- I’m using the BT module I blogged about at https://tenacious33.wordpress.com/2012/07/21/5v-tolerant-bluetooth-module/. It’s reliable and inexpensive. It’s class 2 but that seems perfect here.
- Speed is 115.2kbps. 250k (Marlin max) should work with the firmware also, but this BT module is programmed for 115.2k. UPDATE: I’ve confirmed Marlin go handle the MEGA’s max USART speed of 1M bps. This module goes a little faster so I’m experimenting with 921.6k bps and will know more soon.
The new features are:
- Installs just like Marlin – use the Arduino IDE.
- Enabled with a #define in Configuration.h.
- Backwards compatible with USB connections, whether or not #define’d.
- USB and Bluetooth connections live side-by-side. In testing we can have one machine connected to the printer via USB, then connect to the printer from another machine using Bluetooth and issue GCODE commands, like SD print. The machine that’s connected via USB echoes all of this on its console (Pronterface) and we can even disconnect and re-connect the BT module to eavesdrop without affecting the print.
- USART2 is used for Bluetooth communication in the firmware and USART0’s behavior is mostly intact. Actually, when BT support is enabled everything on USART0 gets multiplexed to USART2.
- USB and Bluetooth commands shouldn’t collide. This isn’t well tested – it’s an unusual scenario – but the firmware should only read one command from each port and block the other until the end of command is reached. There are some interesting implications. Let’s move along…
These instructions apply to the pictured BT module. The module must be wired as 5V tolerant as mentioned in my blog post.
- Download the Bluetooth-enabled version of Marlin from the Terawatt Industries Bitbucket Repository.
- Install the firmware on your (RAMPS/Arduino MEGA) control board. The reprap wiki has instructions for this if you need help.
- Connect the BT module’s 3v3 pin to a 3.3 volt power source. The Terawatt ATX PSU Adapter Board and the ATX PSU Dev Board from Ultimachine are awesome for this. They’re perfect for powering 3D printers too.
- Connect the BT module’s GND pin to a ground source.
- Connect the TX pin from the BT module to pin 17 on RAMPS 1.4.
- Connect the RX pin from the BT module — through the 5v tolerant circuit — to pin 16 on RAMPS. If you skip the 5v tolerant circuitry you’ll fry this BT module as stated in the datasheet.
Printing via Bluetooth
These instructions assume you’ve already installed the Bluetooth-capable Marlin firmware on your RAMPS 1.4 Control Board and attached a working Bluetooth module to it.
- Pair your computer to the BT module. Doing this depends on your OS, whether you run Windows, OS X, Linux, or otherwise. For this module the name contains the word “linvor”. The Linvor BT module has a pin of 1234.
- Open Pronterface.
- Set connection speed to 115200
- Choose the port listed with the name of your Bluetooth module
- Click Connect
- Tell Pronterface to print all the neat things stored on its SD Card. You can print via bluetooth – just make sure your computer stays in-range for the duration of the print.
If you’re using the “screen” app or a terminal to drive the Bluetooth connection the following GCODE commands can be useful: