Raspberry Pi Troubles

Post here to get support
Syrinda
Beginner
Posts: 2
Joined: Mon Jul 08, 2013 8:26 pm

Re: Raspberry Pi Troubles

Post by Syrinda »

Hello all,

I tried to configure my Rasperry Pi for flying with the Crazyfly, but the auto-plug-in-start of the headless client doesn't work... (xboxdrv works perfektly while plugging in the controller).
While plugging in the crazyradio, I'am getting this message in /var/log/syslog:

Jul 8 20:43:01 RaspPi-Jonas kernel: [ 95.752615] usb 1-1.2: new full-speed USB device number 4 using dwc_otg
Jul 8 20:43:01 RaspPi-Jonas kernel: [ 95.856406] usb 1-1.2: New USB device found, idVendor=1915, idProduct=7777
Jul 8 20:43:01 RaspPi-Jonas kernel: [ 95.856435] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=29
Jul 8 20:43:01 RaspPi-Jonas kernel: [ 95.856451] usb 1-1.2: Product: Crazyradio USB Dongle
Jul 8 20:43:01 RaspPi-Jonas kernel: [ 95.856465] usb 1-1.2: Manufacturer: Bitcraze
Jul 8 20:43:01 RaspPi-Jonas kernel: [ 95.856478] usb 1-1.2: SerialNumber: 189751B3D7
Jul 8 20:43:01 RaspPi-Jonas udevd[2191]: failed to execute '/root/bin/cfheadless' '/root/bin/cfheadless': Exec format error

And if I start the shell script /root/bin/cfheadless manually (with sudo) while the crazyradio is plugged in, I get this message: "cfheadless: Kein Prozess gefunden" (translated: no process found).

But with "python ~/crazyflie-pc-client/bin/cfheadless" all things work well...
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: Raspberry Pi Troubles

Post by marcus »

Did you set the executable flag for the file?

Code: Select all

chmod +x /root/bin/cfheadless
The reason for the error message when launched manually is probably that you end up in the else branch and it's trying to kill the process, but it's not found anymore.
Syrinda
Beginner
Posts: 2
Joined: Mon Jul 08, 2013 8:26 pm

Re: Raspberry Pi Troubles

Post by Syrinda »

Yes, I already set the executable flag for the file. I think, otherwise it would not be possible to start the script manually...
foosel
Expert
Posts: 175
Joined: Sat Feb 02, 2013 9:59 pm
Location: Obertshausen, Germany
Contact:

Re: Raspberry Pi Troubles

Post by foosel »

Could you please post the first line of your /root/bin/cfheadless file?
Image
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107
Pinsel
Beginner
Posts: 2
Joined: Fri Oct 04, 2013 4:07 pm

Re: Raspberry Pi Troubles

Post by Pinsel »

Hi,

I tried the RPi Config and it works well. There is only one question:

How do I program to fly with XBOX Controller Mode 2 ?

Thanks for help.
Pinsel
Beginner
Posts: 2
Joined: Fri Oct 04, 2013 4:07 pm

Re: Raspberry Pi Troubles

Post by Pinsel »

Now ist works! :D

I copied my WinPC Config File onto the PRi (/home/bitcraze/projects/crazyflie-pc-client/bin), here it is:

Code: Select all

{
  "inputconfig": {
    "inputdevice": {
      "updateperiod": 10, 
      "name": "XBOX_ Mode_2", 
      "axis": [
        {
          "scale": -1.0, 
          "type": "Input.AXIS", 
          "name": "thrust", 
          "key": "thrust", 
          "id": 1
        }, 
        {
          "scale": 1.0, 
          "type": "Input.AXIS", 
          "name": "yaw", 
          "key": "yaw", 
          "id": 0
        }, 
        {
          "scale": 1.0, 
          "type": "Input.AXIS", 
          "name": "roll", 
          "key": "roll", 
          "id": 4
        }, 
        {
          "scale": -1.0, 
          "type": "Input.AXIS", 
          "name": "pitch", 
          "key": "pitch", 
          "id": 3
        }, 
        {
          "scale": -1.0, 
          "type": "Input.BUTTON", 
          "id": 0, 
          "key": "pitchcal", 
          "name": "pitchNeg"
        }, 
        {
          "scale": 1.0, 
          "type": "Input.BUTTON", 
          "id": 3, 
          "key": "pitchcal", 
          "name": "pitchPos"
        }, 
        {
          "scale": 1.0, 
          "type": "Input.BUTTON", 
          "id": 7, 
          "key": "estop", 
          "name": "killswitch"
        }, 
        {
          "scale": -1.0, 
          "type": "Input.BUTTON", 
          "id": 2, 
          "key": "rollcal", 
          "name": "rollNeg"
        }, 
        {
          "scale": 1.0, 
          "type": "Input.BUTTON", 
          "id": 1, 
          "key": "rollcal", 
          "name": "rollPos"
        }, 
        {
          "scale": 1.0, 
          "type": "Input.BUTTON", 
          "id": 6, 
          "key": "exit", 
          "name": "exitapp"
        }
      ]
    }
  }
}
The next step is to make a Shutdown-Botton for my Raspberri Pi.
dboyle
Beginner
Posts: 4
Joined: Thu Mar 20, 2014 3:47 am

Re: Raspberry Pi Troubles

Post by dboyle »

Hey guys,

I've been working on setting up a base station with the raspberry pi, based on all the instructions posted by the community on the website, and this forum. I've successfully been running off battery power, and am using peripherals using a hub. I think I am very close to being able to fly.

I am encountering a problem when I start up the software. Here is the status script that prints to the raspberry pi screen:
  • pi@raspberrypi ~ $ python ~/crazyflie-pc-client/bin/cfheadless -i PS_#1 -c 0
    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.config_manager:Parsing [PS3_Mode_2.json]
    INFO:cfclient.utils.config_manager:Parsing [xbox360_mode1.json]
    INFO:cfclient.utils.config_manager:Parsing [PS_#1.json]
    INFO:cfclient.utils.config_manager:Parsing [PS3_Mode_3.json]
    INFO:cfclient.utils.config_manager:Parsing [Generic_OS_X.json]
    INFO:cfclient.utils.config_manager:Parsing [xbox360_mode1_linux.json]
    INFO:cfclient.utils.config_manager:Parsing [PS3_Mode_1.json]
    Will use [Twin USB Joystick] for input
    INFO:cflib.crazyflie:Callback->Connection initialized[radio://0/10/250K]
    INFO:cflib.crazyflie:We are connected[radio://0/10/250K], request connection setup
    WARNING:cflib.crazyflie:ExpectAnswer: ERROR! Older timer whas running while scheduling new one on [5]
    WARNING:cflib.crazyflie:ExpectAnswer: ERROR! Older timer whas running while scheduling new one on [5]
    WARNING:cflib.crazyflie:ExpectAnswer: ERROR! Older timer whas running while scheduling new one on [5]
    INFO:cflib.crazyflie:Callback->Connected to [radio://0/10/250K]
    ERROR:cflib.crazyflie.toc:Got packet that was not on TOC channel, TOC fetch will probably not succeed
    INFO:cflib.crazyflie.toc:TOC for port [5] found in cache
    INFO:cflib.crazyflie:Log TOC finished updating
    INFO:cflib.crazyflie.toc:TOC for port [2] found in cache
    INFO:cflib.crazyflie:Param TOC finished updating
    INFO:cflib.crazyflie:Callback->Connection setup finished [radio://0/10/250K]
I believe that I am having a problem with the controller I am using. I'm using a playstation 2 controller, connected to the system using a PS2 to USB converter. For some background, I pilot the crazyflie successfully from my computer, using my own own json file. However, when I first began, I found that my computer recognized two playstation controllers in the device manager. In order to fly the crazyflie, I had to disable the second PS2 controller that my computer was recognizing. I believe my raspberry pi problem is somehow analogous to the problem I had on my computer. That is my best guess. I have done research on how to disable devices recognized by the pi; however they did not produce any significant leads. I might also add, that my controller is recognized by the "joystick" program that I downloaded. All the buttons produce change in numbers when I run "jstest".

I look forward to reading anyone's suggestions, in helping to identify the problem and the solution.
Post Reply