This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
projects:crazyflie:binaries:raspberrypi [2013-07-07 09:02] macke |
projects:crazyflie:binaries:raspberrypi [2019-09-05 15:22] kimberly |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Bitcraze Raspberry Pi SD-card image ====== | + | <WRAP center round important 60%> |
- | In order to make it easy for users that have a Raspberry Pi to test out our headless client we prepared an SD-card image that is ready to use out of the box. The image is based on the [[http:// | + | This page is deprecated and is moved to the main Bitcraze website. Please go to: |
- | We haven' | + | [[ |
+ | https://www.bitcraze.io/ | ||
+ | ]] | ||
- | ====== What did we change ====== | + | </ |
- | Here's a step by step guide to what we added. So if you don't want to use our image, you can get another one and set it up yourself. Most of this stuff is based of the contributed instructions from the [[projects: | + | |
- | Before you get started with this you need a few things: | + | ====== Bitcraze Raspberry Pi SD-card |
- | * An SD-card | + | In order to make it easy for users that have a Raspberry |
- | * An ethernet cable to connect the Pi to your network | + | |
- | * A power cord to power it | + | |
- | * An SD-card | + | |
- | First of all you have to write the image to the SD-card. There are good instructions on how to do this [[http:// | + | We haven' |
- | Now plug the SD-card | + | The changes made to the SD-card |
- | Most of these commands require root user, so switch to root: | + | ====== Download ====== |
- | < | + | The SD-card image can be downloaded here (version 2015.3 and onward is compatible with Raspberrypi 2): |
- | sudo su | + | * Bitcraze Raspbian image 2015.3 ([[http:// |
- | </code> | + | * Bitcraze Raspbian image 0.3 ([[http:// |
+ | * Bitcraze Raspbian image 0.2 ([[http:// | ||
+ | * Bitcraze Raspbian image 0.1 ([[http:// | ||
- | Let's create a user named bitcraze with the password crazyflie and add it to all the user groups. | ||
- | < | ||
- | useradd bitcraze -m -p crazyflie -G adm, | ||
- | </ | ||
- | Now install everything that we might need fro running the Crazyradio, controllers and the headless client. | + | <WRAP center round info > |
- | <code> | + | // |
- | apt-get -y install mercurial python2.7 python-usb python-pygame xboxdrv | + | Using Torrent is advised, we have added webseed so it is faster than direct download and guarantee the file integrity. |
- | </code> | + | </WRAP> |
- | The shebang | + | ====== Installing |
- | < | + | |
- | cd /usr/bin | + | |
- | ln -s python2.7 python2 | + | |
- | </ | + | |
- | In order to be able to use the Raspberry Pi without having any keyboard/ | + | If you already have a running raspbian system no need to download |
- | < | + | |
- | touch / | + | |
- | nano / | + | |
- | </ | + | |
- | Put the following text in the file: | ||
< | < | ||
- | SUBSYSTEM==" | + | curl https://raw.githubusercontent.com/bitcraze/ |
- | SUBSYSTEM==" | + | |
</ | </ | ||
- | In order for the Xbox 360 wireless controller to work the xboxdrv utility has to be installed and launched when the controller is connected. So add a new udev rule for this. | ||
- | < | ||
- | touch / | ||
- | nano / | ||
- | </ | ||
- | Put the following into the text file: | ||
- | < | ||
- | SUBSYSTEM==" | ||
- | </ | ||
- | Now we should create the file used to launch/kill the cfheadless client. Create the file and edit it: | + | ====== SD-image info ====== |
< | < | ||
- | mkdir /root/bin/ | + | Size: 4 GB |
- | touch / | + | User: pi |
- | chmod +x / | + | Pass: raspberry |
- | nano / | + | |
</ | </ | ||
- | And add the following text: | + | (version before 2015.3 had bitcraze/crazyflie as username/password) |
- | < | + | |
- | #!/bin/sh | + | |
- | if test " | + | |
- | then | + | |
- | / | + | |
- | echo $! > / | + | |
- | else | + | |
- | killall -9 cfheadless | + | |
- | if test -f / | + | |
- | then | + | |
- | PID=`cat / | + | |
- | kill -9 $PID | + | |
- | fi | + | |
- | fi | + | |
- | </code> | + | |
- | < | + | ====== What's added to the image ====== |
- | touch / | + | There' |
- | chmod +x / | + | * UDEV rules for access to the Crazyradio and NRF bootloader |
- | nano / | + | * crazyflie-pc-client pre-cloned at latest stable version |
- | </ | + | * pyusb |
+ | * UDEV rules to automatically launch the cfheadless client when Crazyradio is plugged in | ||
+ | * Driver for the Xbox 360 wireless controller and automatic start of the utilities | ||
- | Also create | + | ====== Creating |
- | < | + | First of all you have to write the image to the SD-card. There are good instructions on how to do this [[http://elinux.org/RPi_Easy_SD_Card_Setup# |
- | #!/bin/sh | + | |
- | if test " | + | |
- | then | + | |
- | / | + | |
- | else | + | |
- | killall -9 xboxdrv | + | |
- | fi | + | |
- | </ | + | |
- | + | ||
- | Now we are finished with the system setup so switch | + | |
- | < | + | |
- | exit | + | |
- | sudo su bitcraze | + | |
- | </ | + | |
- | + | ||
- | Go to the bitcraze users home directory and clone the PC client and Crazyradio firmware projects. | + | |
- | < | + | |
- | cd | + | |
- | mkdir projects | + | |
- | cd projects | + | |
- | hg clone https://bitbucket.org/bitcraze/ | + | |
- | hg clone https:// | + | |
- | </ | + | |
- | + | ||
- | Create the script that will execute when the Crazyradio is inserted. This will launch the cfheadless client. | + | |
- | < | + | |
- | touch start_cfheadless | + | |
- | chmod +x start_cfheadless | + | |
- | nano start_cfheadless | + | |
- | </ | + | |
- | Insert the following text into the file: | + | |
- | < | + | |
- | / | + | |
- | </ | + | |
- | + | ||
- | Now the last part, the configuration. The script above will launch the cfheadless client with the controller and link configuration that is written in the two files ''' | + | |
- | < | + | |
- | echo PS3_Mode_1 > / | + | |
- | echo radio:// | + | |
- | </ | + | |
- | + | ||
- | If you are using another controller configuration or another link, just use the same commands as above but replace it with your own settings. | + | |
- | + | ||
- | That's it! Now you can connect the controller, start the Crazyflie and insert the Crazyradio and you are ready to fly. | + | |
====== How to use the SD-card image ====== | ====== How to use the SD-card image ====== | ||
+ | First of all you need to set up what controller and link settings you are using. This is done by editing the two files in the folder /home/pi named controller.conf and link.conf. They should only contain one row each. | ||
- | First of all you need to set up what controller and link settings you are using. This is done by editing | + | To fly first insert the USB controller, then power on the Crazyflie |
- | To fly first insert the USB controller, then power on the Crazyflie and lastly insert the Crazyradio. This will start the cfheadless client and connect to the Crazyflie. In a few seconds you sould be ready to fly. | + | To quit either power off the Crazyflie or pull-out the Crazyradio. |
- | + | ||
- | To quick either power off the Crazyflie or pull-out the Crazyradio. | + | |
In order to restart flying you have to pull-out the Crazyradio dongle and insert it again. | In order to restart flying you have to pull-out the Crazyradio dongle and insert it again. | ||
Line 154: | Line 72: | ||
Check logfile / | Check logfile / | ||
+ | |||
+ | ====== FAQ ====== | ||
+ | ===== How do I get the RedOctane Xbox360 controller to work ===== | ||
+ | You will have to edit the ''/ | ||
+ | < | ||
+ | #!/bin/sh | ||
+ | if test " | ||
+ | then | ||
+ | / | ||
+ | else | ||
+ | killall -9 xboxdrv | ||
+ | fi | ||
+ | </ | ||
+ | {{tag> |