Wireless 3D printing
Last week I had a "USB cable incident" with my Prusa (computer and printers are on different tables in my office). It was entirely my fault as I walked across the USB cable and I almost threw my printer to the floor. As a result, the ferrite torus I put in the USB cable to prevent EMI problems broke. Without it, I know prints may interrupt anytime due to interference.
While on eBay looking for a replacement, I realized that a Bluetooth module was costing less than $15 now. So I thought I could give it a chance to the idea of operating my printers wirelessly. Later, I learned of an even cheaper module at $6.60, but this one is 3.3v only (which is ok if you are using this voltage for your Arduino, but I am using 5v).
A quick look at Sprinter firmware and Arduino Mega and RAMPS board specs revealed that Serial2 port using 16 (TX) and 17 (RX) pins was easily available on the ext4 connector of RAMPS board. And so was GND and +5V. Making it very easy to connect the Bluetooth module.
And for the firmware changes, I do have an easy solution if you can give up the usage of the USB serial communication for printing (which I was). Just do a search and substitution of string "Serial." by "Serial2." in Sprinter.pde (same idea could be applied to other firmwares) and that is all. This way your printer will no longer be usable from the USB but you can always go back by reloading the former version of firmware. Please note that if you enable SD printing you may need to do the string replacement in some other source files too (same simple replacement).
You need to configure the module to use 115200bps (or change the firmware to 9600bps which is the default module speed) and you can do that by selecting the AT mode and using serial interface (3.3 volts only!) you use AT+UART=115200,0,0 command. Please note this module uses 38400 bps when in AT mode. For this job I used Spakfun's FTDI basic breakout module.
Once configured, the module can be wired to the RAMPS board with four wires (GND, +5V, RX, TX). Select the board in your favorite software (I use Pronterface) and you can connect and interact with your printer.
Problems ahead
Unfortunately, not all was a success (yet). For some weird reason, still to be determined (defective Bluetooth module, bad module firmware, ...), my happiness is not complete as there is a problem. Once I start printing, the print job is interrupted after a few moves.
The cause of the problem is that my Bluetooth module misses some characters in the RX line if Mega is not transmitting a character for more than ten seconds. The end result is that "ok" responses are damaged or lost entirely whenever the motion takes longer than ten seconds, so printing of large objects becomes a problem. But Bluetooth connection is never lost, so I guess the cause it is a poor implementation of power management in the Bluetooth module.
I hope that by replacing the module firmware or by adjusting some parameter I will be able to fix the problem. If not, I will be forced to buy a different module and keep this one for another task where this behavior won't be a problem.
Update: Once I replaced the Bluetooth module behaving badly from another [cheaper] supplier I have got it all working nicely and wirelessly at last. It works in Linux, Windows and OSX.
While on eBay looking for a replacement, I realized that a Bluetooth module was costing less than $15 now. So I thought I could give it a chance to the idea of operating my printers wirelessly. Later, I learned of an even cheaper module at $6.60, but this one is 3.3v only (which is ok if you are using this voltage for your Arduino, but I am using 5v).
A quick look at Sprinter firmware and Arduino Mega and RAMPS board specs revealed that Serial2 port using 16 (TX) and 17 (RX) pins was easily available on the ext4 connector of RAMPS board. And so was GND and +5V. Making it very easy to connect the Bluetooth module.
And for the firmware changes, I do have an easy solution if you can give up the usage of the USB serial communication for printing (which I was). Just do a search and substitution of string "Serial." by "Serial2." in Sprinter.pde (same idea could be applied to other firmwares) and that is all. This way your printer will no longer be usable from the USB but you can always go back by reloading the former version of firmware. Please note that if you enable SD printing you may need to do the string replacement in some other source files too (same simple replacement).
You need to configure the module to use 115200bps (or change the firmware to 9600bps which is the default module speed) and you can do that by selecting the AT mode and using serial interface (3.3 volts only!) you use AT+UART=115200,0,0 command. Please note this module uses 38400 bps when in AT mode. For this job I used Spakfun's FTDI basic breakout module.
Once configured, the module can be wired to the RAMPS board with four wires (GND, +5V, RX, TX). Select the board in your favorite software (I use Pronterface) and you can connect and interact with your printer.
Problems ahead
Unfortunately, not all was a success (yet). For some weird reason, still to be determined (defective Bluetooth module, bad module firmware, ...), my happiness is not complete as there is a problem. Once I start printing, the print job is interrupted after a few moves.
The cause of the problem is that my Bluetooth module misses some characters in the RX line if Mega is not transmitting a character for more than ten seconds. The end result is that "ok" responses are damaged or lost entirely whenever the motion takes longer than ten seconds, so printing of large objects becomes a problem. But Bluetooth connection is never lost, so I guess the cause it is a poor implementation of power management in the Bluetooth module.
I hope that by replacing the module firmware or by adjusting some parameter I will be able to fix the problem. If not, I will be forced to buy a different module and keep this one for another task where this behavior won't be a problem.
Update: Once I replaced the Bluetooth module behaving badly from another [cheaper] supplier I have got it all working nicely and wirelessly at last. It works in Linux, Windows and OSX.
Comments
Better option is to use a SD card and use your bluetooth to start the print.
I have been using SD for a while now and it never skips a beat. I am using an LCD display and rotary encoder so there is no need for any serial connection at all.
I have ordered a new module from another manufacturer to give it a try.
But do you mean using it as a Serial port? Arduino doc does not state these pins as a hardware serial port.
Can you elaborate on the idea?
Thanks.
So yes, using that would be a better idea, in fact I am just going to switch to this output.
Thanks for the tip!
As far as I understand it you can also programm them using an Arduino. Just connect them to some pins and the arduino to pc with usb and run some easy code.
I ll blog about it too, as soon as my item arrives from china.
have you tried it with the android app?
https://play.google.com/store/apps/details?id=com.hermit.btreprap
the needed sparkfun dongle is quite costly, just wondering if you can control it with your "random" dongle aswell... ?
I've tried it with an android ice 4.04 but it gets stuck at the connecting stage in the app, while the lights turn green on the bluetooth indicating "connection"