CrazyFlie RPi Image wont boot on model b+

Discussions and questions about the Crazyflie Nano Quadcopter
Post Reply
nimble
Beginner
Posts: 19
Joined: Tue Dec 16, 2014 12:20 am

CrazyFlie RPi Image wont boot on model b+

Post by nimble »

I've downloaded the 0.3 image and used Win32DiskImager to write to an 8GB SD - then plugged it into a model B+

No boot - HDMI never outputs anything - LEDS on board are totally idle except for the red power light.

Should this work? Any image for the B should work for B+ right?
(Nothing wrong with the pi - other SD's boot).
chad
Expert
Posts: 555
Joined: Sun Sep 28, 2014 12:54 am
Location: New York, USA
Contact:

Re: CrazyFlie RPi Image wont boot on model b+

Post by chad »

Interesting. Maybe the version of Raspbian it's based on is too old for the B+...? I have a B+ but I haven't tried the 0.3 image on it yet. I'll give it a try later tonight and report back.

You can also just install the latest Raspbian image and add the Bitcraze stuff over it (which is basically all Bitcraze did). Those instructions might be a little outdated what with the new release and all so YMMV.

Someday I'll get a chance to make a blog post about the script I use to overlay the Bitcraze stuff on a Raspbian image. I basically just tar'd up the Bitcraze directories from the 0.3 install and created a bash script "installer" to untar them into the Raspbian install. It works fairly well and makes it easier to use a stock image. I just haven't had time to update it for 2.0 yet...

Here it is in the "code" section if you're curious and want to try it out. Save it as a shell script, make it executable, and run it on a stock Raspbian install. You gotta run it as root. Bear in mind, it's for Crazyflie 1.0 not 2.0 (yet)... No guarantees and no warranty, etc, etc...

Code: Select all

#!/bin/bash

# Installed content Copyright 2011-2014 Bitcraze AB
# Installer script Copyright 2014 Chad Stanke
#
# This work is licensed under the Creative Commons Attribution-ShareAlike 
# 4.0 International License. To view a copy of this license, 
# visit http://creativecommons.org/licenses/by-sa/4.0/.


# WTF is this!? This adds the bitcraze stuff to a regular Debian Wheezy Raspbian
# image. You can take the default image and run this on it to get a headless
# crazyflie flight controller. The blocks of randomy looking text is gziped
# files and folders taken from the Bitcraze 0.3 Raspbian image at:
# https://github.com/bitcraze/bitcraze-raspberry-pi
# Then, we simply make some tweaks to get things like I want them (like moving the stuff in /boot to /etc).
# Simple, clean, and fast!

# install bitcraze RaspberryPi additions

BITCRAZE_USER_NAME=bitcraze
BITCRAZE_USER_PASS=crazyflie

if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi

apt-get update
apt-get -y upgrade
apt-get -y install python-usb xboxdrv
useradd --create-home -G adm,dialout,cdrom,sudo,audio,video,plugdev,games,users,netdev,input -p $(openssl passwd -1 ${BITCRAZE_USER_PASS}) ${BITCRAZE_USER_NAME}


# /boot/crazyflie - NOPE
# /etc/crazyflie
INSTALL_DIR="/etc/" # was /boot/ - need to fix up aliases pointing to /boot...
cat <<EOF | openssl enc -base64 -d | tar -xzpf - -C "${INSTALL_DIR}"
H4sIAAHlHVMAA+1dUW/aOhTuM9L9DxZPd7orjWMgU9+63epqmrZWayft6qpCLrjF
a5pESRhlU//7tZ2EsGA7lIJJh89DC3Zy8mH7+Hz28YFhjH/MbnxKjg62Jg4Tz+uJ
/0zy/93ivSiDLnI81HeRx8ohRMg7AL3tQSplkqQ4BuAgDsNUdx0e3ZuAY1qG8/73
aXDXGYbBzcafUdv/rpv3v+e4fZf1P2ID4AA4G0cikT3v/xiPaHh8dOQcQefI7Tkf
WrtGZMWklPbPTD+NQ98n8aZngVr7hyi3/56L+nz+7/J/1v4NyPkFGnwMR2QAreHv
o5T2T4Nokm6FBa7O/3quh7j/d7sesvzPhFT7/+E6fEB9Z3DP5gTY+ZaEwfOfUdP/
qI9Qpf97fc/O/0bk5x8tANqi77nXp7ftYyDKitIR+U6HpCxl5ZNohFMSkZiGI1YB
nddgXhfge35x+5dx1F64AD/QhF3wX1EASsWiPhlin2s4hJ0FvaIqnUVC93uOq3Py
9f1Fu3IF5XhQpfCOzPhd6ThmfV29o8Cb15Z1j4sXyiGujbArRzjDUxU8XmUGW/W2
HBtnhipwou5J6NbvXCiHF9F0OFbhyyo3C/Dtl8vLs09PaUGBgqnXovxEbjfbzxqc
CjtZCed5mBjD6clxkiQNIxXIO+r7ydRsv7tqy9E0J6822esKA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v0ZSYXKz2dttlXjyTNR1xdYe03Yso
LWg4OBC8yuKjN80urKttlzNODvbUhn1YW+thdjuZR4E81HL+JbqZRzOJoWrWVao7
D9ceAAAAAAAAAAAAAAAAAACczTtDTFfHACgAAA==
EOF

# /etc/udev/rules.d
INSTALL_DIR="/etc/udev/rules.d/"
cat <<EOF | openssl enc -base64 -d | tar -xzpf - -C "${INSTALL_DIR}"
H4sIAEvkHVMAA+3TTUvDMBgH8J73KUqvWpu0TUoOPSgOT3OjL4LHdqk6GIukzRiI
393Ug2+wdWDxBf6/S8jzFB4anr8Q/vLuoankumlbvzKdartKd2fa2IIzDmLxOH49
ra8nieLIoSHlnFBCGHMIZSEljktGmn+Q6f/XdR2tVHfou6H+P5WXF/ltXkxnaeqZ
tvZO3fOiyPKnlbxpNlLpZ1ungrIPjYVW0iy7vpNYtjObX07tjXAe29tVNi8Xqfe4
Nvey2dpCVl6fpF7Qv2BQrzbB+8J5k+/NtwtDh+ZPfvuJ/zQh/F2tdlJvR438J0P5
pyx5yz8lff5Dxjjy/xOOyR+JWbMnfwkVxyS+X7GIE2QRAAAAAAAAAAAAAAAAAAAA
YHQvMxP62AAoAAA=
EOF

# /home/bitcraze
INSTALL_DIR="/home/bitcraze/"
cat <<EOF | openssl enc -base64 -d | tar -xzpf - -C "${INSTALL_DIR}"
H4sIADaEr1MAA+1YW2/bNhTOs37F2dMuqCVZsWOgQDE0aboGaIeuF+yxpSXK4iKT
GklV8379PlIXO46Nogi8ragOAigSD8/94zn0m+unz15dh/Yve3YyiuP4YjYjPKeL
+bR7Ju7paT6fLWianMeL81mymJ1TPI0Xi8UZxaczaUu1sUzDlIfKaX2h4fmV0JVm
f2/yUnD6lUlFv9UsS1VluQ4mxyh4VwhDYs1WnPCPqXgqWFluaM0yTlbRklNteEbM
EKOVVrXMCFG2QskgV5pswemo3jAInpYN2xhKC57eUr+hZJYbS0Liw9rLIvy5lUth
U0jj9Lu4FQGzVFhbPY6iBq/hslsMDQ+CF6qhTNGN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gj
vE8YnrAnmMZDP19yjHLct1bbSuwqdn8SCG7ytvnz1uKX18/uxLE7G9005PxYac5l
O8EEwp0cQ+njJMnJfxqYNWAO69acSdMiB284BqSywfHZJLjys2mpVm5+o8iuq2g7
34T47ufWNV4wJZsg+K/H/KO0N1aeRAfuQ7jPHb3/+ftSe/+bJ4vFjOIkPr+4OKMk
cnjbQjo6hbHf+P1vuEKcUMcX5P8ca7j/zy8WyYH8n8LYbzz//pbzYXt2nUKHy/98
fjz/yTTpf/+JL6bA/zSZJ/H4+8+/QXd/a4g+O4hF7cwzXOUnNX1M0TX35AxI/UgT
cZBj7yz/+P9tkSONNNJII4000kgjjTTSSCONNNJII4301dI/8Q7ecAAoAAA=
EOF
chgrp -R ${BITCRAZE_USER_NAME} /home/bitcraze

# Finally, reload the rules and we're all good!
udevadm control --reload-rules

# Get the bitcraze source
su ${BITCRAZE_USER_NAME} -c "mkdir ~/projects"
su ${BITCRAZE_USER_NAME} -c "git clone https://github.com/bitcraze/crazyflie-clients-python.git ~/projects/crazyflie-clients-python"
su ${BITCRAZE_USER_NAME} -c "git clone https://github.com/bitcraze/crazyflie-firmware.git ~/projects/crazyflie-firmware"

# Fix up the links (since we moved our configs from /boot to /etc
su ${BITCRAZE_USER_NAME} -c "ln -sf /etc/crazyflie/controller.conf ~/controller.conf"
su ${BITCRAZE_USER_NAME} -c "ln -sf /etc/crazyflie/link.conf ~/link.conf"
su ${BITCRAZE_USER_NAME} -c "mkdir -p ~/projects/crazyflie-clients-python/conf/cache"
su ${BITCRAZE_USER_NAME} -c "ln -s /etc/crazyflie/input/ ~/projects/crazyflie-clients-python/conf/input"

exit 0
Last edited by chad on Thu Dec 18, 2014 7:45 am, edited 4 times in total.
Crazyflier - my CF journal...
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.
chad
Expert
Posts: 555
Joined: Sun Sep 28, 2014 12:54 am
Location: New York, USA
Contact:

Re: CrazyFlie RPi Image wont boot on model b+

Post by chad »

Yep. Sure enough my B+ doesn't boot from the 0.3 image either. Thanks for giving me a reason to open my B+ box though. ;-)

I'm going to try to install the latest Raspbian image and see if I can detail the steps necessary (using that script I posted) to get a headless Pi B+ ground controller running. I've used my Pi 'B' for the last 6 months with my CF1.0 and I love it! I haven't received my CF2.0 yet so I can't be of much help there right now.

I'll post back when I have a chance.
Crazyflier - my CF journal...
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.
chad
Expert
Posts: 555
Joined: Sun Sep 28, 2014 12:54 am
Location: New York, USA
Contact:

Re: CrazyFlie RPi Image wont boot on model b+

Post by chad »

Ok. My script will work but you can't run with the latest cfclient. Unfortunately, as far as I can tell, python-sdl2 is not available in the Raspbian Wheezy repository. That's unfortunate because the head of master branch of crazyflie-client-python in Git requires SDL2 now. I logged a bug against it.

So, if you run my script and checkout the crazyflie-client-python to a specific revision, you can use RaspberryPi B+ for CF1.0 - not sure for 2.0 though (like I say, haven't got mine yet so I can't check it out)...

Anyway, here's the steps FWIW:
  • Flash latest Raspbian image to SD card.
  • Boot RaspberryPi B+ using said SD card.
  • Get the script onto your RaspberryPi however you want: SSH, USB thumbdrive, SD Card reader, etc...
  • Copy script to pi's home directory call it installcf.sh
  • While logged in as 'pi', run the following in a command prompt:

    Code: Select all

    cd 
    chmod 755 installcf.sh
    sudo ./installcf.sh
  • Wait a while for apt-get updates
  • Edit for your controller profile and link info

    Code: Select all

    sudo su - bitcraze
  • Add your link info (i.e. radio://0/3/2M)

    Code: Select all

    nano -wz link.conf
  • Add your controller info (i.e. PS3_Mode_2)

    Code: Select all

    nano -wz controller.conf
  • Update (downgrade) cfclient to a usable state

    Code: Select all

    cd ~/projects/crazyflie-client-python
    git checkout 97592cf2805ca79e0dfa496a20329ad831e2d03f
  • Reboot the RaspberryPi

    Code: Select all

    exit
    sudo reboot
  • Finally, plug in your controller, turn on your Crazyflie, and plug in the Crazyradio.
That ought to get something working. Good luck. ;-)
Crazyflier - my CF journal...
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.
chad
Expert
Posts: 555
Joined: Sun Sep 28, 2014 12:54 am
Location: New York, USA
Contact:

Re: CrazyFlie RPi Image wont boot on model b+

Post by chad »

Marcus (one of the Bitcraze guys) said they're working a Raspbian image right now so you should have a solution soon. Also, he mentioned that the SDL2 dependency could be installed via Python pip but, since I'm at work all day today, I haven't had a chance to try it out and capture the steps. I'll try if I have the time tonight. In any case, I think SDL2 on Linux has issues presently so it might just be a good idea to wait... Then again, I thought I saw a post from you saying your CF flew away!?!? :-( Bummer. Maybe this is all moot to you now.
Crazyflier - my CF journal...
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.
nimble
Beginner
Posts: 19
Joined: Tue Dec 16, 2014 12:20 am

Re: CrazyFlie RPi Image wont boot on model b+

Post by nimble »

Forgot about this thread!
Yes, my Crazyflie flew away a couple of days after posting that. Damn shame really. Not moot however! I have ordered 2 more just before xmas, they have supposedly shipped, I'm just waiting for the tracking number to be activated on SingPost.

Yes, you read that right - I ordered 2.. I really hope I don't have another flyaway, but I really want to hack this thing, so plan for the worst...

This is getting expensive :(

Thanks for the updates, I'll be looking forward to the updated image for B+
nimble
Beginner
Posts: 19
Joined: Tue Dec 16, 2014 12:20 am

Re: CrazyFlie RPi Image wont boot on model b+

Post by nimble »

Hi Chad,

Thanks so much for posting the scripts and instructions. I ran your script, and followed the instructions but skipped step "Update (downgrade) cfclient to a usable state" and it worked perfectly. I now have a fully functioning pi controller, RPiB+/CF2/PS4/CrazyRadio.

Great work!!

Thanks,

Adam
chad
Expert
Posts: 555
Joined: Sun Sep 28, 2014 12:54 am
Location: New York, USA
Contact:

Re: CrazyFlie RPi Image wont boot on model b+

Post by chad »

Awesome! Happy to hear you're flying again!!
Crazyflier - my CF journal...
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.
Post Reply