BlueTooth Blues

Hi all, BlueTooth noob here. I've developed a sketch to control a hacked model tank on a 168P 2009 board using USB - the sketch and motor driver hardware are deuggged and working using the 2009. Now I need to go wireless. I bought an official 328P Arduino BT and have paired it successfully with my laptop (running Windows 7 64 bit). The Arduino BT is powered by three fresh AA alkaline batteries, and the green LED is on. The board is sitting inches away from a BlueTooth Class I, version 2.0 device, which I know works, because I use it all the time to transmit audio to my wireless speakers.

When I look at the details of the BlueTooth connection, Windows says COM43, so I set COM43 as the port in the IDE, changed the board type to Arduino BT with 328P. I hit "upload" and the reset button on the Arduino BT, as suggested in the notes. I get confirmation that the sketch compiles (no surprise there), but then I get a message to say "expected=0x14, resp=0x51", and the upload fails. I've tried pressing the reset at different times, but still no luck.

I've googled this, but don't really understand the responses - if the "resp" is 0x51, that implies that the programmer is talking to the board, doesn't it?

I hadn't expected this much hassle from the board, but I'm stuck, and don't really know what is going on with the tools under the hood - the aim of the project is to produce an autonomous sentinel, not learn Arduino internals.

Is there any simple test I could make (using putty or something similar) to get a response out of the board's bootloader, even if it isn't programmed? Have I got a dead board?

Does anyone know any reliable Arduino BT troubleshooting techniques?

Sorry I have no experience with that card, but interestingly the Microsoft troubleshooter suggests that two of the potential issues for connecting with a bluetooth enabled device is that it could be out of range_...or too close_. I only thought of looking that up since you say your PC is class 1, which is a bluetooth device for maximum range, and you say it's inches away.

Do you have more success moving it further away? A long shot I know...

Thought about that, but moving the board too far away means I can't hit "enter" and the reset button on the Arduino.

Decided to try a simpler sketch:

void setup ()
  delay (1000);
  Serial.begin (115200);
int x;
void loop ()
  Serial.println (x++);
  delay (100);

got the following:

Binary sketch size: 2616 bytes (of a 28672 byte maximum) C:\Users\User\Documents\arduino-0021\hardware/tools/avr/bin/avrdude -CC:\Users\User\Documents\arduino-0021\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -cstk500v1 -P\.\COM43 -b19200 -D -Uflash:w:C:\Users\User\AppData\Local\Temp\build7161767570543449474.tmp\sketch_feb22a.cpp.hex:i avrdude: Version 5.4-arduino, compiled on Oct 11 2007 at 19:12:32 Copyright (c) 2000-2005 Brian Dean, System wide configuration file is "C:\Users\User\Documents\arduino-0021\hardware/tools/avr/etc/avrdude.conf" Using Port : \.\COM43 Using Programmer : stk500v1 Overriding Baud Rate : 19200 avrdude: ser_open(): setting dtr avrdude: Send: 0 [30] [20] avrdude: Send: 0 [30] [20] avrdude: Send: 0 [30] [20] avrdude: Recv: avrdude: stk500_getsync(): not in sync: resp=0x00 avrdude: Send: Q [51] [20] avrdude: Recv: avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51 avrdude done. Thank you :(

I've tried all sorts of timing - hitting the reset before clicking on download, after, slightly after, waiting for the sketch size to appear - I can't believe this is so hit-and-miss (mostly miss). What do other BT users do? Just use an ICSP for every sketch, and then only use BlueTooth for host comms after programming? I did find an add-on for auto-reset, but I'm a bit tight for space, and don't know where I'd put it.

Would a later version of the IDE be any better? I don't really want to update, because the control sketch was developed and debugged using 0021 and I don't want to have to go through retesting every subsystem again