Raspberry Pi Troubles

Post here to get support
skube
Member
Posts: 55
Joined: Fri May 03, 2013 2:41 pm
Location: Toronto, Canada

Re: Raspberry Pi Troubles

Post by skube »

I finally got it working! By looking in "/tmp/cfheadless.log" I could see the errors.

One was that I had changed the default user from "pi" to "skube" but missed changing both instances of "pi" in the cfheadless shell script.

The other was I got the error message that python2 could not be found. So I edited the file "~/crazyflie-pc-client/bin/cfheadless" and changed the python2 in the first line to python

Thanks again for all the help foosel. I definitely don't understand everything but at least I'm making progress.

Up next, portable power :D
Crazyflie Nano 10-DOF | AR Drone v1 | MikroKopter Okto
foosel
Expert
Posts: 175
Joined: Sat Feb 02, 2013 9:59 pm
Location: Obertshausen, Germany
Contact:

Re: Raspberry Pi Troubles

Post by foosel »

Just updated the instructions on the Wiki after a pull request of mine got accepted that adds a couple of command line options to the client:

Code: Select all

usage: cfheadless [-h] [-u URI] [-i INPUT] [-d] [-c CONTROLLER]
                  [--controllers]

optional arguments:
  -h, --help            show this help message and exit
  -u URI, --uri URI     URI to use for connection to the Crazyradio dongle,
                        defaults to radio://0/10/250K
  -i INPUT, --input INPUT
                        Input mapping to use for the controller, defaults to
                        PS3_Mode_1
  -d, --debug           Enable debug output
  -c CONTROLLER, --controller CONTROLLER
                        Use controller with specified id, id defaults to 0
  --controllers         Only display available controllers and exit
Should make installation more user friendly, no need to edit the source anymore.
Image
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107
marcus
Bitcraze
Posts: 601
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: Raspberry Pi Troubles

Post by marcus »

foosel wrote:Should make installation more user friendly, no need to edit the source anymore.
Nice work! I still haven't had time to look anymore at removing the QT dependency and fixing the "exiting" issue... :( At some point I'll get around to it.
Smitty79
Beginner
Posts: 6
Joined: Thu May 30, 2013 9:58 pm

Re: Raspberry Pi Troubles

Post by Smitty79 »

Hi all,

So I get my Raspberry Pi to work with the help of my brother. But can't seem to get any YAW control. I'm using xbox wireless controller for windows.

using xbox_mode1 and can use throttle/pitch/thrust to fly but no Yaw.

Any suggestions?????

UPDATE: I was flying the crazyflie without yaw control and just started to push some of the unused buttons on my controller and I got yaw control with my right throttle control but in no way controllable.
10DOF Crazyflie, Wireless Xbox360 Controller
Raspberry Pi Base Station with ADAFRUIT INDUSTRIES RGB NEGATIVE 16X2 LCD + KEYPAD KIT
foosel
Expert
Posts: 175
Joined: Sat Feb 02, 2013 9:59 pm
Location: Obertshausen, Germany
Contact:

Re: Raspberry Pi Troubles

Post by foosel »

I didn't bother trying the included input mappings actually, but created my own by launching the regular client once (via VNC), using the "Configure Device Mapping" dialog, and then using the resulting json file in the headless client and be happy with it. If you want to give the one I use a try (have a wireless XBOX 360 for Windows controller myself), take a look here
foosel wrote:Mapping is as follows:
  • Left analog stick: pitch, roll
  • Right analog stick: yaw
  • Right analog trigger (shoulder button): thrust
  • Button pad: trimming for pitch and roll
  • Start: kill switch (not tested yet)
  • Back: exit app (not tested yet)
Image
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107
Smitty79
Beginner
Posts: 6
Joined: Thu May 30, 2013 9:58 pm

Re: Raspberry Pi Troubles

Post by Smitty79 »

foosel wrote:I didn't bother trying the included input mappings actually, but created my own by launching the regular client once (via VNC), using the "Configure Device Mapping" dialog, and then using the resulting json file in the headless client and be happy with it. If you want to give the one I use a try (have a wireless XBOX 360 for Windows controller myself), take a look here


Thanks foosel, worked like a charm.
10DOF Crazyflie, Wireless Xbox360 Controller
Raspberry Pi Base Station with ADAFRUIT INDUSTRIES RGB NEGATIVE 16X2 LCD + KEYPAD KIT
SkyyPunk
Beginner
Posts: 14
Joined: Sat May 18, 2013 10:54 pm

Re: Raspberry Pi Troubles

Post by SkyyPunk »

Having some troubles with the udev stuff. The rules are working but I am getting this error when I plug in either the CR or 360 controller (with respective file being complained about):
Jun 20 21:18:26 raspi udevd[2346]: failed to execute '/root/bin/cfheadless' '/root/bin/cfheadless': No such file or directory
Image

As you can see in the image the files are definitely there, were added as root, and have execute permission. Any ideas?

Edit: I also made sure to go through the udev permission instructions. I tried the initial way (plugdev part of pi user) as well as appending plugdev being a part of root

Edit2: To be sure I got it in the right place I also copied cfheadless and xbox360 to /root/bin/ (wasn't 100% sure where i was in ssh), /bin/,/stuff/ (created a new folder, updated udev rule), all have the same error just pointed at the different directory :(
foosel
Expert
Posts: 175
Joined: Sat Feb 02, 2013 9:59 pm
Location: Obertshausen, Germany
Contact:

Re: Raspberry Pi Troubles

Post by foosel »

Have you made cfheadless and xbox360 executable via chmod a+x?

Never mind, you have according to the screenshot. What does happen when you call /root/bin/cfheadless directly yourself?
Image
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107
SkyyPunk
Beginner
Posts: 14
Joined: Sat May 18, 2013 10:54 pm

Re: Raspberry Pi Troubles

Post by SkyyPunk »

foosel wrote:Never mind, you have according to the screenshot. What does happen when you call /root/bin/cfheadless directly yourself?
root@raspi:~# /root/bin/cfheadless
-bash: /root/bin/cfheadless: /bin/sh^M: bad interpreter: No such file or directory
Bah, turns out because I poked around in the files on my Win7 machine and then transferred it had dos line endings, not unix. Fixed that and it works now! Thanks :D
jtang613
Beginner
Posts: 16
Joined: Thu May 02, 2013 5:58 pm

Re: Raspberry Pi Troubles

Post by jtang613 »

Just a note to anyone trying to use a Logitech, Inc. F310 Gamepad. The stock Raspian image does not include the xpad.ko module needed to get this controller working. You can find it pre-compiled here:
http://bucket.changeover.za.net/xpad.ko

Then load it manually using:

Code: Select all

sudo insmod xpad.ko
After that, your gamepad should be available to cfclient.
Post Reply