Go Down

Topic: ArduinoBT 'Programmer not responding' problems (Read 2822 times) previous topic - next topic

monkeyhelper

Hi,

I've recently purchased the ArduinoBT and I'm having problems trying to upload sketches to it.  I'm using Linux (Ubuntu Feisty) and have successfully paired with the ArduinoBT but each time I try to upload a sketch I get the error 'Programmer not responding'.  I've modified my arduino preferences (see below for file contents).  When I start the arduino java program I select the 'atmega168' microcontroller.  To pair with the board I followed these steps :

me@dexter:~/docs$ hcitool scan
Scanning ...
       00:07:80:82:AA:AA       ARDUINOBT

sudo gedit /etc/bluetooth/rfcomm.conf

<snip>
rfcomm3 {
       bind yes;
       device 00:07:80:82:AA:AA;
       channel 1;
       comment "ArduinoBT";
       }
</snip>

Then to initiate the BT connection :

me@dexter:~/docs$ sudo rfcomm connect 3
Connected /dev/rfcomm3 to 00:07:80:82:AA:AA on channel 1
Press CTRL-C for hangup

This then seems to have connected successfully.  Next I start the arduino java app and select the atmega168 and try to upload a sketch (press reset and then upload sketch), I then see the following in the log :


Binary sketch size: 4220 bytes (of a 14336 byte maximum)
uisp -v=4 -dpart=atmega168 -dprog=stk500 -dserial=/dev/rfcomm3 -dspeed=19200 --upload if=/home/me/arduino/sketch_070530a/applet/sketch_070530a.hex

Transmit: { 0 [30]   [20] }
Programmer is not responding.

I've tried this numerous times with no success.  I'm at a loss as to how this should work, I have specified the serial port (/dev/rfcomm3), serial upload speed (115200) and microcontroller (atmega168) - I also have an arduinoNG board that works fine, can anybody suggest what I'm missing ?


My preferences file looks like :

editor.literal2.style=#cc0000,plain
console.output.color=#ccccbb
editor.external.bgcolor=#168299
preproc.web_colors=true
editor.font.macosx=Monaco,plain,10
sketchbook.auto_clean=true
bootloader.unlock_bits=0xFF
update.check=true
last.sketch.path=/home/me/arduino/sketch_070530a/sketch_070530a.pde
default.window.width=500
editor.fgcolor=#000000
update.id=-8492366894602967408
editor.indent=true
serial.stopbits=1
serial.databits=8
editor.literal1.style=#cc0000,plain
editor.font=Monospaced,plain,12
build.extension=c
bootloader.path=bootloader
preproc.jdk_version=1.1
editor.divider.size=0
editor.brackethighlight=true
serial.download_rate=19200
#serial.download_rate=115200
default.window.height=600
last.divider.location=424
editor.caret.blink=true
preproc.color_datatype=true
header.text.font=SansSerif,plain,12
preproc.output_parse_tree=false
status.error.bgcolor=#662000
run.window.bgcolor=#c4c4c4
console.lines=4
header.text.unselected.color=#ffffff
console.error.file=stderr.txt
editor.tabs.expand=true
editor.keyword3.style=#993300,bold
upload.verify=false
parallel.port=0x378
buttons.status.color=#FFFFFF
editor.selection.color=#ffcc00
run.window.height.minimum=120
buttons.status.font=SansSerif,plain,12
console=true
serial.parity=N
editor.tabs.size=2
linestatus.height=20
console.length=500
last.window.y=84
console.font.macosx=Monaco,plain,10
last.window.x=390
history.recording=true
serial.port=/dev/rfcomm3
run.options=
status.font=SansSerif,plain,12
editor.eolmarkers.color=#99991A
console.auto_clear=true
status.error.fgcolor=#ffffff
build.verbose=false
linestatus.color=#ffffff
editor.label.style=#7E7E00,bold
editor.comment2.style=#777755,plain
editor.keyword2.style=#996600,plain
console.color=#000000
run.present.bgcolor=#666666
last.window.height=600
editor.eolmarkers=false
console.output.file=stdout.txt
preproc.substitute_unicode=true
editor.linehighlight=true
run.present.stop.color=#cccccc
status.prompt.bgcolor=#cc9900
editor.keyword1.style=#cc6600,plain
editor.external=false
last.screen.height=768
last.window.width=500
bootloader.high_fuses=0xca
upload.erase=false
editor.linehighlight.color=#ddddbb
linestatus.font=SansSerif,plain,10
upload.programmer=stk500
preproc.substitute_floats=true
editor.comment1.style=#777755,plain
build.target=arduino
editor.brackethighlight.color=#000000
status.notice.fgcolor=#ffffff
browser.linux=mozilla
editor.caret.color=#333300
editor.invalid=false
serial.debug_rate=9600
editor.operator.style=#000000,plain
settings.path.fallback=data
browser=mozilla
sketchbook.path=/home/me/arduino
bootloader.low_fuses=0xdf
editor.invalid.style=#7E7E00,bold
editor.bgcolor=#ffffff
preproc.imports.jdk14=javax.xml.parsers,javax.xml.transform,javax.xml.transform.dom,javax.xml.transform.sax,javax.xml.transform.stream,org.xml.sax,org.xml.sax.ext,org.xml.sax.helpers
export.library=false
preproc.imports.jdk13=javax.sound.midi,javax.sound.midi.spi,javax.sound.sampled,javax.sound.sampled.spi
build.mcu=atmega8
sketchbook.prompt=false
preproc.imports.jdk11=java.applet,java.awt,java.awt.image,java.awt.event,java.io,java.net,java.text,java.util,java.util.zip
header.text.selected.color=#1A1A00
console.font=Monospaced,plain,11
upload.maximum_size=7168
editor.divider.size.windows=2
build.f_cpu=16000000L
preproc.enhanced_casting=true
sketchbook.path.fallback=sketchbook
status.prompt.fgcolor=#000000
serial.burn_rate=115200
run.display=1
run.window.width.minimum=120
bootloader.programmer=stk500
editor.antialias=false
bootloader.file=ATmegaBOOT.hex
upload.verbose=true
bootloader.lock_bits=0xCF
console.error.color=#ff3000
preproc.save_build_files=false
last.screen.width=1280

Daniel

hi

Quote
uisp -v=4 -dpart=atmega168 -dprog=stk500 -dserial=/dev/rfcomm3 -dspeed=19200 --upload if=/home/me/arduino/sketch_070530a/applet/sketch_070530a.hex  


The defaullt speed for the connection to the BT is 115200; both the Bluegiga miodule and the Atmega168 in the BT are programmed at this speed.

D

monkeyhelper

#2
Jun 03, 2007, 08:46 pm Last Edit: Jun 03, 2007, 09:31 pm by monkeyhelper Reason: 1
Hi,

Thanks for that, I had tried that at some point and it hadn't worked but it's good to know thats what the setting should be.

Here's the output with dspeed set to 115200 (on rfcomm0 now) :

uisp -v=4 -dpart=atmega168 -dprog=stk500 -dserial=/dev/rfcomm0 -dspeed=115200 --upload if=/home/me/arduino/sketch_070529a/applet/sketch_070529a.hex

Transmit: { 0 [30]   [20] }
Programmer is not responding.


Any other ideas (or has anybody else had success connecting Linux to a ArduinoBT) ?


UPDATE :

I also attempted to update on the command line using avrdude :

avrdude -n -v -F -p atmega168 -P /dev/rfcomm0 -c stk500 -b 115200 -U flash:w:/home/me/arduino/sketch_070529a/applet/sketch_070529a.hex

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: ser_send(): programmer is not responding

So this results in a similar error which (I guess) means it's likely that there is an issue with the bluetooth connection as two separate tools have failed with the same error.

Anybody have any ideas about how to debug this any further ?

Daniel

hey

have you tried it on a working machine, perhaps a Mac? I'm thinking you could look at the log files, or at least see from t hat process what happens when it works, and then use that info to get it going in Liinux.    

D

monkeyhelper

Hi,

I've managed to get it working on my Mac Mini (Intel) just by setting atmega168 as the microcontroller and successfully uploaded the led blinker.  I'm wondering if there's some incompatibility in the linux/arduino bluetooth stacks as I haven't seen anybody report a successful BT serial upload with linux (or at least I haven't seen one reported on the forums) and I have successfully uploaded onto my ArduinoNG with the same machine.  I've also connected successfully to other devices over bluetooth and transferred files.  So, it's either a misconfiguration (unlikely as I've used two different apps - avrdude and uisp and I believe I have the settings correct now - thanks !), or a bug.

So I've either messed up the bluetooth connection setup in some way or there is a bug/incompatibility issue, any thoughts ?

Daniel

hey

sounds like you are close to having it solved. I taught a class with 35 BT's this spring, and the only recurring problem was upload difficulties on windows on high port numbers... could that be related to the problem you're having with the BT?

D

monkeyhelper

#6
Jun 03, 2007, 10:10 pm Last Edit: Jun 03, 2007, 10:43 pm by monkeyhelper Reason: 1
I think I've taken it as far as I can :(  My thoughts are :

me@dexter:~$ rfcomm show 0
rfcomm0: 00:10:C6:9A:AA:AA -> 00:07:80:82:AA:AA channel 1 connected [reuse-dlc release-on-hup tty-attached]

So I've definitely got a bluetooth connection initiated but I assume the 'programmer didn't respond' error means there is some miscommunication over the bluetooth serial connection.  I have the correct transmission speed set and the correct microcontroller type.  Having tried two applications for upload (uisp and avrdude) and both resulting in the same error certainly hints that there is a problem with the bluetooth communication.

I'm going to wait a few days to see if anybody posts to say they have successfully connected to an ArduinoBT board from linux (I guess people don't always report successes but it's a bit strange I can't find anybody who has managed to do this).  If it looks like nobody has managed then I'll see about raising some form of bug report.

Thanks for all the help.  


UPDATE: Oh yeah, I'm not sure about the high port issues but I'm currently set to /dev/rfcomm0 which is the lowest it can go so I don't expect it would be a problem.

marcosangalli

Hi,
I successfully uploaded the HEX file to ArduinoBT on Ubuntu Feisty
You have to configure and use the "rfcomm0" (I tried with higher port but it fails to upload)

Press reset button on ArduinoBT and upload the file (use uisp under tools folder):
./uisp -v=4 -dpart=atmega168 -dprog=stk500 -dserial=/dev/rfcomm0 -dspeed=115200 --upload if=<FILE.hex>

About sketch, you can create a symlink to ttyUSB0 like:
cd /dev
ln -s rfcomm0 ttyUSB0

Best Regards,
Marco Sangalli

JaimeV

Thanks marcosangalli!  :)  This works for me on Ubuntu Feisty.
After editing my rfcomm.conf file I am using rfcomm bind to connect to the ArduinoBT and then using the above instructions to upload a hex file to the board with uisp.

Unfortunately I am not sure how to receive serial communication from the ArduinoBT afterwards?  :(
I tried creating the symlink ln -s rfcomm0 ttyUSB0 and while ttyUSB0 now appears in both the Arduino IDE and Processing I cannot receive anything...

Any ideas?  :-?

marcosangalli

Hi,
open 2 console (A,B)

(A) rfcomm connect 0 (do not use bind)
(B) minicom -s

From console (B) setup serial port and speed, then exit the dialog and go to "EXIT" and press enter
Now you can test if serial works or not...

I will find a solution for sketch...

Regards,
Marco



JaimeV

:)  Hey I got serial communication to the sketch working by creating a symlink from /dev/rfcomm0 to /dev/ttyS* (substitute * for some number ttyS that is not being used) .

kabatwa

Hey, I think I'm having pretty much the same problem. Trying to connect my my USB Bluetooth to my ArduinoBT but getting the same errors. Is there anyway you could give any kind of tutorial on what you've done? I'm also running Feisty Fawn.
Thanks, Tim

JaimeV

Ok, I'm not completely satisfied with the following process but it is working consistently for me in Ubuntu Feisty 7.04 with Arduino-009.

First you want to make sure you have the bluetooth utilities installed in ubuntu.
Open a terminal and type:

sudo apt-get install bluez-utils

Plug in your usb bluetooth adapter and type:

hcitool dev   Lists local bt devices. You should see your adapter there.

Make sure your Arduino BT is powered up and type:

hcitool scan  Lists remote bt devices. You should see something like this:

Scanning ...        XX:XX:XX:XX:XX:XX       ARDUINOBT

Copy that address and then type:

sudo ln -s /dev/rfcomm0 /dev/ttyS4 Create a symlink from rfcomm0 to ttyS*, (doesn't have to be ttyS4, I just used ls /dev/ttyS* and looked for one that didn't exist.

sudo rfcomm connect 0 XX:XX:XX:XX:XX:XX 1  Create bluetooth serial port connection. You should see:

Connected /dev/rfcomm0 to XX:XX:XX:XX:XX:XX on channel 1
Press CTRL-C for hangup


Leave that terminal window open where you can see it. Now start the Arduino IDE. Select /dev/ttyS4 or whatever under the serial port menu. Write and compile your code.

When you're ready to upload... switch back to the terminal window and type CTRL-C to close the connection (When you press the RESET button on your board the connection will close after a few seconds anyway so this way is faster.

Press the reset button. Wait for the 3 flashes if you have an led on pin13 (about 2 seconds).

sudo rfcomm connect 0 XX:XX:XX:XX:XX:XX 1 immediately connect rfcomm0 again.

Quickly switch to the Arduino IDE and upload to your board. Thats's it. Hopefully you'll get the "Done uploading" message.  :)

You'll have to close the connection and open a new one everytime you reset the board. I wish I knew how to keep it from losing the connection. :-/  You'll also have to create the symlink again everytime you reboot.

lexthehex

I'm using Ubuntu Hardy Heron and a USB Bluetooth adaptor on my Athlon-based PC.  I too had a lot of problems uploading sketches to my Arduino BT, finding that it only worked once, and then I couldn't repeat it.  Thanks to the former message from JaimeV, I'm happy to say that it's working now, though I did things slightly differently:

1. I didn't make a symlink from /dev/ttyS4, but I edited ~/.arduino/preferences and set the serial preferences here:

Code: [Select]

serial.stopbits=1
serial.databits=8
serial.parity=N
serial.port=/dev/rfcomm0
serial.debug_rate=115200
serial.burn_rate=115200
board=bt


2. I used a 'bind' rfcomm command so I wouldn't need to keep reconnecting.

Code: [Select]

rfcomm bind rfcomm0 xx:xx:xx:xx:xx:xx 1

(replace 'xx:xx..' with your Arduino's bdaddr, as found with 'hcitool scan' or similar)

3. Start the Arduino IDE.  Don't worry if the Tools/Serial Port option only shows 'ttyS0' - rfcomm0 will be used if it's set in the preferences.  This bothered me a lot to start with, since I thought that the upload failures were due to it using ttyS0 (not the case).

4. Having loaded a sketch, click the Arduino BT board's 'S1' switch - click it briefly, release it, wait about a second.

5. Click the Upload button on the Arduino IDE window (the icon that looks like an arrow pointing to the right).

'Done uploading' should appear.

The timing of the pressing of the S1 button and the upload button is crucial - I found that if I was out by a second or two, that the board would not accept the upload.

Jesper R

I know this is an old post, but it seems like there are a lot of people out there having problems with uploading sketches to the Arduino BT.

One important thing i found out is that it fuckes up if you "connect" to the board using "rfcomm connect x" (where x is the number in your rfcomm.conf file). I have a blank rfcomm.conf file and just binds with the board using

jesper@mille:~$ sudo rfcomm bind rfcom0 00:07:80:90:51:0E 1

Where sudo might or might not apply to your computer setup.

Then rfcomm gives the following information:

jesper@mille:~$ rfcomm
rfcomm0: 00:07:80:90:51:0E channel 1 clean

and you are ready to upload your sketch. Just reset the board and upload using the stk500v1 programmer and 115200 as baud rate.

/path-to-arduino-dist/hardware/tools/avrdude -v -D -C /path-to-arduino-dist/hardware/tools/avrdude.conf -p atmega168 -P /dev/rfcomm0 -c stk500v1 -b 115200 -U flash:w:sketch.hex


Go Up