Pages: [1]   Go Down
Author Topic: Upload sketch using Bluetooth  (Read 1073 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi.

I have spent some time with led strips and Arduino Uno. Have now moved on to Arduino pro mini 328 as a smaller physical format.
Trying to get a reliable bluetooth connection.
I am now using IDE 1.0.3

Arduino pro mini 328.
Sparkfun FTDI basic serial interface for wired connection and programming of bluetooth module.

All configured at 115200baud.

Hobbytronics Bluetooth-M interface.
Bluetooth module is EGBT-046S
Paired this device to laptop pc.

BT module supports a serial interface connection/protocol (but not HID).

Setup using FTDI USB wired interface.
Loaded a basic sketch, which just outputs some text/time values to the serial port every few seconds.
It will also print the ascii value of a character typed on the keyboard, over same serial port.

OK.
Swapped the FTDI for the Bluetooth interface.

Can establish connection with the BT module using windows (XP) quick connect facility.
Opening Arduino IDE seems to drop the BT connection. Then, using Tools, Serial Monitor, seems to re-establish it. smiley

The afformentioned output to the screen is seen and again, typing a character on the keyboard prints the ascii code. so the BT link is working. In a 'short' test this has been run for over ten minutes and continues without problem.

However. I can't get a sketch to Upload via BT.
Clicking on the Upload arrow in the IDE, drops the BT connection (if it was on during abve test). The Uploading progress bar in the IDE moves to  almost the end but  then just stops. (Looks as if the compile has finished but the upload is stuck). No error message.

I've tried selecting other boards (eg with Arduino BT w/ ATmega 328) to no avail.

Anyone achieved upload? Is the HID protocol/connection of relevance?

Sketch here.

++++++
int SerialInVal;
void setup()
{
  Serial.begin(115200);
  Serial.println("BT_test01 (115200baud)");// print name of sketch running...
}

void loop()
{
  Serial.print("millis = ");
  Serial.println(millis());


  if (Serial.available())
  {
    SerialInVal = Serial.read();
    Serial.print ("Character = ");
    Serial.println(SerialInVal);

  }//endof if Serial.available()

  delay(2000);
}// endof Void Loop()


++++++




« Last Edit: January 09, 2013, 06:28:18 pm by JohnSan » Logged

I'll be glad when I've had enough!

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Is the HID protocol/connection of relevance
Only if you write a special version of avrdude that will program parts over a keyboard device instead of a serial device...


Is your Bluetooth module's RTS connected to the Arduino's reset pin?  If not, you will need to manually reset whenever uploading, which could be tricky.

You should probably also enable verbose output in the preferences.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've checked the connections.

The RTS was connected to the reset pin, but via 10k resistor. Just tried with that jumpered out, but it doesn't seem to be any different.

The USB FTDI module, usually used to communicate/program the Pro Mini, has a DTR connection which is connected to the reset pin. That resets the arduino before download commences and works fine..
http://www.hobbytronics.co.uk/ftdi-basic

There is no DTR available on the BT module, only RTS. CTS on both modules are linked to GND(0V) by the Arduino.
http://www.hobbytronics.co.uk/wireless/bluetooth/bluetooth-module


I've tried setting the baud rate to 57600, both in the sketch and BT comms.
I've tried selecting the Arduino BT w/ ATmega328 as the destination board.
That sets the 'Overiding Baud Rate' to 19200.
(Shown in verbose output screen).


It looks as if, launching the IDE interupts the BT comms and when selecting Tools menu.
I guess, unless some code is added to specifically account for this, it's not going to work.
That's beyond me....

Thanks for the suggestion.

Here was the verbose output when Arduino Pro Mini 328 was selected.

+++++++++++++++++++++

Binary sketch size: 2,810 bytes (of a 30,720 byte maximum)
C:\ARD\arduino-1.0.3\hardware/tools/avr/bin/avrdude -CC:\ARD\arduino-1.0.3\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -P\\.\COM10 -b57600 -D -V -Uflash:w:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build8789640708237537257.tmp\BT_test01.cpp.hex:i

avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\ARD\arduino-1.0.3\hardware/tools/avr/etc/avrdude.conf"

         Using Port                    : \\.\COM10
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv: m [6d]
avrdude: stk500_getsync(): not in sync: resp=0x6d

avrdude done.  Thank you.

+++++++++++++++++++++

Logged

I'll be glad when I've had enough!

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Maybe I should have spotted this before since there are so many questions about avrdude getsysnc on the forum....
There is a return value  'resp:0xZZ'  that should give a clue to the problem.
Response i am seeing is:-

avrdude: stk500_getsync(): not in sync: resp=0x6d

Is there info anywhere on what 6D means?

I've looked at some avrdude files on Github but the're beyond me.

Is there more basic info anywhere else?
Logged

I'll be glad when I've had enough!

Pages: [1]   Go Up
Jump to: