Getting started with the AI deck

Introduction

The AI deck  enables WiFi communication with the Crazyflie® as well as using the power-efficient GAP8 to run neural networks on board. This tutorial gets your AI deck  to stream camera images to your computer with NanoCockpit, which we recommend for the AI-deck. Each step links to the documentation in our GAP8 example repository, where you find the details.

Prerequisites

Make sure that you have gone through the Getting started with the Crazyflie 2.0 or Crazyflie 2.1(+) tutorial first.

To run this tutorial and set up the AI deck you will need the following:

Attach the AI-deck

The AI-deck can be mounted both on top and on the bottom using the provided long header pins. Either position might yield different pros & cons but for development when a JTAG cable needs to be attached the top position works best. Note though that the ESP32 antenna is a bit fragile and can be damaged during crashes. For better resilience during crashes, mount the AI-deck at the bottom, or put a peace of hot-glue as shown in the picture below.

led deck on Crazyflie

Preparing the firmware

NanoCockpit needs its own firmware on both chips of the AI-deck: the ESP32 firmware for NanoCockpit, and a NanoCockpit application on the GAP8.

Update the Crazyflie firmware

With the AI-deck mounted, update the Crazyflie to the latest release, as described in the firmware upgrade section of the cfclient user guide. The release also contains the ESP32 firmware for NanoCockpit, which is flashed to the AI-deck automatically.

When it runs, the AI-deck creates the WiFi network aideck-nanocockpit.

Flash the streamer

Flash the NanoCockpit streamer to the GAP8 with the JTAG programmer. It is released as a ready-made image, so there is nothing to build, see flashing the example.

Start the viewer

The viewer runs from a copy of the GAP8 example repository. If you do not have one yet, clone it:

git clone https://github.com/bitcraze/aideck-gap8-examples.git

Then install the viewer, connect your computer to the aideck-nanocockpit network and start the viewer, as described in starting the viewer. The viewer shows the camera images of the AI-deck.

Next steps

Your AI deck  is now running NanoCockpit. From here you can

  • read the rest of the streamer documentation, for example to change the resolution or exposure of the camera, or to save the state of the Crazyflie together with the images
  • connect the AI deck  to an existing WiFi network instead, see the WiFi configuration of the ESP32 firmware
  • try the other NanoCockpit examples, for example a neural network running on board, or use them as a starting point for your own application

The other examples in the repository use the original ESP32 firmware instead. See switching firmware for how to go from one to the other.

Further reading