User Tools

Site Tools


projects:crazyflie:pc_utils:raspberrypi

Differences

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

Link to this comparison view

Next revision
Previous revision
projects:crazyflie:pc_utils:raspberrypi [2013-07-07 09:03]
macke created
projects:crazyflie:pc_utils:raspberrypi [2021-06-24 16:47] (current)
kimberly
Line 1: Line 1:
 +<WRAP center round important 60%>
 +This page has deprecated and will be archived. Please go to [[https://www.bitcraze.io/]].
 +</WRAP>
 ====== Modifying the Raspian Wheezy image ====== ====== Modifying the Raspian Wheezy image ======
-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]].+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 [[misc:hacks:rasberrypi|hacks section]]. 
 + 
 +<WRAP center round info> 
 +//**Note**// 
 +Since version 2015.3 you can setup your own SDCard in [[projects:crazyflie:binaries:raspberrypi#installing_in_an_existing_raspbian_sdcard|one command]]. 
 +</WRAP> 
  
 Before you get started with this you need a few things: Before you get started with this you need a few things:
-  * An SD-card that's at least 2GB+  * An SD-card that's at least 4GB
   * An ethernet cable to connect the Pi to your network   * An ethernet cable to connect the Pi to your network
   * A power cord to power it   * A power cord to power it
Line 12: Line 21:
 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. 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.
  
-Most of these commands require root user, so switch to root: +<WRAP center round tip
-<code+//**Info**// 
-sudo su +All modern Linux distribution now have a kernel driver for the x-box gamepad. Thus it is unlikely the //xboxdrv// user-space driver is needed. 
-</code>+</WRAP>
  
-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. 
-<code> 
-apt-get -y install mercurial python2.7 python-usb python-pygame xboxdrv 
-</code> 
  
-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.+Lets install everything that we might need fro running the Crazyradio, controllers and the headless client.
 <code> <code>
-cd /usr/bin +sudo apt-get -y install python-usb xboxdrv
-ln -s python2.7 python2+
 </code> </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: 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:
 <code> <code>
-touch /etc/udev/rules.d/99-crazyflie.rules +sudo touch /etc/udev/rules.d/99-crazyflie.rules 
-nano /etc/udev/rules.d/99-crazyflie.rules+sudo nano /etc/udev/rules.d/99-crazyflie.rules
 </code> </code>
  
Line 47: Line 46:
 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. 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> <code>
-touch /etc/udev/rules.d/99-xboxdrv.rules +sudo nano /etc/udev/rules.d/99-xboxdrv.rules
-nano /etc/udev/rules.d/99-xboxdrv.rules+
 </code> </code>
 Put the following into the text file: Put the following into the text file:
Line 57: Line 55:
 Now we should create the file used to launch/kill the cfheadless client. Create the file and edit it: Now we should create the file used to launch/kill the cfheadless client. Create the file and edit it:
 <code> <code>
-mkdir /root/bin/ +sudo mkdir /root/bin/ 
-touch /root/bin/cfheadless +sudo touch /root/bin/cfheadless 
-chmod +x /root/bin/cfheadless +sudo chmod +x /root/bin/cfheadless 
-nano /root/bin/cfheadless+sudo nano /root/bin/cfheadless
 </code> </code>
  
Line 81: Line 79:
  
 <code> <code>
-touch /root/bin/xbox360 +sudo touch /root/bin/xbox360 
-chmod +x /root/bin/xbox360 +sudo chmod +x /root/bin/xbox360 
-nano /root/bin/xbox360+sudo nano /root/bin/xbox360
 </code> </code>
  
Line 97: Line 95:
 </code> </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: +Go to the pi users home directory and clone the PC client and Crazyradio firmware projects.
-<code> +
-exit +
-sudo su bitcraze +
-</code> +
- +
-Go to the bitcraze users home directory and clone the PC client and Crazyradio firmware projects.+
 <code> <code>
 cd cd
 mkdir projects mkdir projects
 cd projects cd projects
-hg clone https://bitbucket.org/bitcraze/crazyflie-pc-client +git clone https://github.com/bitcraze/crazyflie-clients-python.git
-hg clone https://bitbucket.org/bitcraze/crazyradio-firmware+
 </code> </code>
  
 Create the script that will execute when the Crazyradio is inserted. This will launch the cfheadless client. Create the script that will execute when the Crazyradio is inserted. This will launch the cfheadless client.
 <code> <code>
 +cd
 touch start_cfheadless touch start_cfheadless
 chmod +x start_cfheadless chmod +x start_cfheadless
Line 120: Line 112:
 Insert the following text into the file: Insert the following text into the file:
 <code> <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>&1+/home/pi/projects/crazyflie-clients-python/bin/cfheadless -u `cat /home/pi/link.conf` -i `cat /home/pi/controller.conf` > /tmp/cfheadless.log 2>&1
 </code> </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: 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> <code>
-echo PS3_Mode_1 > /home/bitcraze/controller.conf +echo PS3_Mode_1 > /home/pi/controller.conf 
-echo radio://0/10/250K > /home/bitcraze/link.conf+echo radio://0/10/250K > /home/pi/link.conf
 </code> </code>
  
Line 133: Line 125:
 That's it! Now you can connect the controller, start the Crazyflie and insert the Crazyradio and you are ready to fly. That's it! Now you can connect the controller, start the Crazyflie and insert the Crazyradio and you are ready to fly.
  
 +{{tag>update_on_pi_release}}
projects/crazyflie/pc_utils/raspberrypi.1373180633.txt.gz · Last modified: 2015-07-15 16:30 (external edit)