實驗目標:
- 以Raspberry Pi 3B+架設NVR系統,使用Shinobi free, open source software。
- ESP32-CAM串流輸出MPEG video到NVR,儲存在硬碟中。
- 使用D-Link DCS-8300LHV2 Wi-Fi ONVIF camera儲存影音到NVR。
- 連續錄影與移動偵測錄影。
一、NVR系統架設步驟:
使用raspberry Pi 3B+板子,使用外接USB硬碟為儲存設備。
- 下載Raspberry Pi Imager,執行安裝Raspberry Pi OS。
選擇安裝Rapberry Pi OS Lite(32 bit),Write to SD card
- 設定Rapberry Pi:
- 啟用SSH:sudo raspi-config
Interface Options
SSH - 設定固定IP:$ sudo nano /etc/dhcpcd.conf取消註解,並更改你要的 IP address#static ip_address=192.168.1.23/24#static routers=192.168.1.1#static domain_name_servers=192.168.1.1
- 安裝Shinobi:$ sudo wget https://gitlab.com/Shinobi-Systems/Shinobi-Installer/raw/master/shinobi-install.sh
$ sudo chmod +x shinobi-install.sh
$ sudo ./shinobi-install.shInstall the Development branch?(y)es or (N)o? Default : NoSelect your OSIf your OS is not on the list please refer to the docs.========1. Ubuntu - Fast and Touchless2. Ubuntu - Advanced3. CentOS4. CentOS - Quick Install5. MacOS6. FreeBSD7. OpenSUSE========
1Shinobi - Do you want to temporarily disable IPv6?Sometimes IPv6 causes Ubuntu package updates to fail. Only do this if your machine doesn't rely on IPv6.(y)es or (N)o
NUse `pm2 show <id|name>` to get more details about an app=====================================||===== Install Completed =====||=====================================|| Login with the Superuser and create a new user!!||===================================|| Open http://192.168.1.23:8080/super in your web browser.||===================================|| Default Superuser : admin@shinobi.video|| Default Password : admin=====================================
以上列網址與帳號密碼建立一個使用者後,開啟http://192.168.1.23:8080,以新建使用者開啟管理NVR介面 - 設定連接USB HDD:
Raspberry Pi NVR外接1TB USB HDD採用NTFS檔案系統儲存攝影機影像。a: 安裝Raspberry Pi NTFS software
$ sudo apt install ntfs-3g
b:列出外接USB HDD block device id,以便後續掛載Device
$ sudo blkid/dev/mmcblk0p1: LABEL_FATBOOT="boot" LABEL="boot" UUID="5DE4-665C" TYPE="vfat" PARTUUID="347dad1e-01"/dev/mmcblk0p2: LABEL="rootfs" UUID="7295bbc3-bbc2-4267-9fa0-099e10ef5bf0" TYPE="ext4" PARTUUID="347dad1e-02"/dev/sda1: LABEL="TOSHIBA EXT" UUID="BA96216F96212CF7" TYPE="ntfs" PTTYPE="atari" PARTUUID="0f80c3ad-01"/dev/mmcblk0: PTUUID="347dad1e" PTTYPE="dos"
c: mount USB HDD
# create mount point
$ sudo mkdir /mnt/nvr
#check shinobi running by which user
$ ps -aux | grep shinobi
pi 3548 0.0 0.0 7348 552 pts/0 S+ 02:33 0:00 grep --color=auto shinobi
# mount device
$ sudo mount -t ntfs-3g -o uid=pi,gid=root,umask=007 /dev/sda1 /mnt/nvr
#add the information need to mount the disk in fstab
$ sudo nano /etc/fstab
UUID=BA96216F96212CF7 /mnt/nvr ntfs-3g uid=pi,gid=root,umask=007 0 0
#add two directories esp32 and dcs8300 to store vedios
$sudo mkdir /mnt/nvr/esp32
$sudo mkdir /mnt/nvr/dcs8300
##login in shinobi super to add additional storages: esp32 and dcs8300,步驟請參閱文章最後影片展示。安裝成功後,Shinobi 開啟畫面。
二、ESP32-CAM 攝影鏡頭設定:
- 開啟Arduino IDE,選擇開發版。
工具 >> ESP32 Arduino >> ESP32 Wrove Module
三、Shinobi 加入 ESP32-CAM與ONVIF compliant camera device
.加入 ESP32-CAM
.加入使用D-Link DCS-8300LHV2 Wi-Fi IP Camera測試。
下載mydlink APP 完成設定後,由Shinobi ONVIF search 設備即可加入,詳細步驟請參閱文章最後影片。
詳細安裝步驟影片: