Local Software Setup¶
All of the software and installation processes were only tested on a Windows 11 computer. For Mac and Linux users some software may be very similar to Windows (e.g. RPi imager, VS Code), but some steps (e.g. X11 forwarding) might be different to what is shown in these instructions.
If you run into any problems with the software setup, please post an issue at the GitHub repo.
Raspberry Pi Imager¶
Download RPi Imager and install it to your computer. We will use the official Raspberry Pi Imager to download and install Raspberry Pi OS Lite to the microSD card and configure some important options, which are shown in the next section.
Visual Studio Code¶
Download VS Code and install
it to your computer. Install all recommended extensions listed under
Using Visual Studio Code to connect to your Raspberry Pi via
SSH is highly
recommended. More information on how to set up VS Code can be found in the
If you want to use the Raspberry Pi Zero 2 W as a remote development environment,
install the VS Code extensions listed under
Advanced (not recommended for normal users).
- Remote - SSH extension to use the Raspberry Pi Zero 2 W as a remote development environment with more functions, including Pylint support. Not supported by RPi Zero W (v1)!
- Remote X11 extension to forward the OAK-1 camera stream received from the Raspberry Pi via X11 and show it on your local PC. Required if you are using the Remote - SSH extension instead of connecting via the Terminal.
- Save Commands extension if you want to save some often used terminal commands for direct execution.
VcXsrv Windows X Server¶
Download VcXsrv and
install it to your computer. To be able to see the OAK-1 camera stream that is
sent to the Raspberry Pi on your local computer, you will need to install a X
server if you are communicating with the RPi via SSH. Start the X server with
XLaunch.exe and keep all the default settings:
Select display settings:
- Multiple windows
- Display number:
Select how to start clients:
- Start no client
- Primary Selection
- Native opengl
After that you will see the VcXsrv tray icon in the taskbar and running e.g. one of the preview scripts will open the OAK-1 camera stream in a new VcXsrv window on your computer.
Download DiskInternals LinuxReader and install it to your computer. You can use DiskInternals LinuxReader to save data from the Raspberry Pi's SD card to your local computer. This is only necessary if you are not using a Linux-based OS, as the Linux partition format is not compatible with Windows.
After collecting the microSD card from your camera trap, follow these steps to save the captured images and metadata:
- Insert the Raspberry Pi's microSD card into your card reader and open DiskInternals
LinuxReader. You will see two partitions on the SD card:
- Double-click on the
rootfspartition and navigate to the
- Select the
insect-detectfolder and click the Save button in the upper menu bar to copy it to your PC.
- Keep the Save Files option, choose your output folder and select both options Save directory structure and Extract file date from metadata.
Download Python 3.11.6 and install it to your computer, while keeping all the default settings (select Install Now). The latest version 3.12 is not yet supported by some packages. You will need Python to run the scripts for classification of the captured insect images and subsequent analysis and post-processing of the metadata.
We are going to use the
for Windows to run Python scripts with the
py command. You can check if the
Python Launcher works correctly and display the installed Python version(s),
by opening a Terminal (e.g. Windows PowerShell) and running:
After installing the Python extension,
you can activate Python in VS Code by opening the Command Palette with
Ctrl+Shift+P and running the
Python: Select Interpreter command. You can find a
Getting started tutorial
and more information on
Python in VS Code
at the official VS Code Docs.