Skip to content

davegroff/raspberryPi-Webcam-System

Repository files navigation

RaspberryPi Webcam System Setup Instructions

Clone Repository

Clone the repository inside the /home/pi/Downloads folder using the following command:

git clone https://github.com/davegroff/raspberryPi-Webcam-System.git

Startup Script and Systemd Service Configuration

  1. Set Executable Permissions: Run the command below to set executable permissions for the startup script:

    sudo chmod +x /home/pi/Downloads/raspberryPi-Webcam-System/startup.sh
    sudo chmod +x /home/pi/Downloads/raspberryPi-Webcam-System/program.sh
  2. Create/Update the Systemd Service:

    Open and edit the systemd service file by running:

    sudo nano /etc/systemd/system/webcam.service

    Paste the following content into the file:

    [Unit]
    Description=RaspberryPi5 Webcam System
    After=network-online.target
    
    [Service]
    WorkingDirectory=/home/pi/Downloads/raspberryPi-Webcam-System
    ExecStart=/home/pi/Downloads/raspberryPi-Webcam-System/startup.sh
    User=pi
    Restart=always
    StandardOutput=syslog
    StandardError=syslog
    SyslogIdentifier=webcam_service
    
    [Install]
    WantedBy=multi-user.target
    sudo nano /etc/systemd/system/chromium.service

    Paste the following content into the file:

    [Unit]
    Description=Launch Chromium with Pyppeteer
    After=network-online.target
    Requires=network-online.target
    
    [Service]
    WorkingDirectory=/home/pi/Downloads/raspberryPi-Webcam-System
    ExecStart=/home/pi/Downloads/raspberryPi-Webcam-System/program.sh
    User=pi
    Restart=always
    StandardOutput=syslog
    StandardError=syslog
    SyslogIdentifier=chromium_service
    
    [Install]
    WantedBy=multi-user.target
  3. Reload Systemd Daemon and Manage the Service: Run the following commands to reload the systemd daemon, enable, start, and check the status of the service:

    sudo systemctl daemon-reload
    
    sudo systemctl enable webcam.service
    sudo systemctl start webcam.service
    sudo systemctl status webcam.service
    
    sudo systemctl enable chromium.service
    sudo systemctl start chromium.service
    sudo systemctl status chromium.service

Access the System

Open a web browser and go to localhost:9000 to serve the video stream from Raspberry Pi To see the stream, launch browser and go to localhost:9000/stream

Follow these steps meticulously to ensure a seamless setup and management of the RaspberryPi Webcam System as a Systemd service on your Raspberry Pi device.

Troubleshooting and Debugging

stopping services if needed

sudo systemctl stop webcam.service sudo systemctl stop chromium.service

logging

sudo journalctl -u webcam.service -f sudo journalctl -u chromium.service -f

Note: remove -f flag and full logs shown forward/back using keyboard F and B.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published