Raspberry Pi Troubles

Post here to get support
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: Raspberry Pi Troubles

Post by marcus »

foosel wrote:Went all-in and bought a small organizer bag yesterday to fit all of the stuff in the picture above when cabled together and running
Nice setup! I think I need to get one more Raspberry Pi :D
jtang613
Beginner
Posts: 16
Joined: Thu May 02, 2013 5:58 pm

Re: Raspberry Pi Troubles

Post by jtang613 »

Hey, I'd love to get cfheadless working on my Pi, but it seems to hang when trying to establish comms:

Code: Select all

 Info: Using config path:  /home/pi/crazyflie-pc-client/lib/../conf
Info: sys.path= ['/home/pi/crazyflie-pc-client/lib', '/home/pi/crazyflie-pc-client/lib/../conf', '/home/pi/crazyflie-pc-client/bin', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/pymodules/python2.7']
Disabling standard output for libraries!
[+] Starting joystick
INFO:cfclient.utils.config:Dist config read from /home/pi/crazyflie-pc-client/lib/cfclient/configs/config.json
INFO:cfclient.utils.config:Config file read from [/home/pi/crazyflie-pc-client/lib/../conf/config.json]
INFO:cfclient.utils.input:Parsing [PS3_Mode_1.json]
INFO:cfclient.utils.input:Parsing [xbox360_mode1.json]
INFO:cfclient.utils.input:Parsing [Jason1.json]
INFO:cfclient.utils.input:Parsing [PS3_Mode_2.json]
INFO:cfclient.utils.input:Parsing [Generic_OS_X.json]
[+] Reading config
[+] Connecting to Crazyflie
DEBUG:cflib.crazyflie:Adding callback on port [5] to [<bound method Log._new_packet_cb of <cflib.crazyflie.log.Log instance at 0x188e0d0>>]
DEBUG:cflib.crazyflie:Adding callback on port [0] to [<bound method Console.incoming of <cflib.crazyflie.console.Console instance at 0x188e288>>]
DEBUG:cflib.crazyflie:Adding callback on port [2] to [<bound method _ParamUpdater._new_packet_cb of <_ParamUpdater(Thread-2, initial daemon)>>]
INFO:cflib.crazyflie:Callback->Connection initialized[radio://0/10/250k]
INFO:cflib.crazyflie:We are connected[radio://0/10/250k], request connection setup
DEBUG:cflib.crazyflie.toc:[5]: Start fetching...
DEBUG:cflib.crazyflie:Adding callback on port [5] to [<bound method TocFetcher._new_packet_cb of <cflib.crazyflie.toc.TocFetcher instance at 0x188e5d0>>]
Any ideas as to what is going wrong?

Thanks
jtang613
Beginner
Posts: 16
Joined: Thu May 02, 2013 5:58 pm

Re: Raspberry Pi Troubles

Post by jtang613 »

Nevermind. Turns out my radio:// URI had a lower-case 'k' instead of upper-case 'K'.

(I might point out that correct engineering notation uses lower-case k for kilo :) )
foosel
Expert
Posts: 175
Joined: Sat Feb 02, 2013 9:59 pm
Location: Obertshausen, Germany
Contact:

Re: Raspberry Pi Troubles

Post by foosel »

Yeah, I fell into the same trap at first and it drove me nuts for two or three hours until I reread greggius configuration and it made click ;)
Image
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107
meinside
Beginner
Posts: 3
Joined: Tue May 14, 2013 6:19 am

Re: Raspberry Pi Troubles

Post by meinside »

Hi, all.

I'm trying on my rev.1 Model B(256MB) Raspberry Pi with wired Xbox360 controller,

and configs are as follows:

~/crazyflie-pc-client/lib/cfcfheadless.py

Code: Select all

app = HeadlessClient(sys.argv,link_uri="radio://0/10/250K",
                               input_config="xbox360_mode1")
/etc/udev/rules.d/99-crazyradio.rules

Code: Select all

SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="7777", MODE=="0664", GROUP="plugdev", RUN+="/root/bin/cfheadless.sh"
/etc/udev/rules.d/99-xbox360.rules

Code: Select all

SUBSYSTEM=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="028e", RUN+="/root/bin/xbox360wired.sh"
Crazyflie and the controller both connect well, but when cfheadless starts up,

it prints out no messages like:

Code: Select all

Found [Xbox Gamepad (userspace driver)]
Will use [Xbox Gamepad (userspace driver)] for input
and Crazyflie gets no input from the controller.

Am I missing something? Is there any difference with wireless and wired controllers?

Any help would be extremely appreciated :D
foosel
Expert
Posts: 175
Joined: Sat Feb 02, 2013 9:59 pm
Location: Obertshausen, Germany
Contact:

Re: Raspberry Pi Troubles

Post by foosel »

What the contents of /root/bin/xbox360wired.sh? What does it do when you start it manually?
Image
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107
meinside
Beginner
Posts: 3
Joined: Tue May 14, 2013 6:19 am

Re: Raspberry Pi Troubles

Post by meinside »

foosel wrote:What the contents of /root/bin/xbox360wired.sh? What does it do when you start it manually?
It is written after the post, nothing special:

Code: Select all

#!/bin/sh
if test "$ACTION" = "add"
then
        /usr/bin/xboxdrv > /tmp/xboxdrv.log 2>&1 &
else
        killall -9 xboxdrv
fi
When I run xboxdrv manually, it prints out verbose messages related to the input of the controller:

Code: Select all

xboxdrv 0.8.4 - http://pingus.seul.org/~grumbel/xboxdrv/ 
Copyright © 2008-2011 Ingo Ruhnke <grumbel@gmx.de> 
Licensed under GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> 
This program comes with ABSOLUTELY NO WARRANTY. 
This is free software, and you are welcome to redistribute it under certain conditions; see the file COPYING for details. 

Controller:        Microsoft Xbox 360 Controller
Vendor/Product:    045e:028e
USB Path:          001:007
Controller Type:   Xbox360

Your Xbox/Xbox360 controller should now be available as:
  /dev/input/js0
  /dev/input/event0

Press Ctrl-c to quit, use '--silent' to suppress the event output
X1:   655 Y1:   -55  X2: -1406 Y2:  -322  du:0 dd:0 dl:0 dr:0  back:0 guide:0 start:0  TL:0 TR:0  A:0 B:0 X:0 Y:0  LB:0 RB:0  LT:  0 RT:  0
X1:   655 Y1:   -55  X2: -1406 Y2:  -643  du:0 dd:0 dl:0 dr:0  back:0 guide:0 start:0  TL:0 TR:0  A:0 B:0 X:0 Y:0  LB:0 RB:0  LT:  0 RT:  0
X1:   655 Y1:   -55  X2: -1406 Y2:  -964  du:0 dd:0 dl:0 dr:0  back:0 guide:0 start:0  TL:0 TR:0  A:0 B:0 X:0 Y:0  LB:0 RB:0  LT:  0 RT:  0
X1:   655 Y1:   -55  X2: -1406 Y2: -1285  du:0 dd:0 dl:0 dr:0  back:0 guide:0 start:0  TL:0 TR:0  A:0 B:0 X:0 Y:0  LB:0 RB:0  LT:  0 RT:  0
...
The controller itself seems to be functioning ok.
foosel
Expert
Posts: 175
Joined: Sat Feb 02, 2013 9:59 pm
Location: Obertshausen, Germany
Contact:

Re: Raspberry Pi Troubles

Post by foosel »

Ah, my guess is that you need to adjust the udev rule to match a different product id... what does lsusb say?
Image
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107
meinside
Beginner
Posts: 3
Joined: Tue May 14, 2013 6:19 am

Re: Raspberry Pi Troubles

Post by meinside »

foosel wrote:Ah, my guess is that you need to adjust the udev rule to match a different product id... what does lsusb say?
It is same as my rule file:

Code: Select all

Bus 001 Device 011: ID 045e:028e Microsoft Corp. Xbox360 Controller

Code: Select all

SUBSYSTEM=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="028e", RUN+="/root/bin/xbox360wired.sh"
:cry:
humblehacker
Member
Posts: 34
Joined: Thu May 16, 2013 7:42 pm

Re: Raspberry Pi Troubles

Post by humblehacker »

Hello,
I've been experiencing similar troubles with the udev rules only I'm just using the standard PS3 configuration.
I'm running the latest version of Raspbian (released in Feburary 2013) on a 512MB Pi with a USB Hub and a standard PS3 Controller.
There are a couple things I'm hung up on one is getting the root/bin/cfheadless script to compile and execute, and the other is getting the client to run at all.
I tried running chmod, but it doesn't look like the script was made executable. I can't figure out if I didn't execute it properly or if the script just isn't compiling. What exactly is the recommended method for adding the /root/bin/cfheadless file? Do you use Leafpad? Geany? IDLE?

When I try to start the client from command line this is the output I get-

Code: Select all

Info: Using config path:  /home/pi/crazyflie-pc-client/lib/../conf
Info: sys.path= ['/home/pi/crazyflie-pc-client/lib', '/home/pi/crazyflie-pc-client/lib/../conf', '/home/pi/crazyflie-pc-client/bin', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/pymodules/python2.7']
Disabling standard output for libraries!
INFO:cfclient.utils.config:Dist config read from /home/pi/crazyflie-pc-client/lib/cfclient/configs/config.json
INFO:cfclient.utils.input:Parsing [PS3_Mode_1.json]
INFO:cfclient.utils.input:Parsing [xbox360_mode1.json]
INFO:cfclient.utils.input:Parsing [PS3_Mode_2.json]
INFO:cfclient.utils.input:Parsing [Generic_OS_X.json]
DEBUG:cflib.crazyflie:Adding callback on port [5] to [<bound method Log._new_packet_cb of <cflib.crazyflie.log.Log instance at 0x17cfeb8>>]
DEBUG:cflib.crazyflie:Adding callback on port [0] to [<bound method Console.incoming of <cflib.crazyflie.console.Console instance at 0x18b00a8>>]
DEBUG:cflib.crazyflie:Adding callback on port [2] to [<bound method _ParamUpdater._new_packet_cb of <_ParamUpdater(Thread-2, initial daemon)>>]
INFO:cflib.crazyflie:Callback->Connection initialized[radio://0/120/1M]
INFO:cflib.crazyflie:We are connected[radio://0/120/1M], request connection setup
DEBUG:cflib.crazyflie.toc:[5]: Start fetching...
DEBUG:cflib.crazyflie:Adding callback on port [5] to [<bound method TocFetcher._new_packet_cb of <cflib.crazyflie.toc.TocFetcher instance at 0x18b0a80>>]
DEBUG:cflib.crazyflie:ExpectAnswer: Will expect answer on port [5]
Found [Sony PLAYSTATION(R)3 Controller]
Will use [Sony PLAYSTATION(R)3 Controller] for input
WARNING:cflib.crazyflie:Got link error callback [Too many packets lost] in state [1]
DEBUG:cflib.crazyflie:ExpectAnswer: No answer on [5], do retry
DEBUG:cflib.crazyflie:ExpectAnswer: Will expect answer on port [5]
WARNING:cflib.crazyflie:ExpectAnswer: ERROR! Older timer whas running while scheduling new one on [5]
INFO:cflib.crazyflie:Callback->Connected failed to [radio://0/120/1M]: Too many packets lost
DEBUG:cflib.crazyflie:ExpectAnswer: No answer on [5], do retry
It seems to recognize the PS3 controller but can't establish radio comms for some reason... Any ideas?
I managed to get the GUI running on Linux Ubuntu without a hitch, so the hardware works fine.
Post Reply