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!