Lilypad w. Bluesmirf can't upload sketch

Hi all

I just bought a BT bluesmirf gold w. a lilypad powersupply (1.5 V).
-I hooked everything up to the lilypad and every Led started to blink.
-I set everything having to do w. BT in the system preference on my powerbook G4
-Opened the Arduino software/selected my device that has been recognized. Then tried to upload this sketch for a light sensor.

-When trying to upload / I know the BT recognises it because the Green LED turns on.
I check my wires (Vcc to 5+, gnd to - , rx to tx and tx to rx).

this is what I get in the arduino software:

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding

I think that could have something to do w. the voltage. I know the BT can go from 3.3V to 6. And right now my lilypad power supply is powered by a AAA 1.5v battery.

Is there not enough power to transfer the Logical 1 & 0's ???

Thanks a lot in advance

phil

unfortunately the Bluetooth connection doesn't quite act like a regular serial port. you can't do program uploading via bluetooth unless you modify the LilyPad's bootloader...

Once you've uploaded a program though, you can transmit & receive data over the bluetooth link just like you would if it were wired.

unfortunately the Bluetooth connection doesn't quite act like a regular serial port. you can't do program uploading via bluetooth unless you modify the LilyPad's bootloader...

Once you've uploaded a program though, you can transmit & receive data over the bluetooth link just like you would if it were wired.

Thank you so very much for shedding a bit of light.

Right before reading your post , I thought of trying what you suggested. Loading the sketch by USB. then plug the Bluesmirf to collect or send data.

But it still doesn't work??
When I turn the serial monitor (on) in the arduino software, the bluesmirf's green light turns on and on my mac os x (powerbook) the BT icon indicates that it is activated, but no data is transfered . Why??

Everything seems to get link (or responds to one another) but does not communicate.

Do I have configure something on my mac to enable modems to communicate ??

I'm a little lost and need this for a project that is coming up real soon.

Any other suggestions would be greatly appreciated.

Thanks again

phil

With the roving networks/firefly Bluetooth module, you need to set the baud rate of the Bluetooth module to correspond with the baud rate of the LilyPad communication (the baud rate you specify in your code). You do this via an application like HyperTerminal on a PC or Zterm on a mac. Read the Bluetooth command set (you can find this on the sparkfun site) which will tell you how to talk to your module to configure it. You will also want to keep the speed of the communication a little bit slower than you would w/ other arduinos. The LilyPad doesn’t have an external crystal, so it can have communication timing problems at high speeds. I tend to use 9600 just to be safe. hope that’s helpful!

Wow thanks that great !!

Your information is all I have to keep going : ) !

I will try this and give you some news.
In complete coincidence I had dowloaded zterm but it didn't seem to work. Maybe I had the wrong version; downloaded binary instead of PPC.

Again thanks a million

phil

With the roving networks/firefly Bluetooth module, you need to set the baud rate of the Bluetooth module to correspond with the baud rate of the LilyPad communication (the baud rate you specify in your code). You do this via an application like HyperTerminal on a PC or Zterm on a mac. Read the Bluetooth command set (you can find this on the sparkfun site) which will tell you how to talk to your module to configure it. You will also want to keep the speed of the communication a little bit slower than you would w/ other arduinos. The LilyPad doesn't have an external crystal, so it can have communication timing problems at high speeds. I tend to use 9600 just to be safe. hope that's helpful!

hi Leahb (by the way is this Leah buechley ? ; )

I have tried absolutely everything you suggested.
Plus I have no idea what commands I have to type in Zterm.
I've downloaded the command set (in the sparkfun website) like you suggest. But being the newbie that I am, I'm absolutely clueless on what to look for in these documents. Obviously, someway to reset the baud rate to 9600 (that's what I have in my lilypad sketch). But how?

I've search forums to find a walk trough. I did find a site that demonstrated how to connect to Zterm and to communicate. But at this point it stopped working for me. More precisely , the command were not responding when I pressed return/enter.
And sometimesI can,t even type commands. Nothing appears on the screen.
I also found this site showing that someone had figure it out w. the mac's termial.
So i tried what he demonstrated (I can't find the site now : (
and got , bluetooth acces denied.

One thing that does happen, is that my bluesmirf 's green light , lights up when I launch Zterm and/or the mac terminal ! ?? And the bluetooth icon (in the menu bar) demonstrates that it's sending something.

So if the baud rates are not matching , why is there a handshake??? What is the default Baud rate of the of the B.smirf? What I understood in the documents was that 9600 was, the default baud rate.
Do I have to use Max 232 to convert things to rs 232 even though it's not RS 232.

When the range is 0 to 5.5 or 6 , it's TTL type serial right???
Everything seems to be fine but , not data transfer why ??

People seem to have been having similar problem w. this bluesmirf.
Everything seems to be fine but , not data transfer why ??

what to do? I need this solved by maximum wed. ??

Thanks a lot for everything

One tiny request :slight_smile:
Could you tell me what I have to right in any of the terminals, I know nothing about commands

thanks a lot

phil

OK,

so, the default baud rate on the Roving Networks modules is 115200bps (you can see the rest of the default settings on page 19 of the command set documentation).

Before you do anything, read section 3 & 3.1 of the command set documentation. The crucial paragraph here is:

Run your favorite terminal emulator, HyperTerminal or other program. Type “$$$” on your screen. You
should see “CMD” returned to you. This will verify that your cable and comm. settings are correct. Valid
commands will return an “AOK”, response, and invalid ones will return “ERR “. Commands that are not
*recognized will return a “?”. *

To exit command mode, type “—“. (three minus signs).

Zterm is not the most user friendly application :wink: It took me forever to find some things in the menus. To talk to your bluetooth module:

Go to the “Settings” menu & open “Modem Settings”. In the window that pops up, select your Bluetooth serial port
from the drop down menu. It should say Firefly or SparkFun or RN or something like that… Don’t mess with any of the other settings in this window! If your Bluetooth port isn’t there, you need to set it up using the Bluetooth setup assistant first…

Then go to the “Edit” menu and select “Keyboard Buffer”. You’ll write the commands you want to send to the Bluetooth radio in this window.

To change the baud rate, first type “$$$” and hit return. This gets you into command mode. Then, to set the baud rate to 9600, you want to type “SU,96” and hit return (from page 10 of the datasheet) Then, to exit command mode, type “—” and hit return.

That should get you going.

cheers

ps

hi Leahb (by the way is this Leah buechley ? ; )

yep :wink:

Hi leah

1st of all I owe you a drink , actuallly 2 (one for this generous walkthrough and one for developping this wonderfull little lilypad)
Thanks :wink:

Now, I’m almost there !!! almost I’m sure .

Problem 1 solved; Fisrt of all, I did your steps to change the baud rate in Zterm but nothing was working (Zterm did not respond). Then I told myself, maybe if I try connecting my 3 x AAA battery pack to directly to the Bluesmirf. That solved it !! I was going through the lilypad w. the rx and tx unplugged.

-Now,plugged directly, the command $$$ was returning cmd and the others …

-So now thinking everything should work, I reconnected it to the lilypad (+ +/- -/rx tx/tx rx). The sensor I used was the light sensor<- I had already uploaded the sketch before w. the USb mini.

So finally when I hit the serial monitor in the arduino software, data did show up but it was ??? ??? ??? ??? ??? every 100 ms.

So, what could I possibly be doing wrong now??
should it be rx to rx and tx to tx!!

Here is the sketch;
/*

  • LilyPad tutorial: sensing (sensors)
  • Reads data from a LilyPad light sensor module
  • and then sends that data to the computer
  • so that you can see the sensor values
    */

int ledPin = 13; // LED is connected to digital pin 13
int sensorPin = 0; // light sensor is connected to analog pin 0
int sensorValue; // variable to store the value coming from the sensor

void setup()
{
pinMode(ledPin, OUTPUT); // sets the ledPin to be an output
Serial.begin(9600); //initialize the serial port
digitalWrite(ledPin, HIGH); // turn the LED on
}

void loop() // run over and over again
{
sensorValue = analogRead(sensorPin); // read the value from the sensor
Serial.println(sensorValue); // send that value to the computer
delay(100); // delay for 1/10 of a second
}

Everything should work :-?

Thanks a million in advance
for any suggestions

phil

Hmmm... It sounds like you're timing is just a little out of sync for some reason. 2 things to check.

  1. are you sure that you selected "LilyPad Arduino" from the Tools->Board menu in the Arduino software?

  2. are you sure that you've got 9600 selected in the Arduino serial monitor?

LEAH !!!!

That was it !!! ;D :cry: ;D

I had the wrong board selected for one.
And two, for some reason, I had to reload the code via usbmini onto the lilypad board.

THANK YOU SO VERY MUCH FOR YOUR GENEROUS TIME AND CONCERN.

We should definitively have more people like you.

thanks again and keep up the good work

phil ;D

One last thing i forgot to tell you!

The Zterm Keyboard buffer cmd will only work if I launch Zterm first, then power the bluesmirf. Weird, I would of thought it more logical the other way around. So it can it can recognize it by pressing the shift key when it is first launched.

Just to let you know

thanks :wink:

phil

yay! I'm glad you got it up and running :wink:

cheers,
Leah

Thanks again for the encouragements.

One tiny question,

Is it normal for the incoming info to be in the range of (230 to 330) that it. When plugged w. USB mini. the range is from (0 - 1023). <the full one.

Thanks again

phil :slight_smile:

unfortunately the Bluetooth connection doesn't quite act like a regular serial port. you can't do program uploading via bluetooth unless you modify the LilyPad's bootloader...

Once you've uploaded a program though, you can transmit & receive data over the bluetooth link just like you would if it were wired.

I'm about a year late to the thread, here...
Leah, can you shed any more light on this? Is it Lilypad specific?
I'm trying to solve this issue on a regular Arduino. Everything seems to tell me that rx, tx and a reset ought to do it, but if you can help me understand otherwise, I would GREATLY appreciate it.

That's really cool, you are almost precisely a year later.

The answer is that you have to upload the sketch 1st. then BT.
Regular arduino or lilypad.

phil

Thanks. I guess I'm gonna have to try and figure out what kind of changes need to be made to the bootloader to allow this. I thought the output was as good as serial, but there must be something different :stuck_out_tongue:

Could you guys tell me how to wire the Bluesmirf to my Duemilanove? I attached the ground and the power, red LED on. What's next? Do I have to attach the RX and TX to the corresponding pins on Arduino? Do I need to attach anything to the analog inputs?

Ok, I managed to set Zterm with the Bluesmurf, when I start it the green LED goes on. However, when I enter $$$ and press return, nothing happens, the terminal does not return anything.

Ahh, how annoying... The commands must be entered within 60 seconds after startup. Yay!

Finally working! Wrote a tutorial:

http://forum.sparkfun.com/viewtopic.php?p=94557#94557

Definitely worth reading if you have troubles setting up your Bluesmirf on Mac OS X!