Python3 scripts running on Raspberry Pi to be a video streaming server,
automatically recording or controlled with button and led.
Please reference
https://randomnerdtutorials.com/video-streaming-with-raspberry-pi-camera/
git clone https://github.com/yourskc/rpi_camera.git
cd rpi_camera
python3 rpi_camera.py
in web browser,
http://{IP}:8080
for mainmoil, set the camera's URL :
http://{IP}:8000/stream.mjpg
login as default user/pass: pi/raspberry
run raspi-config to enable camera
sudo apt install git
sudo apt install python3-picamera
git clone https://github.com/yourskc/rpi_camera
cd rpi_camera
ifconfig ( check IP address)
raspistill -v
python3 rpi_camera
sudo nano /etc/rc.local
add the followings,
( sleep 10
python3 /home/pi/rpi_camera/rpi_camera.py ) &
for the first one,
ifconfig eth0 192.168.1.1 netmask 255.255.255.0
for the second one,
ifconfig eth0 192.168.1.2 netmask 255.255.255.0
connect the above two Raspberry Pi with one Ethernet cable
replace rpi_camera.py with rpi_camera_auto.py, that is,
cp rpi_camera_auto.py rpi_camera.py
When you want to change it next time,
ps -ef | grep rpi ( check the {process ID} )
sudo kill {process ID}
Each time the button is pressed, a new directory will be created
under record/ directory and all new images will be saved in the new
folder.
replace rpi_camera.py with rpi_camera_btn.py, that is,
cp rpi_camera_btn.py rpi_camera.py
sudo apt-get install rpi.gpio
connect 2 pins of led to Ground and PIN#11
connect 3 pins of button to 3.3V, Ground and PIN#12