Skip to content

Latest commit

 

History

History
122 lines (104 loc) · 5.25 KB

DRONE_SETUP.md

File metadata and controls

122 lines (104 loc) · 5.25 KB

Drone setup

Follow these step-by-step instructions to properly setup the CogniFly drone from zero.

Flight controller configuration

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 select load 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

Raspberry Pi configuration

Raspbian image:

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, or dd 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 require sudo)
      • adapt the following to your WiFi network in the wpa_supplicant.conf file:
        network={
                ssid="yourNetworkSSID"
                psk="yourNetworkPassword"
                scan_ssid=1
        }
        
  • change the name of the drone:
    • edit the /rootfs/etc/hostname file
      • replace the default K00 by your drone name
    • edit the /rootfs/etc/hosts file
      • replace the default K00 in the last line by your drone name
  • plug the SD card into the Raspberry Pi
  • plug a charged battery to start the drone
  • password for the user pi: maplesyrup

Manual installation:

(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
  • configure wpa-supplicant so the drone connects to your router:

    • edit the /rootfs/etc/wpa_supplicant/wpa_supplicant.conf file (on linux, this may require sudo)
      • adapt the following and add it to the end of the wpa_supplicant.conf file:
        network={
                ssid="yourNetworkSSID"
                psk="yourNetworkPassword"
                scan_ssid=1
        }
        
  • change the name of the drone:

    • edit the /rootfs/etc/hostname file
      • replace the default raspberrypi by your drone name
    • edit the /rootfs/etc/hosts file
      • replace the default raspberrypi in the last line by your drone name
  • 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
        
  • disable the console messages in the serial port:

    • edit the /boot/cmdline.txt file
      • if you see console=serial0,115200, remove this command
  • 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.