Bluetooth Serial Port To NXT in OSX 3
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:
- Turn on the NXT and make sure bluetooth is turned on. (you should see a bluetooth icon at the top left corner)
- Click the bluetooth icon in the menubar, select "Setup bluetooth device".
- When it asks for Select Device Type, choose "Any device".
- Select the NXT from the list, click continue.
- The nxt will beep and ask for a passkey, choose 1234, press orange button.
- click continue in osx, enter 1234.
- The NXT will beep again, press orange button to use 1234 again.
- 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.
- In OSX click the bluetooth icon, select "Open bluetooth preferences", you should see the NXT listed, select it, then click "Edit Serial Ports".
- 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.
- 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
Juju
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.
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
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.