Let's Make Robots!

[SOLVED] Processing communicating with Arduino via Bluetooth problems

I am at my wits end! Ive spent the last three or so hours trying to get this to work with no avail.

On my L33T bot I have an HC-05 hooked up to the Arduino's TX & RX pins so that I am able to send commands to the bot from my computer. It is fully functional as I have tested it both on a Blutooth Terminal app on Android and also on Tera Term on Windows. I know that the COM port of the HC-05 on my computer is #4 however when I try to write values to COM 4 in Processing I get serial write errors, which to my knowledge means there is no connection. I then put in the print serial lists command into my sketch and found that it was unable to find my Bluetooth device. The only way I was able to get Processing to see it was to have Tera Term open and have it connected to the HC-05, however when I tried to write the values to it from Processsing I got 'this com is busy' errors. I believe the problem being that Processing isn't able to read the HC-05 as a serial com port. Any help would be amazingly appreciated.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Thanks very much to Chris the Carpenter who had gone through the same ordeal I had, and fixed it!

For those of you who come across the same problem the way to fix it is to download the Toshiba Bluetooth Stack. Setup the connection to your bluetooth board, record the com port, and use that in Processsing, thats it!

Hi chickenparmi,

I seem to have the same problem as you. Do you have a link to the Toshiba Bluetooth Stack you downloaded? I've tried one and it gives me errors regarding not having Toshiba hardware?

Do you have any tips for resolving your problem?

Many Thanks


I'm not able to post a direct link, but lets just say there is one available on Pirate Bay. Toshiba has actually stopped carrying the non Toshiba hardware bluetooth stack but there are still remnants of it out there.

First let me say I don't know what I'm talking about here.  I don't have Win 7 or bluetooth at home.  But, it sounds like Windows isn't initializing the bluetooth as a com device, but Teraterm is.  I found this thread http://www.developer.nokia.com/Community/Discussion/showthread.php?207942-Setting-up-bluetooth-port-in-Windows-7

About half way down the page PhantomOfTheOpera describes a procedure to have windows set up the bluetooth as a com port.I don't have any idea if this will help you, but it's worth a look.

Ok so I tried this and it sucessfully created a com port, but, the method created an incoming port, where as Processsing will be writing through an outgoing port, I just ignored this and tried anyway. The outgoing COMS appeared in Processing, but alas, no incoming ports were displayed. I thought I would give the new COM port a go anyway, changing my serial port to the newly created COM 7, but it would still return writing errors. Thanks for the help though bdk6, I didn't see that site on my extensive google travels.

sorry to bring something up but in my experience incoming vs outgoing purely means which device is initiating the connection. In the case of an incoming port you want to HC-05 to be acting as the host device and start the pairing rather than the windows device scanning for devices and pairing with the HC-05.

Read/write then doesnt care.