Bluetooth Serial Port To NXT in OSX 3

Posted by Tony Buser Sun, 22 Oct 2006 21:14:00 GMT

Some people have been confused as to how to use ruby-nxt in OSX. Some of the confusion was that I had posted instructions which only allowed connection FROM the nxt to the mac where the mac is the slave. To use ruby-nxt you need to initiate a connection from the mac to the NXT where the mac is the master. Here's some "simplified" step by step instructions:

  1. Turn on the NXT and make sure bluetooth is turned on. (you should see a bluetooth icon at the top left corner)
  2. Click the bluetooth icon in the menubar, select "Setup bluetooth device".
  3. When it asks for Select Device Type, choose "Any device".
  4. Select the NXT from the list, click continue.
  5. The nxt will beep and ask for a passkey, choose 1234, press orange button.
  6. click continue in osx, enter 1234.
  7. The NXT will beep again, press orange button to use 1234 again.
  8. The mac will complain "There were no supported services found on your device". Don't worry about that and click continue and then click Quit.
  9. In OSX click the bluetooth icon, select "Open bluetooth preferences", you should see the NXT listed, select it, then click "Edit Serial Ports".
  10. It should show NXT-DevB-1, if not click add, use Port Name: NXT-DevB-1, Device Service: Dev B, Port type: RS-232. Click Apply.
  11. You're done! You should now have a /dev/tty.NXT-DevB-1
Trackbacks

Use the following link to trackback from your own site:
http://juju.org/articles/trackback/514

Comments

Leave a response, Track co.mments

  1. Avatar
    Brian Marick Tue, 05 Dec 2006 01:35:03 GMT

    Newbie question. I've followed the above instructions successfully. I've tried to compile ruby-serialport--0.6 (OSX 1.4.8, Macbook, with developer tools installed), but I get this:

    $ ~/Desktop/downloads/ruby-serialport-0.6 548 $ ruby extconf.rb checking for OS... darwin checking for termios.h... no

    have_header: checking for termios.h... -------------------- no

    "gcc -E -I. -I/opt/local/lib/ruby/1.8/i686-darwin8.8.1 -I. -O -pipe -I/opt/local/include -O -pipe -I/opt/local/include -fno-common -pipe -fno-common -Ddarwin conftest.c -o conftest.i" checked program was: /* begin */ 1: #include /* end */

    There doesn't seem to be a termios.h anywhere on the system, though there is a "man 4 termios". Darwinports 'port info' doesn't show anything obvious.

    Hope you can help. The NXT environment on this macbook is s-l-o-w and I frankly think my daughter would like Ruby better.

  2. Avatar
    Tony Buser Tue, 05 Dec 2006 02:39:42 GMT

    Seems as though you might not have all the osx developer tools installed. It should be at /Developer/SDKs/MacOSX10.4u.sdk/usr/include/termios.h

  3. Avatar
    Brian+Marick Tue, 05 Dec 2006 05:52:55 GMT

    Oops. I rebuilt this machine over the weekend and, um, forgot to install the developer tools. After that, extconf.rb found termios.h. ld found setregid in both /opt/local/lib/libruby.dylib(process.o) and /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../libpthread.dylib(setregid.So), so I removed /opt/local/lib from the path. After that, things appear to work.

Comments