Video here: https://youtu.be/qhY_3XCSYsM
Steps for setting up your raspberry pi! You'll need to install a few things first...
sudo apt update && sudo apt full-upgrade
On systems where Picamera2 is supported but not pre-installed (Such as the Lite OS), you can install it with
sudo apt install python3-picamera2
OR to get a slightly reduced installation with fewer of the window system related elements (USE THIS for installing on a Raspberry Pi OS Lite system)
sudo apt install python3-picamera2 --no-install-recommends
sudo apt install imx500-all
sudo apt install python3-opencv
sudo apt install python3-picamera2 --no-install-recommends
sudo apt install git
sudo reboot now
mkdir Documents
cd Documents
git clone https://github.com/LukeDitria/mini_ai_camera.git
Install pip requirements including system-wide packages (we need to use the system picamera2 install...)
cd mini_ai_camera/
python -m venv venv --system-site-packages
source venv/bin/activate
pip install -r requirements.txt
deactivate
chmod +x data_logger.sh
./data_logger.sh
sudo cp data_logger.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable data_logger.service
sudo systemctl start data_logger.service
You can also use the "status", "stop" and "restart" commands!
sudo systemctl status data_logger.service
sudo systemctl stop data_logger.service
sudo systemctl restart data_logger.service
It's a good idea to stop the service running if you are still setting up the Pi!
If you are using the full desktop OS then ANY USB storage device will be automatically mounted in /media
However, if you are using the OS Lite this will not happen and you will need to configure every USB device you want to use so it will auto mount when plugged in...
If you want your Raspberry Pi (or Linux system) to automatically mount a USB drive at boot, you can use its UUID in /etc/fstab
. This ensures the correct drive is mounted every time, even if the device path (/dev/sda1
, /dev/sdb1
, etc.) changes.
First, plug in your USB drive and find its partition (e.g /dev/sda1):
lsblk -o NAME,SIZE,MODEL,MOUNTPOINT
then find it's UUID (replace /dev/sda1 with your USB device partition)
sudo blkid /dev/sda1
You'll see something like:
/dev/sda1: UUID="17F8-3814" BLOCK_SIZE="512" TYPE="vfat"
Note down the UUID and TYPE
sudo mkdir -p /media/pi/myusb
sudo chown -R pi:pi /media/pi/myusb/
sudo nano /etc/fstab
Add this line at the end using YOUR UUID and TYPE!!
UUID=17F8-3814 /media/pi/myusb vfat defaults,uid=1000,gid=1000,umask=000 0 0
You may need to run
systemctl daemon-reload
sudo mount -a
df -h
You should see a line like
/dev/sda1 115G 140M 115G 1% /media/pi/myusb
Reboot your Pi and then run
df -h
To see if it has mounted automatically!