Some comments on Raspberry Pi setup

Discussions and questions about the Crazyflie Nano Quadcopter
Post Reply
hsanjuan
Beginner
Posts: 19
Joined: Sat Jul 20, 2013 10:51 am

Some comments on Raspberry Pi setup

Post by hsanjuan »

Hi all,

since I find my indoors rather small to take full advantage of my CF, I bought a RPi and a 9000mAh battery Powerbank (with an 5v/1A output) and followed the wiki page to set things up. I used the RPi official Raspian image and set things by myself rather than downloading the preconfigured image. All works mostly as expected :) Still there are a few small things that could be fixed in Wiki (http://wiki.bitcraze.se/projects:crazyf ... rasberrypi). I put them here since I didn't find a way to register and do it myself:
  • dev-headless branch has been merged to master, so there is no need to hg up dev-headless
  • Apart from setting up the UDEV rule for, I think you have to make sure that your RPi user is in the input group (or games group Im not sure), otherwise it won't be able to reach the controller.
  • On the part about configuring autostart of the headless client, The UDEV rule does not get triggered on remove. Not that it really matters (I think cfheadless dies anyway when removing the radio), but after playing a lot (udev is quite picky with that) I ended up with:

Code: Select all

ACTION=="add", SUBSYSTEM=="usb", ENV{ID_VENDOR_ID}=="1915", ENV{ID_MODEL_ID}=="7777", MODE="0664", GROUP="plugdev", RUN+="/home/hector/bin/cfheadless-run"
ACTION=="remove", ENV{ID_VENDOR_ID}=="1915", ENV{ID_MODEL_ID}=="7777", RUN+="/home/hector/bin/cfheadless-run"
  • There is no need to reboot to have the new udev rules loaded, you can just

Code: Select all

udevadm control --reload-rules
  • I placed the cfheadless-run scripts in my home folder, I'd say there is no need to have these scripts in root's home. As a general rule, I try to use root access the least I can.
  • I also change the logging of the cfheadless output to /var/log, which is "the place" for logs. I also log everything (not just a single run) and I don't want this file to be cleaned up on a reboot or something.
  • Added a couple of udev rules to run a proper shutdown by RPi 1 minute after my controller is unplugged, which is handy if you are outside without screen or anything.
  • The shutdown command (sudo shutdown -h now -r) is wrong, along with the explanation on -r and -h. It works but it's just not the way (see man shutdown). It should be:

    Code: Select all

    sudo shutdown -r now
Next I'm going to look is how to tweak the advanced settings from the cfheadless mode (tips welcome) to smooth rates a little bit. Keep up the good job guys!
humblehacker
Member
Posts: 34
Joined: Thu May 16, 2013 7:42 pm

Re: Some comments on Raspberry Pi setup

Post by humblehacker »

I will try your suggestions as the method outlined in http://wiki.bitcraze.se/projects:crazyf ... aspberrypi does not appear to be working for me... While useradd confirms that "user 'bitcraze' already exists" it will not accept the password "crazyflie" either in the login screen or through ssh. When I reboot, the boot behaviour still follows the normal procedure where it requires a raspberrypi login. Here too, it will only accept the default "pi" and "raspberry" login/password.
One question I have for anyone working with the cfheadless on RPi- Which version of Raspbian are you using? Are you using the latest official "New Out-Of-the-Box-Software AKA NOOBS" http://www.raspberrypi.org/downloads. If not, this may become an issue with new users as NOOBS has been packaged very differently than earlier RASPBIAN releases. According to the instructions-
We recommend that first-time Pi users start by downloading and installing our New Out of Box Software (NOOBS) onto a 4GB (or larger) SD card. On first boot, this presents you with a choice of operating systems to install, including Raspbian, Pidora and two flavours of XBMC. Once you have installed an operating system, you can return to the NOOBS interface by holding down shift during boot; this allows you to switch to a different operating system, or overwrite a corrupted card with a fresh install of the current one.


The problem comes when the NOOBS defaults to the recovery image before booting the OS selected by the user at setup. Some users have reported this screwing up autostart functions, and I'm wondering if this is whats happening in my situation.
Has anybody tried the cfheadless client in the NOOBS image? Should the wiki instead be updated to recommend downloading Raspbian-only?
Also, I should add that I tried to burn the precompiled SD image per the blog post - http://www.bitcraze.se/2013/07/raspberr ... ard-image/ and it failed to load on the RPi in every attempt I made. The same SD Cards subsequently worked without a hitch using the same flashing method on a standard Raspbian OS. Is it still confirmed working?
Post Reply