Twig - Serial Bluetooth

I have a Serial Bluetooth Twig on the way :slight_smile: but am wondering if it is possible to program the Arduino over this link -and if so, what needs to be done to enable this (if anything)?

Many thanks, in advance

Whoopah! My Blootooth Twig arrived today. 10 days shipping - pretty good. Had to laugh at the Royal Mail parcel tracking service though… for the past week it said: “STATUS: On it’s way.” !!

Initial disappointment with the connector (!) was abated once I pulled the white plastic ‘shell’ off the pins and then found another non-compatible plug in my bucket’o’bits that had the same pin spacing and just slid onto the pins.

NOTE to anyone else considering this purchase - order the conversion cable to go with it (in packs of 5!) or make a plan. :wink:

After a frustrating while with it hooked up and loaded with the example code from the wiki page - I finally came to the day-break-moment that my diligent wiring of the four pins… +ve, gnd, Rx, Tx … was flawed.

NOTE to anyone else as dumb as me… Rx goes to TX, Tx goes to Rx. (NOT Rx-Rx, Tx-Tx !!) :blush:

So now on with the show. I’m hoping to have it talk to Director. I’ve got it paired my Powerbook and I’m starting to copy the BT code fragments over to my project.

QUESTION: does all the initialisation have to be performed every time the sketch runs? - does the BT module forget it’s configuration every time?

Turns out that including “b[/b]” before a blueToothSerial.read() makes all the difference!

while (blueToothSerial.available()){ // Serial.println(); Serial.print((char)blueToothSerial.read()); }
…works for me!

In SerialMonitor I can see numbers coming in (bytes!) instead of characters. This explains a lot.

My problem now is how do I send Carriage Returns over the BlueTooth Serial link??

I’m using the Messenger library to decipher strings that I send from Director. Messenger needs a Carriage Return to delimit the messages. I’ve tired the usual " & RETURN" method from Director and an assortment of other things like “& CR” or “\r” but to no avail.

Answers on a postcard…

Having to move over to the CmdMessenger library - which allows custom message delimiters rather than only Carriage Returns.

After many, many hours of hacking and troubleshooting I’ve finally got Director talking over Bluetooth to the Arduino.

I’m using CmdMessenger Library which uses “;” as a message delimiter because I don’t seem able to send Carriage Returns over the BT link. (otherwise I’d have stayed with Messenger Library which I was already successfully using over USB).

I couldn’t have done it without all the helpful input that I’ve received from this forum thread however! — Thank you, er, me. :wink:

I will say that dreamcat4’s comment over at http://arduino.cc/forum/index.php/topic,54296.0.html saying that he has CmdMessenger working over a NewSoftSerial (v11) Library connection was about the only external encouragment I’ve had - armed with that information I stripped my project code chunk by chunk into a new project until the whole thing hung together and worked.*

I hope this is of use to someone else.

  • caveat - I’ve now found that in using NewSoftSerial (which is timer driven) I’ve lost use of the FrequencyTimer2 Library. ARGH!
    Back to the drawing board there then!