Security web camera based on NodeJS and Raspberry Pi
This project uses the legacy stack of raspistill. For that reason the RaspiOS of the camera machine must run with a 32 bits architecture. If you want to know which system you have, execute this.
cat /etc/os-release
If you have Debian 10 or older skip this section, otherwise, users with RaspiOS Bullseye have to enable legacy camera support.
sudo raspi-config
Navigate to Interface Options
→ Legacy Camera
→ Yes
. Press on finish button and reboot your Pi.
Process to setup the OS machine based on Linux systems
Installing MariaDB server and configure the access user
sudo apt update -y
sudo apt install mariadb-server -y
sudo mysql_secure_installation
Install latest NodeJS and NPM for Linux systems
git clone https://github.com/alberti-tu/PiCamera
cd PiCamera
sudo ./node_setup.sh
Or install a selected version of NodeJS
sudo ./node_setup.sh [version | lts]
NOTE: If the server instance will be in a Raspberry Pi, the latest LTS Node version supported is 16, otherwise you can install the default version provided by the script
Install NPM dependences for all projects
npm run install
Or install NPM dependences of selected project
npm run server:install
npm run client:install
npm run app:install
This project allows you to generate a valid certificate for free by Let's Encrypt. For the verification process to work, remember to forward TCP ports 80 and 443 to your IP address.
sudo apt install certbot
npm run certificate --host=[domain]
The commands in steps 3.1 Server and 3.2 Camera node will open a nano shell editor. After editing the document press ctrl + o to save changes and ctrl + x to close.
Set HTTP server options, database connection and server password
npm run server:config
Set URL connection and server password
npm run client:config
Build all projects
npm run build
Or build a selected project
npm run server:build
npm run client:build
npm run app:build
NOTE: You have to build at least the App project
Command to launch server
npm run server:start
Command to launch camera node
npm run client:start
If you want to finish execution press ctrl + c on the linux shell
In the near future will be new updates, in order to download the new features execute the following commands:
git reset --hard
git pull
After downloaded the features execute steps 2.3 Install NPM dependences, 4. Build project and 5. Launch project.
NOTE: If the changes only affect to App project is not necessary stop the server instance. Just execute this:
npm run app:build