Skip to content

OTCamera Dev Version

The Raspberry Pi Zero is wonderful to use outside (it consumes little power, is cheap, ...). But the development of OTCamera is more fun on a big Pi. Everything is much faster.

You will need

  • a prepared Raspberry Pi 2B/3B(+)/4 (the 2 GB works well)
  • Camera module (no USB webcam)

Setup VS Code Remote Development Extension

Install the Remote-SSH extension on your desktop using the marketplace.

Add the Pi as remote host. Connect to the Pi using the Remote-SSH extension (rightclick on the ne host - "Connect to Host in New Window"). When asked for the operating system of the host, choose "Linux". VS code will download and install the necessary dependencies on the Pi.

Open the extension manager in the new windows an install all necessary extensions.

Install a virtual environment and all requirements.

sudo apt install python3-venv -y
python -m venv venv --upgrade-deps
pip install -r requirements.txt -r requirements-dev.txt -U

Setup Git and GitHub

If not already done install git using apt.

sudo apt install git -y

To setup your git commit name and email, login to your GitHub account and copy your private commit email.

On the pi run

git config --global user.name "Your Name"
git config --global user.email "123456+username@users.noreply.github.com"

The easiest way to setup your GitHub credentials is to use vs code. In the file explorer panel click "Clone Repository" and choose "Clone from GitHub". Depending on your desktop computer settings, a browser tab will open to login into your GitHub account. Afterwards, you can search for "OpenTrafficCam/OTCamera" inside the vs code command prompt and select a folder to pull (choose /home/pi by default).

Install Screen to Run OTCamera in Background

Quote

Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells.

To install screen on the developer pi just run

sudo apt install screen -y

You can now start screen and use it as an usual terminal. You can run the python OTCamera to start the camera in an active screen session. Hit Ctrl+A and then D to detach the current session. Screen will still run in background including the OTCamera. If you start screen including the -r option you can reconnect to this terminal session:

screen -r

You can safely disconnect you ssh connection to the pi, while the screen session is still running.

Ready to Develop

You should now be ready to pull the OTCamera repository and start developing.