Pages: [1]   Go Down
Author Topic: Bluetooth works, uploading sketches does not.  (Read 1364 times)
0 Members and 1 Guest are viewing this topic.
British Columbia, Canada
Offline Offline
Newbie
*
Karma: 2
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have an Ardweeny (uno-compatible) https://solarbotics.com/product/kardw/
I have a TTL Bluetooth Adapter http://www.geeetech.com/serial-ttl-bluetooth-module-p-601.html

The first thing I want to say, is that they work.  I have tested the bluetooth adapter on a USB-TTL connector.  I have connected the Bluetooth to the TTL connector on the Ardweeny, and everything works well.  I have been able to write test sketches and communicate both ways over bluetooth with my Windows Vista laptop.  Everything works.

Except uploading sketches via Bluetooth.  I've tried everything I can think of, and I can't get it to work.  The correct COM port is selected, as well as the baud rate of 115200.  I can click on "serial monitor" and communicate both ways if I have a sketch uploaded the old fashioned wired way beforehand.  But clicking "upload" gives me "avrdude: stk500_getsync(): not in sync: resp=0x00"  I've been searching the web for a solution, but nothing stands out yet.

Has anyone else had this problem with Bluetooth and the Arduino IDE?
Logged

Värmland, Sweden
Offline Offline
Sr. Member
****
Karma: 9
Posts: 262
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't think your bluetooth module has a DTR pin which is needed for the autoreset to work during programming.

You might get lucky if you press reset manually during upload.
You're supposed to reset the board when the sketch size is reported in the IDE and you will mostly likely need to try a couple of timnes before you get it right.
The easiest way is to hold down the reset button when you strat the upload from the IDE and you release the rest button when the sketch size appears.
Logged

Rapa Nui
Offline Offline
Edison Member
*
Karma: 60
Posts: 2071
Pukao hats cleaning services
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://blog.iteadstudio.com/warless-program-your-iteaduino-bt-2/

Works fine with mine, I am using 100nF capacitor there and 115k2 speed (uno)..
« Last Edit: January 18, 2013, 07:13:25 am by pito » Logged

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

I am getting the same problem with upload.
Logged

British Columbia, Canada
Offline Offline
Newbie
*
Karma: 2
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

perhof:  You may be right.  The only pin it has that I cannot understand is the "CLR" pin.  I'm not quite sure what it does, but it does not work the same way as the DTR pin on my USB to TTL.  Any ideas?

Pito, thanks for that link.  I went over that, and I'm not sure your adapter has the same firmware as mine.  I looked through my adapter's manual, and pin 32 is only labelled as "programmable I/O".  Perhof may be right, my adapter may not allow DTR, so I will need to buy another Bluetooth adapter if I want to upload sketches.  I wonder, is there any way to test if PIN32 on my Bluetooth adapter functions as DTR?  It's so tiny and I'm afraid to solder anything.
Logged

Värmland, Sweden
Offline Offline
Sr. Member
****
Karma: 9
Posts: 262
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

perhof:  You may be right.  The only pin it has that I cannot understand is the "CLR" pin.  I'm not quite sure what it does, but it does not work the same way as the DTR pin on my USB to TTL.  Any ideas?

You could use manual reset as I described earlier. It's not hard when you get the hang of it.
Mayb not so pretty but at least it would allow you to upload your code.
Logged

British Columbia, Canada
Offline Offline
Newbie
*
Karma: 2
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

perhof, I tried the manual reset in different combinations for about half an hour with no success.  My last attempt will be to find a way to test the dtr solder point on the bluetooth module to see if it does anything, and if not, I'll order a more expensive bluetooth adapter that is known to work.  thanks for your advice.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 69
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Where I work we have an assembly line that reaches a point where the embedded devices (some of which come from different manufacturers depending on the customer specs) in our product need to be programmed. We use a bluetooth device that is fairly common in our industry to program them (since the assembly line is moving it is easier than having wires hanging from the ceilings). 80 percent of the time I'd say it goes without a hitch, but one particular vendor's firmware fails to program much more than another's. We think it may have something to do with it not handling a interruption in programming very well or maybe it tries way too hard to handle an interruption in programming, we're not sure.  They also make a diagnostic program that is used after the entire product is assembled and stress tested. This diagnostic program also can use the same bluetooth device as the other part and it also seems to struggle mainly on the initial connection and once connected it seems to hold it steady.

I guess it is to be expected.  At any given time we could have up to 20 of those devices in use along with several wifi networks used for computers and other devices.

As always when dealing with wifi or bluetooth issues, I recommend eliminating all sources of interference, portable phones, other networks, etc.
Logged

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

Hi Gordon

Could you please share your connection setup from the arduino to the bee and your code?

Other bluetooth device to arduino/bee works the other way round not.

And yeah, I have to plug out the bee whenever I want to upload a new sketch...

Thanks
Logged

Rapa Nui
Offline Offline
Edison Member
*
Karma: 60
Posts: 2071
Pukao hats cleaning services
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

DTR,CTS, RTS signals do not work with those BT modules. The mod described in the link I posted sets the I/O port to toggle when the connection is initiated. That is supported by IDE 1.5+.  It works. p.
Logged

British Columbia, Canada
Offline Offline
Newbie
*
Karma: 2
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Partial success.  I have been able to program my Ardweeny using my Bluetooth module, using manual reset method.  The trick is to press and hold the reset button, and let go the moment the connection LED on the bluetooth module goes from flashing to solid.  Works every time.

In other news, the manufacturer of the Bluetooth module got back to me, and said it does support DTR on pin 25 (PIO2) of the module.  I have been experimenting with this, with so far no successes.

I have downloaded the latest beta IDE, and will soon be attempting Pito's work around.  I'll post my progress here.
Logged

Pages: [1]   Go Up
Jump to: