RasPiGuy12345
Posts: 3
Joined: Tue Feb 07, 2017 3:24 pm

UV4L on Startup

Tue Feb 07, 2017 3:39 pm

Hello Community,

I am currently looking into a script on startup of a Raspberry Pi that would start a UV4L stream. Currently I need to go into terminal and run a command, but would like to have this automated if possible.

I have seen other posts talking about startup scripts, but nothing similar to what I'm looking for. Any insight or help would be great.

~PiGuy

User avatar
DougieLawson
Posts: 35381
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: UV4L on Startup

Tue Feb 07, 2017 7:19 pm

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

Code: Select all

[Unit]
Description=uv4l daemon service
[Service]
ExecStart=/usr/local/bin/script_to_run_uv4l_goes_here
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=uv4l
[Install]
WantedBy=multi-user.target
sudo systemctl enable uv4l.service
sudo systemctl start uv4l.service


Job done. Time for a beer.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

RasPiGuy12345
Posts: 3
Joined: Tue Feb 07, 2017 3:24 pm

Re: UV4L on Startup

Wed Feb 08, 2017 2:46 pm

Thank you for the quick reply! I see the part where you say to insert the script to run, but how exactly do I create that script? Is it just entering the command I would run in terminal, and save it as a script?

Sorry for this, but I am a complete Pi noob :(

User avatar
DougieLawson
Posts: 35381
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: UV4L on Startup

Wed Feb 08, 2017 6:25 pm

RasPiGuy12345 wrote: Is it just entering the command I would run in terminal, and save it as a script?
You gave no clues as to what you're running. It is whatever command you type on a command line.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
pulurobotics
Posts: 3
Joined: Sun Jan 28, 2018 2:43 am

Re: UV4L on Startup

Sun Mar 18, 2018 8:59 am

Would this work?

Check where your uv4l is installed and replace leading path with it.

Code: Select all

/usr/bin/uv4l -nopreview --auto-video_nr --driver raspicam --encoding mjpeg --width 640 --height 480 --framerate 10 --server-option '--port=9090' --server-option '--max-queued-connections=30' --server-option '--max-streams=5' --server-option '--max-threads=29'

Return to “Beginners”