Follow these step-by-step instructions to properly setup the CogniFly drone from zero.
- download both the cognifly framework and the cognifly configuration files
- connect the flight controller to your PC through USB
- launch inav-configurator 2.3.2 (on linux, do it with
sudo
) connect
to the flight controller- open the
CLI
tab and enter the following command:
dfu
This will disconnect the flight controller and restart it in DFU mode.
- open the
firmware flasher
tab - make sure
full chip erase
is selected - click
load firmware [local]
- select the cognifly framework file previously downloaded (
.hex
file) - click
flash firmware
and wait for completion connect
to the flight controller, select keep defaults, let it reboot,connect
again- open the
CLI
tab and selectload from file
- navigate to the cognifly configuration file previously downloaded (
.txt
file) - click
execute
and wait for completion- (NB: check for errors in the logs and ensure the whole .txt has been processed)
- enter the following command:
save
This will reboot the flight controller.
connect
to the flight controller again- in the
setup
tab, check that everything is green - (optional) go to the
calibration
tab and follow the calibration instructions - go to the
mixer
tab and follow the inav instructions to configure the 4 motors properly disconnect
from the flight controller
The easiest way of using cognifly-python
is to flash our readily set up Rasbian image on your SD card.
- download the Cognifly Raspbian image
- extract the archive
- you should now see the extracted file named
cognifly.img
- flash
cognifly.img
on your SD card (e.g., using Win32 Disk Imager on Windows, ordd
on Linux) - in the now flashed SD card, configure wpa-supplicant so the drone connects to your router:
- edit the
/rootfs/etc/wpa_supplicant/wpa_supplicant.conf
file (on linux, this may requiresudo
)- adapt the following to your WiFi network in the
wpa_supplicant.conf
file:network={ ssid="yourNetworkSSID" psk="yourNetworkPassword" scan_ssid=1 }
- adapt the following to your WiFi network in the
- edit the
- change the name of the drone:
- edit the
/rootfs/etc/hostname
file- replace the default
K00
by your drone name
- replace the default
- edit the
/rootfs/etc/hosts
file- replace the default
K00
in the last line by your drone name
- replace the default
- edit the
- plug the SD card into the Raspberry Pi
- plug a charged battery to start the drone
- password for the user pi:
maplesyrup
(Note: if using the Raspbian image, you can ignore this section.)
In case you wish to install the library on your own Raspbian:
- install raspbian on the SD card (you can use Raspberry Pi OS Lite)
(Note: You can use Raspberry Pi Imager to install raspbian, which provides a GUI to skip most of the following.)
The SD card should now have two partitions: boot
and rootfs
-
configure SSH access:
- create an empty file named
ssh
at the root of the/boot/
partition
- create an empty file named
-
configure wpa-supplicant so the drone connects to your router:
- edit the
/rootfs/etc/wpa_supplicant/wpa_supplicant.conf
file (on linux, this may requiresudo
)- adapt the following and add it to the end of the
wpa_supplicant.conf
file:network={ ssid="yourNetworkSSID" psk="yourNetworkPassword" scan_ssid=1 }
- adapt the following and add it to the end of the
- edit the
-
change the name of the drone:
- edit the
/rootfs/etc/hostname
file- replace the default
raspberrypi
by your drone name
- replace the default
- edit the
/rootfs/etc/hosts
file- replace the default
raspberrypi
in the last line by your drone name
- replace the default
- edit the
-
enable the pi camera and the UART serial port:
- edit the
/boot/config.txt
file- under the
[all]
section, set the following lines:enable_uart=1 # serial port start_x=1 # camera gpu_mem=128 # camera
- under the
- edit the
-
disable the console messages in the serial port:
- edit the
/boot/cmdline.txt
file- if you see
console=serial0,115200
, remove this command
- if you see
- edit the
-
plug the SD card into the Raspberry Pi
-
plug a charged battery to start the drone
-
wait for the Raspberry PI to boot (the light should stop blinking)
-
ssh the drone from your computer (the default password should be
raspberry
):ssh pi@myDroneName.local
-
execute the following on the Raspberry Pi:
sudo apt-get update sudo apt-get install libatlas-base-dev libopenjp2-7 libtiff5 python3-pip
You can now install the cognifly-python
library on the drone.