Development Environment

Overview

The setup shown in the figure is used to do some experiments with the Raspberry Pi. Some components in this figure are not strictly necessary. A dotted border indicates such optional components.

Description

The PC’s main purpose is to manage the Raspberry Pi (RPi). Tasks that require a greater computational load than can be handled sufficiently fast on the RPi are processed on the PC whenever appropriate. In this respect the RPi serves as sensor node to:

  • gather pieces of data
  • do some less time-consuming pre-processing
  • transfer data to the PC for further data processing.

Communication between PC and Raspiberry Pi is via Wifi routers. The internal WLAN adapters of the PC and the RPi establish a communication link via Wifi router#1. This router has access to the internet thus allowing to do software updates on the RPi online.

Using (optional) external Wlan adapters on the PC and the RPi and a second Wifi router#2 provides another communication link. The secondary link is not strictly required. There are cases however where it helps to decouple communication task.

Wireless communication between internal / external Wlan adapters can be configured either to use the 2.4 GHz or the 5.5 GHz band. Moreover we have some more control over the transmit power and the type of antenna when using external WLAN adapters, which may help to extend the communication range (physical separation of PC and RPi) and/or the data rate for communication.

The next sections provide some more details on the components used in the setup of Figure 1‑1. . To keep this overview short special topics are elaborated on in separate documents.

Raspberry Pi

a list of properties as obtained with command cat /etc/release

Hardware: Raspberry Pi 4 Model B ; 8 GB RAM
Operating system:
cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Installed software

To support tasks such as

  • networking (SSH, HTTP, Websocket)
  • numerical processing
  • image processing

additional Python packages (not part of the Linux distribution of the RPi) had to be installed. My current setup required installation of these Python packages:

Python packageDescription
Flaskweb applications
jinja2templating engine
lxmlXML and HTML processing
numpypackage for scientific computing
paramikossh client and server
picamera2most Raspian distribution come with picamera pre-installed; picamera2 is a replacement to picamera
Pillowimage processing (may be replaced by opencv in most cases)
pyserialUART communication
scikit-imagecollection of algorithms for image processing
scikit-learntools for predictive data analysis
scipyalgorithms for optimization, integration, interpolation, eigenvalue problems, algebraic equations, differential equations, statistics, …
websocketslibrary for building Websocket servers and clients
opencvlibrary for image processing

HQ-Camera Module

Currently the HQ camera module (12 MP) with 6 mm wide angle lens is used.

WiFi

While the Raspberry Pi 4 has built-in Wifi capability, there will be cases, where additional external Wifi adapters come in handy:

The built-in Wifi adapter is restricted in range and throughput by its output power and the integrated low gain antenna. External USB Wifi adapters not only offer higher transmit powers but more importantly can often be combined with a higher gain antenna with typically 5 dbi or even 8 dbi. The on-board adapter operates either in the 2.4 GHz of 5 GHz range. Most external adapters offer both frequency ranges as well.

As many external Wifi adapters are not directly supported by the operating system, the required drivers must be installed manually.

A separate document describes which external Wifi adapters have been tried and how the required drivers have been installed. Additionally some hints on the Wifi configuration settings with WPA-supplicant will be provided.

Optional Hardware

All kind of sensors such as:

  • PIR sensors / motion sensors
    • intrusion detection
  • acoustic sensors
    • infra and ultra sound sensors
  • temperature / humidity / light / vibration
    • usage in home automation systems

# current setup has no such optional hardware

PC (dual boot)

A PC has been set up to run either Windows 10 or Linux. Instead of running Windows or Linux in a VW a dual boot system has been setup. After booting the user is prompted to choose either Windows 10 of Ubuntu as its operating system.

Windows 10

Installed software

Python / Python 3.10

The installed packages resemble those installed on the Raspberry PI.

Networking
ToolDescription
Puttyfor various kinds of communication with the Raspberry Pi (raw sockets, SSH)
FileZillaftp and sftp up- and downloading files to/from Raspberry Pi
WireSharkIP traffic monitoring
Integrated Development Environments
ToolDescription
PyCharm CommunityPython IDE
with the free community version remote debugging on the Raspberry Pi via SSH is not supported
Visual Studio CodeIDE various languages depending on installed plugins with the installation of some plugins, remote debugging on the Raspberry Pi is supported   (my preferred tool when programming with Python on Raspi)
SD-Card Tools

Balena Etcher for copying / cloning images

Ubuntu Linux 22

The installed software is largely identical to what has been installed on Windows.

For copying / cloning of images no additional tools are necessary; use disk dump (dd) utility.

Wifi routers

Dual band Wifi routers are preferred.

In many cases Wifi routers will be configured to provide static IP addresses to the network interfaces of PC and RPi. Most routers offer a web based (HTTP) interface where configuration tasks such as static address assignment should be possible.