EbenKouao / pi-camera-stream-flask

Create your own live camera stream using a Raspberry Pi 4
MIT License
320 stars 126 forks source link

Instructions for headless operation #2

Open Enginerd27 opened 3 years ago

Enginerd27 commented 3 years ago

I followed this project with a rPi 3B+ and rPi camera module - everything worked great! When I set it up to run headless, it looks like the process starts, grabs one frame, then freezes. I'm not savvy enough to debug the main.py or camera.py files and understand/identify any issues.

zjmulder commented 3 years ago

@Enginerd27 I had the same issue. I guessed main.py was being executed before all the necessary components were loaded by the OS. I followed #4 in this article and altered systemd and that seems to do the trick. My service file ended up looking something like:

[Unit]
Description=Remote Camera
After=multi-user.target

[Service]
Type=idle
ExecStart=/usr/bin/python3 /home/pi/pi-camera-stream-flask/main.py

[Install]
WantedBy=multi-user.target

Hope this helps!