From IPRE Wiki
Jump to: navigation, search

This page is devoted to getting Myro running on the OLPC XO laptop.

ScribXO.jpg MyroXO.jpgMyroXO2.jpg

The hardest bit was getting bluetooth working on the laptop. I used the cellink USB bluetooth adapter which I have used on Ubuntu previously. The kernel drivers for bluetooth aren't provided and had to be compiled separately. After fighting with git to get the olpc kernel sources, this was pretty easy. We also have to compile a program (passkey_agent) to authenticate (send the bluetooth PIN) to the fluke. The normal gnome bluetooth applet that fedora 6 (which the OLPC OS is based on) uses won't work on the XO. The bluetooth binaries for the OLPC can be downloaded here:

 wget http://cvs.cs.brynmawr.edu/cgi-bin/viewcvs.cgi/*checkout*/Myro/packages/olpc-bluetooth.tgz?rev=HEAD


You will need to:

  1. insert the modules,
  2. start the bluetooth service,
  3. and run passkey-agent every time the laptop boots

A way to automate these tasks is listed below.


Next, we need configure bluetooth.

 su # no password needed
 tar -xvzf olpc-bluetooth.tgz
 cd olpc-bluetooth
 /sbin/insmod bluetooth.ko
 /sbin/insmod hci_usb.ko
 /sbin/insmod l2cap.ko
 /sbin/insmod rfcomm.ko
 yum install bluez-utils bluez-libs

Edit /etc/bluetoth/rfcomm.conf and setup your fluke (change the "device line" to your fluke's bluetooth address)

 nano /etc/bluetooth/rfcomm.conf
       bind yes;
       device 02:02:5B:00:59:65;
       channel 1;
 /etc/init.d/bluetooth start
 ./passkey-agent --default "1234" &
 rfcomm bind all


You also need to install pyserial, tkinter, and pyImaging. You can install these via yum on the XO:

 yum install pyserial
 yum install tkinter
 yum install python-imaging #(although wrong version)

Next, download myro and install that

 mkdir myro
 wget http://myro.roboteducation.org/download/myro-2.6.5.zip
 unzip myro-2.6.5.zip
 python setup.py install

I also installed the 1.1.6 version of pyImaging from sources since myro checks for that version, but not sure we have to do that. For that you need to install gcc and tk-devel.

 yum install gcc tk-devel

Then install Imaging from sources.

 wget http://effbot.org/downloads/Imaging-1.1.6.tar.gz
 tar -xvzf Imaging-1.1.6.tar.gz
 cd Imaging-1.1.6
 python setup.py install

If you want the IM features of myro install xmpppy.

Enter a python shell

 >>> from myro import *
 >>> init('/dev/rfcomm0')
 >>> beep(1, 440)  

Running Myro

Since the XO uses a weird window manager, the images and joystick are kind of strange although usable. Just use alt-tab/alt-ctrl-tab to flip forward/backward through the windows. Maybe we could create a sugar interface and use pygame for the imaging and joystick features since there is an olpc wrapper around pygame.

Automatic Startup

If you don't want to type in all of the code to start up bluetooth every time you reboot the XO, try the following:

 nano load_bluetooth.sh

Edit the file to read:

 cd olpc-bluetooth
 /sbin/insmod bluetooth.ko
 /sbin/insmod hci_usb.ko
 /sbin/insmod l2cap.ko
 /sbin/insmod rfcomm.ko
 /etc/init.d/bluetooth start
 ./passkey-agent --default "1234" &
 rfcomm bind all

Save the file and make it executable by typing the following into the terminal:

 chmod +x load_bluetooth.sh

To run it, type:

 sh load_bluetooth.sh

This file should be located wherever the olpc-bluetooth folder is on your computer.