User Tools

Site Tools


misc:hacks:rasberrypi

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 Both sides next revision
misc:hacks:rasberrypi [2013-06-10 00:54]
absoloodle37 corrected typo
misc:hacks:rasberrypi [2013-06-10 01:09]
absoloodle37 More clarifying edits
Line 83: Line 83:
 </code> </code>
  
-**Note**: If you used a Windows 7 PC and the cfclient GUI to create a customized .json file for your xbox controller and plan to copy it over to your Raspberry Pi here is some advice:+**Note**: If you created a customized .json file for your xbox controller using a Windows PC and the cfclient GUI and are planning to copy it over to your Raspberry Pihere is some advice:
  
 -save the new .json file as something different than the default, so you can recognize it easily.  e.g. xbox360new.json -save the new .json file as something different than the default, so you can recognize it easily.  e.g. xbox360new.json
Line 157: Line 157:
 </code> </code>
  
-You can only create the cfheadless file above in the /root/bin/ folder by being root--not pi or any other user name.  Switch to root: ''sudo -i'' and then navigate to the /root/bin/ folder: ''cd /root/bin/'' Create the cfheadless file by typing: ''touch cfheadless'' to create the file.  Then ''nano cfheadless'' to edit the file with the code shown above ('sudo' prefix not needed because you're already root).  Use the same method for the xbox360 file described in the section below, if using a xbox360 controller.  Don't forget to make your files executable after you've created them: ''chmod +x /root/bin/cfheadless'' and ''chmod +x /root/bin/xbox360''. Once you've created the cfheadless file (and xbox360 file, if needed), exit the root mode by typing Ctl + D.  This should now take care to startup the headless client when you plug in the dongle and (hopefully ;-)) kill it again when you unplug. If you need any additional setup to get your controller working, you can add a similar udev-rule for that to take care of everything upon plugging in the controller as well. An example for the Microsoft Wireless XBox360 controller for PC can be found [[http://forum.bitcraze.se/viewtopic.php?p=490#p490|in this forums post]] or as detailed below.+You can only create the cfheadless file above in the /root/bin/ folder by being root--not pi or any other user name.  Switch to root: ''sudo -i'' and then navigate to the /root/bin/ folder: ''cd /root/bin/'' Create the cfheadless file by typing: ''touch cfheadless'' to create the file.  Then ''nano cfheadless'' to edit the file with the code shown above ('sudo' prefix not needed because you're already root).  Use the same method for the xbox360 file described in the section below, if using a xbox360 controller.  Don't forget to make your files executable after you've created them: ''chmod +x /root/bin/cfheadless'' and ''chmod +x /root/bin/xbox360''. Once you've created the cfheadless file (and xbox360 file, if needed), exit the root mode by typing Ctl + D.  You may have to restart your RPi in order for all new udev rules to take effect. Rather than unplug/replug your RPi, consider the following command: 
 + 
 +<code bash>sudo shutdown -h now -r 
 +</code> 
 + 
 +The -h halts all processes, the -r is the command to reboot after shutdown.   
 + 
 +This should now take care to startup the headless client when you plug in the dongle and (hopefully ;-)) kill it again when you unplug. If you need any additional setup to get your controller working, you can add a similar udev-rule for that to take care of everything upon plugging in the controller as well. An example for the Microsoft Wireless XBox360 controller for PC can be found [[http://forum.bitcraze.se/viewtopic.php?p=490#p490|in this forums post]] or as detailed below.
  
 And for the XBox360 Controller (after an "apt-get install xboxdrv"): And for the XBox360 Controller (after an "apt-get install xboxdrv"):
Line 180: Line 187:
   * /var/log/syslog   * /var/log/syslog
  
-Also, if xboxdrv can't be run without the sudo command, or there are other permissions issues with the xbox wireless usb controller, try adding the the xbox360 wireless receiver to a group that has root privileges.  This can be done by adding: GROUP="plugdev", to the 99-xbox360.rules udev rule (similar to the code in the crazyradio udev rule).+Also, if xboxdrv can't be run without the sudo command, or there are other permissions issues with the xbox wireless usb controller, try adding the the xbox360 wireless receiver to a group you created that has root privileges, like 'plugdev'.  This can be done by adding: GROUP="plugdev", to the 99-xbox360.rules udev rule (similar to the code in the crazyradio udev rule)
 + 
 +<code bash>SUBSYSTEM=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="0719", GROUP="plugdev", RUN+="/root/bin/xbox360"</code> 
 + 
 +Also, if running the xboxdrv command from a terminal window gives you the following error:  
 + 
 +<code bash>Error couldn't claim the USB interface: LIBUSB_ERROR_BUSY</code>
  
-Also, if running the xboxdrv command from a terminal window gives you the following error: 'Error couldn't claim the USB interface: LIBUSB_ERROR_BUSY' your controller may very well have already started automatically per the udev rule you created above and could be working correctly and currently is in use.  Make sure your wireless controller is powered on and connected (green arc showing), turn on your crazyflie and then plug in your crazyradio.  Once the green light on your crazyflie flashes on, you have a connection and are ready to fly!+...your controller may very well have already started automatically per the udev rule you created above and could be working correctly and currently is in use.  Make sure your wireless xbox controller is powered on and connected (green arc showing), turn on your crazyflie and then plug in your crazyradio.  Once the green light on your crazyflie flashes on, you have a connection and are ready to fly!
  
 ===== Make your base station portable ===== ===== Make your base station portable =====
misc/hacks/rasberrypi.txt · Last modified: 2021-06-24 16:45 by kimberly