ArduinoBT on Mac OS X Leopard

okay, the strange thing is: I can connect to Arduino BT from my Mac running "Mobile Processing" with MPowerPlayer and AvetanaBluetooth. I have a nice serial connection and everything works wonderful! No errors so far!

So, the connection results on my system so far:

| Arduino 010 | NO | | - | - | | AVRDude via Terminal | NO | | Xterm | NO | | MPowerPlayer + AvetanaBluetooth | YES |

Just a guess: the most obvious difference in the list is that MPP/Avetana is incredibly slow (timing issue with pairing/authentification?)

Still having troubles to connect from my phone (SE k800i), but I don't know yet if it's just a bug in my software. I'll keep you updated -

Best, Michael

I have the same problem. I really want to solve this, if it ends up that this iteration of ArduinoBT will never work on Leopard, that's £60 down the pan. They should really put a warning to leopard users up on tinker.it for now.

I compiled the latest Arduino source from svn. I noticed that the code has already been modified not to flush the serial buffer unless specifically stated in the preferences (which by default, it isn't). It locks up my computer. Can't quit arduino. I have to actually turn off my computer to stop it running. The process (when I open terminal and type ps aux) that can't be terminated is avrdude.

So, I tried to upload some code directly using avrdude. This is the command line options (note: you need to use -C to specify where your avrdude.conf is, and the -v -v -v for extra verbosity)

$ /Applications/arduino-0011/hardware/tools/avr/bin/avrdude -C/Applications/arduino-0011/hardware/tools/avr/etc/avrdude.conf -p m168 -b 115200 -c stk500v2 -P /dev/tty.ARDUINOBT-BluetoothSeri-1 -e -U flash:w:/Standard_Firmata.hex -v -v -v

When I run it, the little red light in the bluetooth system preferences goes green, indicating that it's connected. Check the next post for the output!

Thanks,

Marek

avrdude: Version 5.4-arduino, compiled on Oct  9 2007 at 11:20:31
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         System wide configuration file is "/Applications/arduino-0011/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/marek/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port            : /dev/tty.ARDUINOBT-BluetoothSeri-1
         Using Programmer      : stk500v2
         Overriding Baud Rate  : 115200
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_2_ReceiveMessage(): timeout
... about 50 of these
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
         AVR Part              : ATMEGA168
         Chip Erase delay      : 9000 us
         PAGEL                 : PD7
         BS2                   : PC2
         RESET disposition     : dedicated
         RETRY pulse           : SCK
         serial program mode   : yes
         parallel program mode : yes
         Timeout               : 200
         StabDelay             : 100
         CmdexeDelay           : 25
         SyncLoops             : 32
         ByteDelay             : 0
         PollIndex             : 3
         PollValue             : 0x53
         Memory Detail         :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65     5     4    0 no        512    4      0  3600  3600 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65     6   128    0 yes     16384  128    128  4500  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel STK500 Version 2.x firmware
         Programmer Model: Unknown
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_2_ReceiveMessage(): timeout
etc...

every once in a while I get

avrdude: stk500v2_getsync(): timeout communicating with programmer

:DI can get a serial connection to the arduino by typing screen /dev/tty.ARDUINOBT-BluetoothSeri-1 I can send it commands (it had SimpleMessagingSystem from before)

So, it's not that a serial connection can't be established, it's something up with what avrdude is doing. All the information about the arduino board is in avrdude.conf so it could be just not connecting at all. I'm trying to install the latest avrdude to see if that makes a difference. (There's one on darwinports that says it's for leopard)

Hi,

nice good to see so many people trying to find a solution :) I agree about avrdude, seems suspicious indeed...

I'm trying to install the latest avrdude to see if that makes a difference. (There's one on darwinports that says it's for leopard)

I already tried with avrdude 5.4 and 5.5. (see posting somewhere before). It had exactly the same results... And I haven't succeeded in connecting via screen cmd either (same error, "already in use" or "port busy"). Only thing working here besides the Win-PC is MPowerPlayer emulation with Avetana.

But I got one more theory: I stumbled upon a problem when I tried to communicate with my phone (see this topic). The WT11 (BT chip on the Arduino BT) is configured to broadcast the SPP (Serial Connection Protocol) with the UUID 0x1101 ... Now this is a very common UUID and if there are probably other services on the phone (and on the computer!) broadcasting this UUID (eg DUN), which may cause interferences. In other words: The Arduino BT can be detected, but not it's SPP, because the nearer SPPs have a stronger signal and are detected first.

Could it be (even if I can connect from the emulator), that maybe this UUID is the root of all problems? I mean uploading from the PC isn't very straightforward as well, it needed some trials before it actually worked... I try to test this as soon as I got my ISP...

Best, Michael

avrdude 5.5 didn't make a difference. I also tried fiddling with the options of avrdude, changing the baud rate to 9600: nothing, changing the programmer from a stk500v2 to a stk500, this did something weird, but it didn't work.

mrkbrz: Does the same lock-up happen with Arduino 0010? I've been testing Arduino 0011 (without the auto-flushing) on my Leopard (10.5.2) machine and it works fine. What version of 10.5 do you have?

Also, with avrdude you should be using stk500v1 (which is the same as stk500) not stk500v2. Try a baud rate of 19200.

mellis! thanks for the suggestion, but alas, if only it were that easy. The Arduino IDE is set to upload using stk500v2 on the BT boards, and also I read somewhere that the BT only works at 115200 baud, but I tried it anyway.

This is what I typed into the console:

$ avrdude -C/Applications/arduino-0011/hardware/tools/avr/etc/avrdude.conf -p m168 -b 19200 -c stk500v1 -P /dev/tty.ARDUINOBT-BluetoothSeri-1 -e -U flash:w:/Standard_Firmata.hex -v -v

This is the output I got:

avrdude: Version 5.5, compiled on Mar  7 2008 at 14:35:13
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         System wide configuration file is "/Applications/arduino-0011/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/marek/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port            : /dev/tty.ARDUINOBT-BluetoothSeri-1
         Using Programmer      : stk500v1
         Overriding Baud Rate  : 19200
         AVR Part              : ATMEGA168
         Chip Erase delay      : 9000 us
         PAGEL                 : PD7
         BS2                   : PC2
         RESET disposition     : dedicated
         RETRY pulse           : SCK
         serial program mode   : yes
         parallel program mode : yes
         Timeout               : 200
         StabDelay             : 100
         CmdexeDelay           : 25
         SyncLoops             : 32
         ByteDelay             : 0
         PollIndex             : 3
         PollValue             : 0x53
         Memory Detail         :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65     5     4    0 no        512    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     16384  128    128  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
         Hardware Version: 2
         Firmware Version: 1.15
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.11s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

Device signature null! I tried the -F option, and that locks up my computer. I wasn't getting any kind of lock. I can't remember exactly what I was doing but, yes, it locked up with Arduino 10 (I might have fiddled with some stuff first, but I don't think so)

The upload should be using stk500 (v1) - that's what it's set to in the boards.txt and that's what the bootloader expects. (We don't use any stk500v2 bootloaders.) The communication between the ATmega168 on the Arduino board and the BT module has to happen at 115200 baud. The communication between the computer and the BT module can be at any baud rate (or at least you can specify any baud rate - I'm not sure if the value is actually used or not).

In any case, can you post the output you get if you use the command line you posted but add two more -v 's (so there are four total)? (Without the -F). It should show every byte that goes back and forth, which might help us figure out what the problem is.

Are you using the avrdude that comes with the Arduino? It has a patch to allow to properly read the device signature from our bootloaders.

I don't know what happened, but it's mysteriously working now (in Arduino 11) actually in the IDE itself... I can't think of what might have caused it to suddenly start working?! It works every time, and serial comms work fine with the board with processing and pd. I found the reference to stk500v2 in avrdude.conf, so that's why I was using it. Like I said though, it finally worked through the IDE. Magic.

Weird. Bluetooth is definitely mysterious. Still, I'm glad you got it working.

I feel guilty that it works for me, but didn't actually find a problem. Thanks anyways!

I wonder: how did you compile the Arduino 11 source - on Leopard?

Because I’m having troubles with that (tried two SVN checkouts some days ago and just now); in Xcode3 I get a JamTool error; and Xcode2.5 tells me that it’s not supporting JamTool Apps in Mac OS X 10.5.

Mkdir /Volumes/T'Pol/Arduino/Arduino-0011-src-388/build/macosx/build/Arduino.build/work/App.build/DerivedSources 
...failed JavaCompile.default <CompileJava>Arduino.app ...
...skipped <DeriveAndCompileSources>Arduino.app for lack of <CompileJava>Arduino.app...
(...)

is there a precompiled binary available somewhere… maybe? ::slight_smile:

Best,
Michael

Have you got the whole error message? It might be because of that apostrophe in your hard disk name (T'Pol) that's kicking up a fuss. I just downloaded the source through svn then pressed the hammer button in XCode. I don't know which version of XCode I had, but it was probably the latest one. Maybe try compiling it on your main hard disk?

Failing that, PM me and I'll email you my Arduino 11 folder all zipped up.

:D

oh, indeed, I should have known that it's a bad idea to have an ' in the path... thank you v much! (and sorry for overseeing the obvious)

...though I don't seem to have the same luck as you with Arduino 11, still the same errors ,(

Regards, Michael

I never found a good solution for the BT on Arduino 0010 but it works fine for me with the pre-release of Arduino 0011. See http://tinker.it/now/2008/03/18/making-sense-of-the-arduino-bt-and-mac-os-x-leopard/

//erik

Hallo, I'm still trying to get the Arduino BT board start transmitting data without the need of resetting it just before opening the serial transmission. I'm not talking about uploading sketches, even reading data from the BT board is impossible without resetting it... If I don't reset the board, on OSX the BT symbol in the topright Finder toolbar doesn't change to active, and I get the usual "port already in use by another application" exception... I need to use the BT board in outdoor installations, making it impossible to reach them by hand to press the onboard reset button.

Last year I posted this procedure to the forum, and still have found no better ways to get data from the BT board to Max/Msp: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1185415792/7#7

1) Power the Arduino BT board 2) Open Arduino IDE, configure Board (Arduino BT) and Port (both CU-TTY work for me) 3) Open Serial Monitor and IMMEDIATELY hardware reset the BT board, 4) ONLY when the connection is estabilished and working (you see by the BT symbol in the topright bar changing to connected, and if you have some "println" in your sketch, you should see the numbers flowing in the Serial Monitor window) open Max/msp and start serial reading, then stop Arduino Serial Monitor. This is the only procedure working 100% for me.

If I try to start reading serial data directly from Max, it seems that the board doesn't manage to connect, while if I try to read data from Arduino Serial Monitor without resetting the board just after pressing the Serial Monitor button, I get an error about board being already in use by another application.

Wouldn't be possible to embed some auto-reset command in the BT sketches or firmware when the serial port is open by the computer, so that when you want to start serial readings the board reset itself and can start trasmitting data? I've read all the forum posts about this but can't find anything helpful. I'm no programmer or electronic engeneer, so apologize in advance if this is a stupid request, thanks, kk

It works!!!! ;D ;D ;D ;D thanks a lot you guys save my day

kk: have you tried resetting the BT module from within your sketch? There's an example here: http://www.arduino.cc/en/Main/ArduinoBTInitializationSketch.

i am still having trouble connecting the Arduino BT to my MacBook?? it just never wants to read the device. i have read the all the posts above but i still seem to be doing something wrong any suggestions???