MacOSX Setup

From IPRE Wiki
Jump to: navigation, search

Package Installer

If you are running Mac OS X 10.5 then you need only install the below items. If you are running Mac OSX 10.6, the package installer WILL NOT WORK, see the detailed directions below!

  1. Download and install Python 2.5 for Macintosh OS X in the default location.
  2. Download and install media:MyroInstaller.dmg.
  3. Download and install Numpy.
  4. Download and install PIL.
  5. Upgrade Myro:
    1. In a terminal (found in Applications->Utilities->Terminal), type:
$ sudo python
>>>from myro import *

Now go to Applications->MacPython->IDLE to run Python. This is the same interpreter that you have been using in class.

There is also an installer that contains all of the Myro packages, but Numpy does not work yet, and PIL may not.

  1. Download Myro Mac OS X Package.

This installer will NOT work on Mac OSX 10.6, and will make things worse! Instead, use the BETA 10.6 install zip file found below!

Note: TkSnack does not work on Mac OS X.

Afterwards, follow the directions (below) to pair your computer's Bluetooth with the robot.

Setup Bluetooth

  1. Attach the IPRE Fluke to the scribbler
  2. Turn on the scribbler
  3. Click on the bluetooth icon in the upper right of your toolbar, select "Set up Bluetooth Device"
  4. Follow the wizard, select "Any device" as the device type
  5. Select the IPRE-XXXXXX where XXXXXX is your Fluke's serial number
  6. Enter the Passkey/PIN code (1234)
  7. From the bluetooth menu in the toolbar select "Open Bluetooth Preference"
  8. Highlight the IPRE bluetooth connection name
  9. Select Edit Serial Ports (little gear picture)
    1. Add a serial port to the Fluke via the "+" button if you don't have one already
    2. If you already have a serial port listed, change the port name to "scribbler" all lowercase
    3. Click Apply
  10. Select Edit Serial Ports again
    1. Select the "Require pairing for security" button
    2. Click Apply
  11. You should now have a device like "/dev/tty.scribbler" that is the serial port to the scribbler. Confirm the actual name using the terminal application.
    1. Start Python.
    2. At the Python prompt enter:
 from myro import *

Once connected, upgrade the fluke firmware and the scribbler

  1. At the Python prompt enter:

If you get an RFCOMM error, go back to the Bluetooth Menu

  1. Click "Disconnect"
  2. Click "Edit Serial Ports"
    1. Select the "Require pairing for security" button
    2. Click Apply
  3. In Python:

Bluetooth Problems

We have received reports that on some Macintosh computers the /dev/tty.scribbler port will sometimes change it's name to a /dev/tty.scribblerXX (where XX is a number). For example, /dev/tty.scribbler remains in the /dev/ directory, but does not connect to the scribbler robot, while /dev/tty.scribbler04 is the correct communications port to use when connecting to your robot. If you run into "A Bluetooth serial failure has occurred." and/or "Serial element not found." errors, please check for other entries in your /dev/ directory and try using the one with the highest number. You may have to delete your bluetooth serial port and re-add it to create a new entry that works.

Detailed Installation

These instructions are only needed if you cannot use the package installer above.

What Packages Do I Need?

Myro depends on various python packages. You can find some binary installers online, install using fink or macports, or install them manually from source. See below for more detailed instructions.

Packages needed:

  1. Python-2.4
  2. Pyserial
  3. Python Imaging Library (PIL)
  4. Numpy
  5. Myro

What OS Version?

Mac OS X 10.6 or 10.7 - Manual install package

Mac OS X 10.5 - binary install or package installer

Mac OS X 10.4 - manual or binary install

Mac OS X 10.3 - manual install

Although all the packages can be installed from source, the binary install instructions are simpler. Using myro with python-2.5 is in beta testing and may cause some strange problems with idle. Email us if you find anything strange.

Currently the gamepad() interface is not supported on mac because of a conflict with TK and pygame

TK Snack is not available for Intel-based Macs.

Manual install files (Use for Mac OS X 10.6 or 10.7!)

You will need to install Xcode (Select the optional Unix Development Support package!) and macports on your computer!

This zip file includes Myro version 2.8.14, instructions, and an installer script that (should) do most of the work for you. It also includes an "" which allows students to load idle as a normal application (instead of having to work in the terminal).

It has has worked for several of my students. If you have any problems with it, please let Jay Summet [ summetj at gatech dot edu] know!

You should look at the following link by Jennifer Kay for detailed step-by-step directions for installing on Mac OSX 10.6 Mac_os10_6_install

NOTE: The X11 version of Python and IDLE that Macports installs has a few bugs in the editor. 1) You can't click to position the text insertion cursor. Workaround: Use the command button to "command-click" to position the text insertion cursor. 2) You can't use the mouse to highlight text to copy/cut it. Workaround: Hold the shift key down while moving the text insertion carrot using the keyboard arrow keys to highlight text.

NOTE: Prior to April 2011, the version of PIL shipped by MacPorts had a bug that would prevent the show(picture) function from working. This has been fixed now. If you installed before April 2011, you can download the fix by opening your terminal and typing: "sudo port selfupdate; sudo port upgrade outdated" (without the quotes) and the typing your password (no characters will be echoed, so you will have to type blind) and pressing enter.

Package Installer (Use for Mac OS X 10.5)

This dmg contains an installer for all of the files required for Myro, as well as one for Python 2.5. The download is here:

Binary Installer (Use for Mac OS X 10.5 or Mac OS X 10.4)

The binary packages can be found here

  1. Install Mac-Python
    1. Run the "Update Shell Profile.command" script in Applications/MacPython (this is needed for installing pyserial and myro)
  2. Install PIL
  3. Install Numpy
  4. Install pyserial from source using python
    1. Unzip pyserial
    2. In a terminal type (Mac OS will hide your password as you type it for security reasons):
      cd pyserial-2.2
      sudo python install
    3. Warning: if the pyserial file is not in the main directory, you may need to type cd nameofdirectory to get to the correct directory before typing cd pyserial-2.2.
  5. Install the latest myro
    1. Unzip myro
    2. In a terminal type:
      cd myro-2.8.2
      sudo python install
    3. Warning: if the myro file is not in the main directory, you may need to type cd nameofdirectory to get to the correct directory before typing cd myro-2.8.2. Please note that your version number may be different than 2.8.2.
  6. Install xmpppy (optional, for chat, register, send pictures)
    1. Unzip xmpppy
    2. In a terminal type:
      cd xmpppy-0.4.0
      sudo python install

Manual Install (Mac OSX 10.3)

Note: to set up Myro on Macs, you'll need to follow the instructions here -- the CDROM setup is only for Windows.

  1. You will most likely need to open the Terminal application to install all the packages.
  2. You will need gcc (install xcode from Mac OS cds or web) for Numpy, PIL, and jpeg
  3. Install python2.4 mac package or using fink
    1. Mac DMG package: /Library/Frameworks/Python.framework/Versions/2.4/bin/python2.4
    2. For fink: /sw/bin/python2.4
  4. Install pyserial from source using python2.4
    sudo python install
  5. Install libraries to save and send your images as jpeg.
    If you have fink or macports try installing libjpeg that way
    (e.g. fink install libjpeg libjpeg-bin libjpeg-shlibs)
    Otherwise follow these instructions to install libjpeg from source.
    1. download libjpeg
    2. untar that (tar -xvzf jpegsrc.v6b.tar.gz)
    3. cd jpeg-6b/
    4. ln -s `which glibtool` ./libtool
    5. export MACOSX_DEPLOYMENT_TARGET=10.4 (for tcsh or csh use setenv MAXOSX_DEPLOYMENT_TARGET 10.4)
    6. ./configure --enable-shared --prefix=/usr/local/
    7. if /usr/local/ /usr/local/include /usr/local/lib don't exist create them:
      1. sudo mkdir /usr/local/
      2. sudo mkdir /usr/local/lib/
      3. sudo mkdir /usr/local/include/
    8. make
    9. sudo make install-lib
    10. sudo make install-headers
  6. Install PIL
    1. sudo python install
    If you have a problem when running savePicture() while running Mac OS X 10.4, you may need edit so the paths point to the right versions of freetype, jpeglib, and zlib. Run the above steps again.
  7. Install Numpy
    1. sudo python install
  8. Install the latest myro
    sudo python install
  9. Install optional packages from Linux Setup especially xmpppy (for chat, register, sendPicture).
    1. For intel mac you can't use snack mac binaries since they are for PPC so you need to build you're own from source (still in progress, doesn't currently work).

What if Something goes wrong?

If you are using MacPython 2.5 and something goes wrong, you may have to UNINSTALL MacPython and do a complete re-install. Here is how to correctly uninstall MacPython2.5:

  • Remove the /Applications/MacPython folder. (Drag it to the trash, or in a terminal type "sudo rm /Applications/MacPython"
  • Remove the /Library/Frameworks/Python.framework directory. ("sudo rm /Library/Frameworks/Python.framework")
  • Remove all files that start with Python in the /Library/Receipts directory (This allows the MacPython installer to successfully re-install) A command such as "sudo rm /Library/Receipts/Python*" will do this. [Note the * touching the end of Python, make sure you do NOT leave a space between the * and the Python or this command will delete everything in the current directory.]

Intel Mac with Windows XP via Parallels

Setup Myro

Setup Bluetooth using USB Adapter

  • For newest version of parallels: Connect a USB Bluetooth adapter
  • Allow windows XP to access the bluetooth adapter via the toolbar on the bottom of the window
  • Follow Windows instructions for Bluetooth Setup

Setup Bluetooth using old version of Parallels (shouldn't be necessary anymore)

  • Getting the bluetooth to work with XP via parallels is a little tricky. Basically the built-in bluetooth adapter (at least in the macbook pro) needs extra drivers in XP. Instead, use the Cellink USB-bluetooth adapter since that doesn't require any extra drivers.
  • First we have to remove the bluetooth drivers from the macbook so it releases the device to XP
 sudo kextunload -b
 sudo kextunload -b
  • Plug in the cellink USB bluetooth adapter
  • Fire up XP in parallels
  • Using the parallels interface, let XP control the "wireless adapter XX:XX:XX:XX" which is the bluetooth dongle
  • The device should be seen by XP
  • Follow regular windows instructions
  • When finished, release the device from windows in parallels
  • Unplug the adapter
  • Reload the drivers to enable the device to be used from Mac OS
sudo kextload -b
sudo kextload -b