User Tools

Site Tools


projects:crazyflie:binaries:raspberrypi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

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 boxThe image is based on the [[http://www.raspbian.org/| Raspbian]] distribution, more specifically the Wheezey version that can be downloaded [[http://downloads.raspberrypi.org/images/raspbian/2013-05-25-wheezy-raspbian/2013-05-25-wheezy-raspbian.zip.torrent|from this torrent]].+This page is deprecated and is moved to the main Bitcraze websitePlease go to:
  
-We haven't removed anything from the image, just added our own stuffSo you can still log in and used the Raspberry Pi as you would with the Raspbian Wheezy image, but as an added feature you can also use our stuffIf you would like to re-create the SD-image with your own Wheezy image then [[projects:crazyflie:pc_utils:raspberrypi|have a look at what we did]].+ [[ 
 +https://www.bitcraze.io/docs/crazyflie-clients-python/master/raspberrypi
 +]]
  
-====== What did we change ====== +</WRAP>
-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:crazyflie:hacks:rasberrypi|hacks section]].+
  
-Before you get started with this you need a few things: +====== Bitcraze Raspberry Pi SD-card image ====== 
-  * An SD-card that's at least 2GB +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://www.raspbian.org/| Raspbian]] distribution. The image version 2015.3 is based on Raspbian version 2015-02-16 available on the [[http://www.raspberrypi.org/downloads/|RaspberryPi website]].
-  * An ethernet cable to connect the Pi to your network +
-  * A power cord to power it +
-  * An SD-card reader for a computer+
  
-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#Create_your_own|here]].+We haven't removed anything from the image, just added our own stuff. So you can still log in and used the Raspberry Pi as you would with the Raspbian image, but as an added feature you can also use our stuff. If you would like to re-create the SD-image with your own Wheezy image then [[projects:crazyflie:pc_utils:raspberrypi|have a look at what we did]].
  
-Now plug the SD-card into the Pi, attach all the cables and SSH to it. Log in user the username pi and the password raspberry and accept the fingerprint.+The changes made to the SD-card is mostly based of the contributed instructions from the [[misc:hacks:rasberrypi|hacks section]].
  
-Most of these commands require root user, so switch to root+====== Download ====== 
-<code> +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://files.bitcraze.se/dl/cfpi-2015.3.7z.torrent|torrent]]) ([[http://files.bitcraze.se/dl/cfpi-2015.3.7z|direct download]]) ([[https://mega.co.nz/#!uQYSFIDJ!6PwIwxM315B99ejveo_6zlTVWk_oYkMOW0fKQLQ74A0|mega]]) 
-</code>+  * Bitcraze Raspbian image 0.3 ([[http://files.bitcraze.se/dl/cfpi-0_3.7z.torrent|torrent]]) ([[http://files.bitcraze.se/dl/cfpi-0_3.7z|direct download]]) 
 +  * Bitcraze Raspbian image 0.2 ([[http://tracker.bitcraze.se/torrents/cfpi-0_2.zip.torrent|torrent]]) ([[https://mega.co.nz/#!fVoTBIAQ!Akk80haC--oZjklJxCzCaS_nnlg8xVQhUcczPviaawA|mega]]) 
 +  * Bitcraze Raspbian image 0.1 ([[http://tracker.bitcraze.se/torrents/cfpi-0_1.zip.torrent|torrent]]) ([[https://mega.co.nz/#!HJpH2KDJ!bY-EdGtyxIRzOUu6xNVWnid_cco5wS-IQ6ELfc5Y1Q8|mega]])
  
-Let's create a user named bitcraze with the password crazyflie and add it to all the user groups. 
-<code> 
-useradd bitcraze -m -p crazyflie -G adm,dialout,cdrom,sudo,audio,video,plugdev,games,users,netdev,input 
-</code> 
  
-Now install everything that we might need fro running the Crazyradio, controllers and the headless client. +<WRAP center round info 
-<code+//**Note**// 
-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 in the cfheadless client uses /usr/bin/pyton2 which isn't available in the original image so create a symbolic link for it. +====== Installing in an existing Raspbian sdcard ======
-<code> +
-cd /usr/bin +
-ln -s python2.7 python2 +
-</code>+
  
-In order to be able to use the Raspberry Pi without having any keyboard/screen let's add a udev rule that starts up the client when the Crazyflie is inserted and kills it when it's removed. We should also have a rule that allows us to use the Crazyradio bootloader with out being root. Create the file and edit it: +If you already have a running raspbian system no need to download the image, connect your raspberrypi and run the following command to install all packages and dependencies. We are generating the official that way. You must be logged with the 'pi' user to launch the command:
-<code> +
-touch /etc/udev/rules.d/99-crazyflie.rules +
-nano /etc/udev/rules.d/99-crazyflie.rules +
-</code>+
  
-Put the following text in the file: 
 <code> <code>
-SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="7777", MODE=="0664", GROUP="plugdev", RUN+="/root/bin/cfheadless" +curl https://raw.githubusercontent.com/bitcraze/bitcraze-raspberry-pi/2015.3/bitcraze_raspberrypi.sh | sh
-SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="0101", MODE=="0664", GROUP="plugdev"+
 </code> </code>
  
-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. 
-<code> 
-touch /etc/udev/rules.d/99-xboxdrv.rules 
-nano /etc/udev/rules.d/99-xboxdrv.rules 
-</code> 
-Put the following into the text file: 
-<code> 
-SUBSYSTEM=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="0719", GROUP="plugdev", RUN+="/root/bin/xbox360" 
-</code> 
  
-Now we should create the file used to launch/kill the cfheadless client. Create the file and edit it:+====== SD-image info ======
 <code> <code>
-mkdir /root/bin/ +Size: 4 GB 
-touch /root/bin/cfheadless +User: pi 
-chmod +x /root/bin/cfheadless +Pass: raspberry
-nano /root/bin/cfheadless+
 </code> </code>
  
-And add the following text: +(version before 2015.3 had bitcraze/crazyflie as username/password)
-<code> +
-#!/bin/sh +
-if test "$ACTION" = "add" +
-then +
-        /usr/bin/sudo -u bitcraze /home/bitcraze/start_cfheadless & +
-        echo $! > /tmp/cfheadless.pid +
-else +
-        killall -9 cfheadless +
-        if test -f /tmp/cfheadless.pid +
-        then +
-                PID=`cat /tmp/cfheadless.pid` +
-                kill -9 $PID +
-        fi +
-fi +
-</code>+
  
-<code> +====== What's added to the image ====== 
-touch /root/bin/xbox360 +There's a list of what's added: 
-chmod +x /root/bin/xbox360 +  * UDEV rules for access to the Crazyradio and NRF bootloader 
-nano /root/bin/xbox360 +  * crazyflie-pc-client pre-cloned at latest stable version 
-</code>+  * 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 the script to start/stop the xboxdrv for the wireless xbox360 controller. +====== Creating the SD-card =====
-<code> +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#Create_your_own|here]].
-#!/bin/sh +
-if test "$ACTION" "add" +
-then +
-        /usr/bin/xboxdrv & +
-else +
-        killall -9 xboxdrv +
-fi +
-</code> +
- +
-Now we are finished with the system setup so switch to the newly created bitcraze user by first exiting switching back to the pi user and then bitcraze: +
-<code> +
-exit +
-sudo su bitcraze +
-</code> +
- +
-Go to the bitcraze users home directory and clone the PC client and Crazyradio firmware projects. +
-<code> +
-cd +
-mkdir projects +
-cd projects +
-hg clone https://bitbucket.org/bitcraze/crazyflie-pc-client +
-hg clone https://bitbucket.org/bitcraze/crazyradio-firmware +
-</code> +
- +
-Create the script that will execute when the Crazyradio is inserted. This will launch the cfheadless client. +
-<code> +
-touch start_cfheadless +
-chmod +x start_cfheadless +
-nano start_cfheadless +
-</code> +
-Insert the following text into the file: +
-<code> +
-/home/bitcraze/projects/crazyflie-pc-client/bin/cfheadless -u `cat /home/bitcraze/link.conf` -i `cat /home/bitcraze/controller.conf` > /tmp/cfheadless.log 2>&+
-</code> +
- +
-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 '''controller.conf''' and '''link.conf'''. This configuration is written using the following commands: +
-<code> +
-echo PS3_Mode_1 > /home/bitcraze/controller.conf +
-echo radio://0/10/250K > /home/bitcraze/link.conf +
-</code> +
- +
-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 the two files in the folder /home/bitcraze named controller.conf and link.conf. They should only contain one row each.+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 CrazyflieIn a few seconds you should be ready to fly.
  
-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 /tmp/cfheadless.log for messages Check logfile /tmp/cfheadless.log for messages
 +
 +====== FAQ ======
 +===== How do I get the RedOctane Xbox360 controller to work =====
 +You will have to edit the ''/root/bin/xbox'' file to contain the following to get the RedOctaine xbox360 (1430:f801) controller to work:
 +<code>
 +#!/bin/sh
 +if test "$ACTION" = "add"
 +then
 +/usr/bin/xboxdrv --device-by-id 1430:f801 --type xbox360 --axismap X2=X1,Y2=Y1,X1=X2,Y1=Y2 &
 +else
 +killall -9 xboxdrv
 +fi
 +</code>
 +{{tag>update_on_pi_release}}
projects/crazyflie/binaries/raspberrypi.txt · Last modified: 2020-05-12 14:26 by kimberly