Skip to content

dmnewton/picamera_collector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

picamera_collector

This tool helps you collect pictures for your AI project using the inexpensive Raspberry PI Camera.

This tool supports three important steps

  • Focus - a video mode allows you to focus your camera - important with HQ Camera
  • Lighting - find the best setting for you object - important if it's moving
  • Automation - use GPIO signals to trigger data collection
  • Storage - upload to cloud storage

The trigger can come from a remote device

Instructions

This is based on picamera which is not yet compatibel with bullseye

If installing on a pi zero use lite image (also good option if not conncting PI to monitor)

https://downloads.raspberrypi.org/raspios_oldstable_lite_armhf/images/raspios_oldstable_lite_armhf-2021-12-02/2021-12-02-raspios-buster-armhf-lite.zip

Install the buster raspios image using etcher

https://www.balena.io/etcher/

Prepare SD Crad

Enable ssh access - important if you plan to use headless

remove an dreinsert SD Card to mount on pc/mac

touch /Volumes/boot/ssh

If a pizero

enable device access via USB so you can configure WLAN etc.
or you can connect keyboard and screen
turbo and voltage are required for system stability when camera is attacehd to a zero

edit /Volumes/boot/config.txt

[pi0]
gpu_mem=128
start_x=1
dtoverlay=dwc2
force_turbo=1
over_voltage=4

edit /Volumes/boot/cmdline.txt after rootwait

modules-load=dwc2,g_ether

Now you can connect via usb

Install SD card and boot

ssh pi@raspberrypi
or
ssh [email protected] (when via USB)

initial password is raspberry

sudo raspi-config

  • hostname
  • your wifi
  • enable camera
  • gpu 128
  • change password fo pi

prepare environmnet with latest software

sudo apt update
sudo apt full-upgrade

time

add local time server

sudo vim.tiny /etc/systemd/timesyncd.conf

[Time]
NTP=fritz.box

sudo systemctl restart systemd-timesyncd.service 

timedatectl timesync-status

Install python , pip and git

sudo apt install python3 git python3-pip
sudo apt install libgfortran5 libatlas3-base # for numpy

update pip packages in requiremnets - note numpy set to specific vesion

pip3 install -r requirements.txt -U

update pip packages

does not work!

pip3 freeze > all_packages.txt
sed -i 's/==/>=/g' all_packages.txt 
pip3 install -r all_packages.txt --upgrade

install software as pip module or clone

pip3 install git+https://github.com/dmnewton/picamera_collector.git
or
git clone https://github.com/dmnewton/picamera_collector.git

start as service

Chose camera.service or trigger.service

cd /home/pi/.local/lib/python3.7/site-packages/picamera_colllecter
sudo cp camera.service /etc/systemd/system/
sudo systemctl enable camera.service
sudo systemctl start camera.service
sudo systemctl status camera.service

browser access

http://<hostname>:5000

userid password are defined in the yaml

plugins

One definable triger and storage function

Sending to google cloud storage

edit app_settings.yaml

copy over google service key

scp google-service-key.json pi@raspberrypi:

when using a lan network adaptor on pi zero

sudo nano /boot/config.txt
at end add
dtoverlay=disable-wifi
dtoverlay=disable-bt

sudo nano /etc/network/if-pre-up.d/ethtool
at end add
$ETHTOOL --change eth0 advertise 0x008

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published