Pages: 1 [2] 3 4   Go Down
Author Topic: ArduinoBT on Mac OS X Leopard  (Read 4386 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi Michael,
I also have had no luck with the possible solutions listed here for leopard. I'm still following the thread hoping for fix.
smiley-sad
Jeff
Logged

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

Hello

I've noticed that since leopard was introduced a lot of people have had problems with the BT board.

We are looking into it and (as tinker.it) we are experimenting with other BT modules to be used in future versions of the board (I would like the board to cost less money and be easier to use)

we'll let you know what we find out

m

Logged

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

to auco:


the source is always available :
see the "source code" section of http://www.arduino.cc/en/Main/Software

how to upload to the board via the command line:
/Applications/arduino-0010/hardware/tools/avr/bin/avrdude -p m168 -b 115200 -c stk500v2 -P /dev/tty.ARDUINOBT -e -U flash:w:yourfile.hex

/dev/tty.ARDUINOBT is your bluetooth board while yourfile.hex is the hex file generated by arduino.
(you can find it in /tmp/buildXXXXX where XXXX changes for every sketch... this is where arduino compile the code when you hit the "compile" button)





« Last Edit: March 03, 2008, 01:56:08 pm by admin » Logged

0
Offline Offline
God Member
*****
Karma: 0
Posts: 731
skcor oniudrA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

"Busy" seems to be the common denominator, and that's regardless of which version of OSX since I got the same on 10.3.9.

I solved that, by replacing "every instance" of the RXTX library with the one supplied in 10. Scattered around the drive, I found 8 instances, replaced them all with the version from 10 (I could have deleted them but didn't for just in case sake).

It didn't fix the problem until I rebooted the machine, but I only discovered that by accident when a brief power outage caused a reboot.

So, anyone that's experiencing a similar problem, once you've replaced RXTX "everywhere" try rebooting the machine.

  
Logged

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

Thanks for all the answers!  smiley

I made some more tests with my WinXP-Laptop. At first I had similar problems as Brenin - Arduino010 freezed on upload until I manually killed the avrdude process or I got a "not in sync" error message. I tested the suggested reset methods before upload - and then after some failures it worked!  smiley-grin

After this discovery I switched back to the mac, checked the running processes and found four avrdude zombie processes, which couldn't be terminated.

So I restarted, downloaded, compiled and tested various avrdude versions (the one included in Arduino010, 5.4 and 5.5; called from terminal), but I keep getting the same error messages "ser_open(): can't open device "/dev/tty.ARDUINOBT-BluetoothSerial": Resource busy".
In contrast, I'm now getting "Port in use" when I try to upload from Arduino010 (Mac)...

So, my conclusion for this evening:

- I really don't think it has anything to do with the RXTX library, because AFAICS there is no Java involved when I try to upload the hex file with avrdude via bash terminal.

- I don't think setting write permissions in "/var/" helps either, I rather guess the people who tried this had some luck, maybe it works on the mac as well from time to time?

- I guess the error is either avrdude or (somewhat more likely) there's something wrong with the timing of the authorisation process; sometimes there's an alert box saying (translated): "Couldn't open any RFCOMM channel. Please check if the identification of your device has to be activated".
In these cases, there's an established connection, but the "Serial port '/dev/tty.ARDUINOBT-BluetoothSerial' [is] already in use"

The next thing I'll try is to upload a program which sends some data, and see if I'm able to communicate with a phone app; I'll keep you updated on this...

Best,
Michael
Logged

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

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 010NO
AVRDude via TerminalNO
XtermNO
MPowerPlayer + AvetanaBluetoothYES

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
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
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
Code:
avrdude: stk500v2_getsync(): timeout communicating with programmer
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 :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)
« Last Edit: March 07, 2008, 08:36:07 am by mrkbrz » Logged

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

Hi,

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

Quote
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
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.  
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
Code:
$ 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:
Code:
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)
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: March 08, 2008, 04:14:33 pm by mrkbrz » Logged

Pages: 1 [2] 3 4   Go Up
Jump to: