Skip to content

Raspbian Bookworm 64-bit #36

@jtakacs

Description

@jtakacs

The setup.py was not working with the latest Raspbian OS, and the image file provided by Adeept was not working with the Raspberry PI 4.
I wrote this script to install the dependencies, and to set up the init script. Now everything seems to work, I get video from the camera, the motors/servos react to button presses on the web UI.
I still need to assemble the robot, so I can't say for sure this fixes everything, but here is the script if anyone needs it.

#!/bin/bash

# RaspTank setup script for Raspberry Pi 4, OS: Bookworm 64-bit

if [ $(id -u) -ne 0 ]
then
    echo "Please run this script as:"
    echo "sudo ${0}"
    exit 1
fi

set -e
set -x

apt update
apt upgrade -y
apt install -y python-dev-is-python3 python3-pip libfreetype6-dev libjpeg-dev \
    build-essential i2c-tools python3-smbus libatlas-base-dev libgstreamer1.0-0 \
    util-linux procps hostapd iproute2 iw haveged dnsmasq libqt5gui5 libqt5webkit5 \
    libqt5test5 libhdf5-dev libhdf5-serial-dev libatlas-base-dev opencv-data \
    python3-opencv libcamera-v4l2 libcamera-tools
apt clean

pip3 install --break-system-packages luma.oled adafruit-pca9685 rpi_ws281x \
    mpu6050-raspberrypi flask flask_cors websockets RPi.GPIO numpy opencv-contrib-python \
    picamera2 imutils zmq pybase64 psutil

cd /opt
git clone https://github.com/oblique/create_ap
cd create_ap 
make install

cd /opt
git clone https://github.com/adeept/Adeept_RaspTank.git
cd Adeept_RaspTank

cp -vaf ./server/config.txt /etc/config.txt

STARTER=$(readlink -e ./server/webServer.py)
# libcamerify will make legacy opncv code work
LEGACY_CAM=$(which libcamerify)
PY_RUNTIME=$(which python3)

sed -i /etc/rc.local -e "s@^exit 0@${LEGACY_CAM} ${PY_RUNTIME} ${STARTER}\nexit 0\n@"


# updating boot config to enable i2c
echo -ne "\ndtparam=i2c_arm=on\n" >> /boot/config.txt

# fix conflict with onboard Raspberry Pi audio
echo "blacklist snd_bcm2835" > /etc/modprobe.d/snd-blacklist.conf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions