Installation

From Geeetech Wiki
Jump to: navigation, search

Installing on windows

Download and run the installer from the binaries download page. A link called “Crazyflie client” will be created in the start menus.

To install the Crazyradio dongle follow the instruction Install crazyradio driver on Windows 7. The procedure is similar for windows XP. For Windows 8 you have to take care about the not signed driver.

Installing on Linux

The firmware and PC client can be downloaded as binaries from the binary download page.

To run the client after downloading it without installation, run the cfclient in the bin folder, e.g.:

 cd <cfclient folder>
 python2 bin/cfclient

You might want to flash the latest firmware version. Instructions on how to install the software for development, etc. can be found in the developer guide.

Automatic system-wide install using setup.sh

By running the setup.sh script the client will automatically be installed as root and the udev rules will be added. If you would like to install the client as a normal user please follow the instructions above instead.

 cd crazyflie-pc-client
 sudo sh setup.sh

The client can then be run from any location using cfclient Manual installation Install dependencies The following has to be installed for the PC utilities to work:

  • Python 2.7
  • pyGame
  • PyUSB (0.X or 1.X)
  • libusb
  • Python bindings for Qt4

The following will install these dependencies on Fedora (tested for 16 to 18).

 sudo yum install pygame pyusb PyQt4

Or to install them on Ubuntu (tested for 10.04/11.10/12.04):

 sudo apt-get install python2.7 python-usb python-pygame python-qt4

This will install the dependencies in OpenSUSE (tested for 11.3):

 sudo zypper install python-pygame libusb python-usb

Note that these commands will pull in a lot of dependencies.

Fix udev permissions (Linux, Debian, Raspbian Wheezy, etc.)

The following steps make it possible to use the USB Radio without being root.

Note: If using a fresh Debian install, you may need to install sudo first (executing exit command to exit from root shell first):

 su -
 apt-get install sudo

Note - installing sudo is probably not required if using Raspbian Wheezy on a Raspberry Pi

Now, with sudo installed, you should be able to do the following commands

 sudo groupadd plugdev
 sudo usermod -a -G plugdev <username> (the default username for a Raspberry Pi is: Pi)

Create a file named /etc/udev/rules.d/99-crazyradio.rules

 sudo touch /etc/udev/rules.d/99-crazyradio.rules

and open the nano editor to edit the newly created 99-crazyradio.rules file you created

 sudo nano /etc/udev/rules.d/99-crazyradio.rules

The nano display will show there's no content in the file. Paste the following as a line in editor:

 SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="7777", MODE="0664", GROUP="plugdev"

and hit Ctl-O to 'write out' (i.e. save) the new line into the file. Then Ctl-X to exit.

Restart the computer and you are now able to access the USB radio dongle without being root.


Running source code on Windows

This procedure is required if you want to develop with the Crazyflie client on Windows. If you just want to run and fly the Carzyflie follow the instruction to install the client above.

Windows XP

The following has to be downloaded/installed for the PC utilities to work:

  • Python 2.7 (for Windows the last available binary version of Python 2.7 is Python 2.7.3)
  • pyGame for reading the input devices
  • PyUSB 1.X for communicating with the Crazyradio
  • libusb needed as backend for PyUSB
  • PyQt4 bindings for QT4

Windows Vista/7 32/64-bit

Even if you have a 64-bit install you should download the 32-bit versions of the libraries since this makes everything easier.

The following has to be downloaded/installed for the PC utilities to work:

  • Python 2.7 (for Windows the last available binary version of Python 2.7 is Python 2.7.3)
  • pyGame for reading the input devices
  • PyUSB 1.X for communicating with the Crazyradio
  • libusb needed as backend for PyUSB
  • PyQt4 bindings for QT4

Installing on Mac OSX

There are a few different options for getting setup on your Mac, choose one of the methods below:

Using homebrew

IMPORTANT NOTE: The following will use homebrew and it's own python distribution. If you have a lot of other 3rd party python stuff already running on your system they might or might not affected of this.

1.Open a terminal and install homebrew

 ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

You also need to install Command Line Tools for Xcode or Xcode if you don't already have them installed.

2.With homebrew installed, install it's distribution of Python:

 brew install python

This will also pull pip which we will use later to install some Python modules that are not distributed through homebrew.

3.Now make sure that the new python version is used for non-homebrew applications. To do this we need to prepend this installation to our PYTHONPATH:

 echo 'export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH' >> ~/.bashrc
 source ~/.bashrc

4.Install SDL for Python:

 brew install sdl sdl_image sdl_mixer sdl_ttf portmidi

5.Install PyQT:

 brew install pyqt

6.Install libusb:

 brew install libusb

7.Install Mercurial:

 brew install mercurial

8.Now use pip to install pyGame:

 pip install hg+http://bitbucket.org/pygame/pygame

As of 2013-05-08 the non-hg doesn't build correctly with brew installed SDL. Please update this when the fix as been pushed into the release version.

9.Install pyusb:

 pip install pyusb

You now have all the dependencies needed to run the client. Download and extract the client and then start it by running the following in a terminal:

 python bin/cfclient

Using MacPorts

1.If you do not have MacPorts installed yet please follow the installation guide. 2.If you just installed MacPorts you can skip this step, otherwise make sure you update before you continue:

 port selfupdate
 port upgrade outdated

3.Then go ahead and install the dependencies needed for the crazyflie client, this will also bring in lots of other dependencies, especially Qt will take a while:

 port install libusb
 port install py-pyusb-devel
 port install py27-pyqt4
 port install py27-game

4.To make it easier to run MacPorts binaries add /opt/local/bin to your PATH variable, The MacPorts installer should take care of that but take a look at ~/.profile to make sure. If you have any issues it could be due to the libraries not getting picked up correctly, fix that by setting DYLD_LIBRARY_PATH to /opt/local/lib in ~/.profile:

 export DYLD_LIBRARY_PATH=/opt/local/lib

5.No you're good to go! Download and extract the client and then start it by running the following in a terminal:

 python2.7 bin/cfclient