In most of recent main Linux distributions, a new concept is used to boot the system. The former systemV process is replaced by the sytemd organization. This means that the way to make a Rasberry nano computer as a base station to fly a Crazyflie is no longer available (see https://wiki.bitcraze.io/misc:hacks:rasberrypi). The client software is launched when connecting the Crazyradio but after a short time the client stops (25 seconds in my case).
A way to overcome this difficulty is to create a new "service" in the system which launches the headless client. Now, connecting the Crazyradio runs a script in the directory /root/bin, as before but this script calls the new service which has no time out.
The service is defined through the following script:
§§§ FILE cfheadless.service
[Unit]
Description=Client Crazyflie
After=tlp-init.service
[Service]
Type=oneshot
RemainAfterExit=no
ExecStart=/usr/local/bin/cfheadless -i -u radio://0/80/250K
[Install]
WantedBy=multi-user.target
§§§END OF FILE
where is one of the existing maps in the ../src/cfclient/configs/input directory. You can choose your own map by putting it in that place. The radio URI is as usual in Crazyflie client.
In my Debian distributions this script is placed in the directory /etc/systemd/system. Its owner must be root and can be executed by everybody (+x).
The new headless.sh file is now:
§§§ FILE headless.sh
#! /bin/sh
if test "$ACTION" = "add"
then
sudo systemctl start cfheadless.service
echo $! > /tmp/cfheadless.pid
else
killall -9 cfheadless
if test -f /tmp/cfheadless.pid
then
PID = cat /tmp/cfheadless.pid
kill -9 $PID
fi
fi
§§§END OF FILE
Perhaps some tuning must be made according to your Raspberry's Linux system. The proposed solution was tested "working" on a Raspberry Pi2 with Raspbian jessie system.