ArduinoBT on Mac OS X Leopard

Since our university chair switched all of its machines to Leopard noone seems to be able to upload programs to the ArduinoBT anymore. Uploading to usb-connected board still works and uploading from the few machines that still have Tiger works as well, it's just this one combination for which we can't find a solution. Is this a known issue and if yes is there anything to solve it? If you need any more infos, feel free to ask

Hmm, what happens when you try to upload?

Depends :slight_smile:
Arduino-0007 and 0008 usually just freeze and never come back to life
Arduino-0009 throws one of this two errors, depending on the reset-timing:

avrdude: ser_open(): can’t open device “/dev/tty.ARDUINOBT_609-Bluetooth-1”: Resource busy

Error inside Serial.()
gnu.io.PortInUseException: Unknown Application
at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354)
at processing.app.Serial.(Serial.java:127)
at processing.app.Serial.(Serial.java:72)
at processing.app.Uploader.flushSerialBuffer(Uploader.java:67)
at processing.app.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:69)
at processing.app.Sketch.upload(Sketch.java:1699)
at processing.app.Sketch.exportApplet(Sketch.java:1761)
at processing.app.Editor$42.run(Editor.java:1955)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
java.lang.NullPointerException
at processing.app.Serial.setDTR(Serial.java:480)
at processing.app.Uploader.flushSerialBuffer(Uploader.java:76)
at processing.app.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:69)
at processing.app.Sketch.upload(Sketch.java:1699)
at processing.app.Sketch.exportApplet(Sketch.java:1761)
at processing.app.Editor$42.run(Editor.java:1955)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

And arduino-0010 gives me the first one as well as this one:

processing.app.SerialException: Serial port ‘/dev/tty.ARDUINOBT_609-Bluetooth-1’ already in use. Try quiting any programs that may be using it.
at processing.app.Serial.(Serial.java:140)
at processing.app.Serial.(Serial.java:72)
at processing.app.Uploader.flushSerialBuffer(Uploader.java:66)
at processing.app.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:55)
at processing.app.Sketch.upload(Sketch.java:1632)
at processing.app.Sketch.exportApplet(Sketch.java:1701)
at processing.app.Editor$41.run(Editor.java:2004)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

Weird. I'll have to try it with my Leopard machine here and see if I can figure anything out.

I've got the same problem I think - I haven't been able to do anything at all with my ArduinoBT. I'm using MacOS Leopard on an Intel iMac with Arduino10.

The ArduinoBT will pair with the iMac, but it shows up as not connected - nothing I do seems to result in it connecting.

I'm usually getting the "ser_open(): can't open device...... Resource busy" error as Radioprotector's post, but sometimes it just hangs completely, and won't even force quit, so I have to physically power the iMac down.

I've spent a day on it now and got nowhere, really disappointing after using the excellent Diecimila especially as it costs so much. I'm on the point of giving up and trying to return the ArduinoBT.

I'm having identical problems on Leopard.. When I try to upload a sketch Arduino 0010 either goes into an unrecoverable freeze or gives me a "resource busy".

Btw, If I put a led on pin 13 it blinks with an uneven but rather high frequency. When I press the reset button the blinking stops for about a half second, resumes for about a second, stops again for about 10 seconds and then resumes to blink indefinitely...

Has anyone found a solution to this yet?

I dug around for a while earlier in the week and tried skipping the Arduino software and just using avrdude. I'm not very experienced with Arduino but it seems like it could work. I was copying the blink hex file:

avrdude -n -v -F -p atmega168 -P /dev/tty.feestaArduino-Bluetooth -c stk500 -b 115200 -U flash:w:Documents/Arduino/Blink/applet/Blink.hex

It basically gave me the same, failed results as using Arduino 0010. I tried searching(googling) for problems with using avrdude on Leopard to no avail. I'm stepping beyond my experience but wondered if the stk500 bootloader is a problem with bluetooth in leopard. I don't feel comfortable fiddling with that on my ArduinoBT. too pricey to break.

support for the bluetooth board is appreciated!

Same problem too, Arduino 10, except OSX10.3.9 and an Arduino connected to a Firefly.

Serial connect works fine in carbon and zTerm, but Arduino throws an exception (no other applications running except A10)

processing.app.SerialException: Serial port '/dev/cu.Bluetooth-Modem' already in use.  Try quiting any programs that may be using it.
      at processing.app.Serial.<init>(Serial.java:140)
      at processing.app.Serial.<init>(Serial.java:63)
      at processing.app.Editor.handleSerial(Editor.java:1485)
      at processing.app.EditorButtons.mousePressed(EditorButtons.java:373)
      at java.awt.Component.processMouseEvent(Component.java:5163)
      at java.awt.Component.processEvent(Component.java:4963)
      at java.awt.Container.processEvent(Container.java:1613)
      at java.awt.Component.dispatchEventImpl(Component.java:3681)
      at java.awt.Container.dispatchEventImpl(Container.java:1671)
      at java.awt.Component.dispatchEvent(Component.java:3543)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3527)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3239)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3172)
      at java.awt.Container.dispatchEventImpl(Container.java:1657)
      at java.awt.Window.dispatchEventImpl(Window.java:1606)
      at java.awt.Component.dispatchEvent(Component.java:3543)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:480)
      at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:184)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:170)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

I got Arduino running under Leopard thanks to a post on the Processing boards. Since Arduino relies on the Processing IDE, and that relies on the rxtx serial library, there are some permissions that need to be set. There's a script in 0010 that does this automatically, but it relies on tools that Apple removed in Leopard. Meanwhile, here's a fix copied from http://tinyurl.com/yojcf4:

  1. Under Finder click on the "Go" Menu
  2. Select "Go to Folder..."
  3. Type "/var/"
  4. Finder will open var folder.
  5. Right click on folder named "lock" and select "Get info"
  6. Open drop arrow titled "Sharing & Permissions"
  7. I set all privileges to: "Read & Write"
  8. Close Info
  9. Go to the Var folder on the finder and open the "spool" folder
  10. Right click on folder named "uucp" and select "Get info"
  11. Open drop arrow titled "Sharing & Permissions"
  12. I set all privileges to: "Read & Write"
  13. Close Info
  14. DONE

Hmm. I'm surprised that fixed it, because the RXTX library that comes with Arduino should have locking disabled. But, hey, if it works, it works.

I also found that I had better success uploading when I commented out the lines in the IDE that attempt to flush the serial buffer (using RXTX) before uploading the sketch (with avrdude). I'll try to incorporate this into Arduino 0011.

Hi,

  1. Right click on folder named "lock" and select "Get info"

There is no /var/lock/ folder on my Leopard System (10.5.2., G5 PPC) :-?

Same problems here, I cannot upload anything to my Arduino BT; the port seems to be "busy" all the time. Is there any Arduino-Processing 11 beta available yet?

Best, Michael

If you don't have /var/lock/

then:

in a terminal window do the following where % is your prompt

%sudo mkdir /var/lock/ password:

(when it asks for your password just type it in. This assumes you have administrative access.)

then do tigoe's steps.

Thanks for your reply, dgclogic.

Unfortunately, even after setting read&write permissions to var/lock and /var/uucp, and restarting both my pc and the ArduinoBT multiple times, I still get the same error when I want to upload the test program (Blink) to the Arduino BT:

When I try to upload, there's an immediate short BT-connection, and a spike in the power consumption of the board (from 0.04 to 0.10 A). About 1 second later, the connection is down again, and about 10 seconds without any BT activity, I get this error message in the Arduino-010 console: "avrdude: ser_open(): can't open device "/dev/tty.ARDUINOBT-BluetoothSeri-1": Resource busy"


I also tried to recompile the svn source to remove the serial flushing, but there's an error as well (in the unchanged source) : "unexpected EOF while looking for matching ''" in /bin/sh; resulting in the build error: "Command /Developer/Private/jam failed with exit code 1"

Sorry I'm not an experienced Java programmer, although I have some experiences in Cocoa / Obj-C programming. But I'm having difficulties here. Is it maybe possible to check out the last stable 010 version somewhere?

I'd really like to be able to upload my programs to the Arduino BT from the mac. Has anyone of you succeeded in the meanwhile? Or is this a general Leopard issue?

Thanks for any help,

Best, Michael

I had similar error in windows, can anyone help me solving it?

The problem is the following:

(Arduino 0010 and 0009)

Binary sketch size: 1108 bytes (of a 14336 byte maximum)

Error inside Serial.()

gnu.io.PortInUseException: Unknown Application

at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354)

at processing.app.Serial.(Serial.java:127)

at processing.app.Serial.(Serial.java:72)

at processing.app.Uploader.flushSerialBuffer(Uploader.java:67)

at processing.app.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:69)

at processing.app.Sketch.upload(Sketch.java:1699)

at processing.app.Sketch.exportApplet(Sketch.java:1761)

at processing.app.Editor$42.run(Editor.java:1955)

at java.awt.event.InvocationEvent.dispatch(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

java.lang.NullPointerException

at processing.app.Serial.setDTR(Serial.java:480)

at processing.app.Uploader.flushSerialBuffer(Uploader.java:76)

at processing.app.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:69)

at processing.app.Sketch.upload(Sketch.java:1699)

at processing.app.Sketch.exportApplet(Sketch.java:1761)

at processing.app.Editor$42.run(Editor.java:1955)

at java.awt.event.InvocationEvent.dispatch(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

It seens that the port is in use… (???)

Windows XP SP2
BT658 - V06

sorry Brenin, struggeling myself; it may make sense for you to open up a new topic, because this one is about Mac OS X Leopard and it's most likely that the cause of your troubles is something different: your log states "port in use", while I get "Resource Busy". The "Port in use" info normally indicates that there's really something using the port, so you should make absolutely sure to exit any program that might possibly use your BT connection, incl. autostart programs.


I'm honestly sorry if I seem impatient, ::) but I just tested everything again, now on my PowerBook (also 10.5.2, PPC) and I get exactly the same results as on the G5! "Resource busy"... so it seems I won't sleep well again, until I know if - -> anyone has succeeded in uploading programs to Arduino BT with Leopard on a PPC machine? -> it is possible to download the Arduino Processing 010 source (stable) somewhere, so that i can compile it disabling the serial flush? -> there is any reference how to possibly upload programs alternatively, eg. manual hex-upload with Xterm?

so thanks a lot in advance to anyone responding! Cheers, Michael

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. :( Jeff

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

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)

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

Thanks for all the answers! :)

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! :D

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