-
Notifications
You must be signed in to change notification settings - Fork 174
How to Manage Sqlite3 Database
There are several ways to archive, reset or start a fresh speed camera sqlite3 database. The sqlite3 database and schema structure will automatically be created by speed-cam.py.
First stop speed_cam.py using menubox.sh or from console using speed-cam.sh stop
Below is a list of options.
cd ~/speed-camera
mv data/speed_cam.db data/speed_cam_30jun21.db
A fresh copy will be created on restart. If you do not delete images you can restore back to old database by changing the DB_NAME in config.py.
rm data/dpeed_cam.db
Also see How to View Speed Camera Data
The database and structure will be recreated on next restart but your db history will be lost.
You can change any of the following or any combination in config.py. I suggest just creating a new db table. eg DB_TABLE= "speed2". The speed table will still exist and you can change back to it if you want to run historical reports or graphs.
# Sqlite3 Settings in config.py
# ----------------
DB_DIR = "data"
DB_NAME = "speed_cam.db"
DB_TABLE = "speed"
You can then decide if you want to keep media/images or start a new media/images folder or delete everything.. Depending on what you do above and how much space you have..
Simplest would be just to change db name eg DB_NAME = "speed_cam_2.db"
Restart speed_cam.py
If you are having problems with media/recent then the symbolic links can just be deleted and new ones will be created as new data and images are collected.
cd~/speed-camera
rm media/recent/*
(Optional) You can also create custom plugins for special database configuration changes or settings.
Also see How to View Speed Camera Data
Wiki Home
Description, Issues, Features
How to Install or Upgrade
How to Run
How to Calibrate
Change Settings and Plugins
How to Tune Motion Tracking
Setup RTSP Camera
rclone Remote Storage File Transfer
How to View Speed Data
How to Generate Graphs
How to Run speed-search.py
How to Start on Boot
How to use run.sh
watch-app.sh Remote config
How to Manage Sqlite3 Database
How to move speed-camera to ext drive
How to use OPENALPR with speed camera
Github Repo