-
Notifications
You must be signed in to change notification settings - Fork 41
Bluetooth OSX Tutorial
This tutorial is how to add the ArcBotics serial bluetooth module to a Mac OS X computer. Basic tutorial taken from experiences with OS X 10.8.2
First make sure that the red LED on the Bluetooth board is blinking. If it is not you will need to remove power from the Hexy, connect power to the board to get the CPU started, then apply power to the servo power connector. Power can be disconnected from the other power connector. I use a 9 volt alkaline battery for this.
-
Open "System Preferences" and select "Bluetooth". If there are no devices yet set up, a "setup new device"button will be present.
Otherwise click the "+" button and select "setup new device". Either way will bring up the "Bluetooth Setup Assistant" dialog that will automatically search for Bluetooth devices and display those that it can find.
-
Select the "ArcBotics" device and click the "Continue" button.
System should automatically cycle through "0000" pairing and conclude with a successful pairing.
-
Click the "Quit" button and return to the Bluetooth "System Preferences" dialog where you will see the ArcBotics device shown as "not connected".
-
Select the "ArcBotics" device and click the pulldown arrow next to the "gear" icon, near the lower left corner of the dialog, and select "Edit Serial Ports...".
This should bring up a dialog whose content is grayed out and then will automatically select the RS-232 protocol and properly name the device and set the "Service" to "Dev B".
Modify the name if you wish and click the "Apply" button.This will return you to the "Bluetooth" system preferences dialog where the device should be listed as "Connected".
-
Open a serial application and select the given port to communicate with the Bluetooth device. PoMoCo should automatically use this device if the USB cable is disconnected.
-
If you type a capital letter V into the screen window, your Hexy should respond with the Servotor32 version being run.
You could setup the following script to use terminal as described at http://hints.macworld.com/article.php?story=20061109133825654
The following instructions are basically what they say to do with appropriate substitutions:
- First, launch "AppleScript Editor" application from your "Utilities" folder and type/paste in the following code:
tell application "Terminal"
do script with command "screen /dev/tty.ArcBotics-DevB 9600"
set number of rows of window 1 to 100
set number of columns of window 1 to 80
set background color of window 1 to "white"
set normal text color of window 1 to "black"
set custom title of window 1 to "ArcBotics Bluetooth Serial"
end tell- Compile and save as an app from within Script Editor, and you have a double-clickable application to launch a serial Terminal session.
Note that screen uses Control-A to take commands directed to it. So type Control-A followed by Control-\ to exit your screen session. If you fail to do this and exit a Terminal session, you'll leave the screen session alive and the serial resource unavailable until you kill the screen session manually. man screen will show you further commands to send to a screen session.
I added display alert "Use ^A^\ to terminate screen session when done" on a new line after the "end tell" statement to remind me of this.






