6

I have been trying to edit the .conf file for raspicam to change the default resolution; however, I can seem to figure out the right command for enabling configuration permissions.

When I access the .conf file:

    $ nano /etc/uv4l/uv4l-raspicam.conf

I am alerted that I do not have write permission. How do I cure this? I've tried to use:

    $ uv4l --server-option = --config-password=myp4ssw0rd

But I get "'<'alert'>' [core] No device detected.

Really confused and I'm worried that the answer is a simple one that I am not experienced enough to see.

1 Answer 1

3

I don't use a conf file; I just start it from a shell script. Although according to man u4vl they use the same options, in my experience it seems hard to get it them to work from the file (e.g., vflip alone causes an error at start; vflip=true does not, but is ignored) -- so I worry the ones that are harder to check, such as mem-lock, aren't necessarily being applied either.

The script approach is a file that looks like this:

#!/bin/sh

exec uv4l --sched-rr --mem-lock --driver raspicam \
--width 960 --height 540 --framerate 30 \
--encoding mjpeg --vflip --hflip

(My camera is mounted upside down). The web server is started by default and eats about 8 MB/s this way per connection (meaning you can only really do one); at full resolution it is closer to 12 MB/s, and I have not found a way to maintain a stable connection to a pi that way (it dies after a few seconds, although the server is obviously still running because you can reconnect right away). See the last paragraph below about checking how the camera ends up actually set.

WRT to your specific problem, if you can issue the command this way, then according to the man page "options specified via command line have higher priority" vs. a configuration file, so you won't have to worry about one. Note you will either have to su root or add sudo between exec and uv4l for the above to work. Using su root is also one way to solve your config file access problem, a couple more are suggested below.

I don't seem to have a system wide config file (this is not on Raspbian) and since it seems more and not less awkward to use I haven't bothered trying to create one.

However:

I am alerted that I do not have write permission. How do I cure this?

Presumably it has superuser permissions. You could try:

sudo chmod 775 /etc/uv4l
sudo chgrp pi /etc/uv4l/uv4l-raspicam.conf
sudo chmod 664 /etc/uv4l/uv4l-raspicam.conf

And that should make the file permanently editable by user pi. It could be that uv4l won't start using a conf file editable by anyone other that root,1 so you may end up having to reverse that (755 instead of 775, then root instead of pi, the 644 instead of 664) and instead use:

sudoedit /etc/uv4l/uv4l-raspicam.conf

I believe by default this uses nano so you should be okay with that.

You can stop the current instance with

sudo kill uv4l $(pidof uv4l)

So you can restart it again with different options, but you can also affect (at least) the http server output from http://whatever.pi:8080/panel -- this will also show how the camera is really set, e.g. I notice I don't actually get 960x540, I get 960x544. If you are aware of this control interface it works well to play with settings dynamically.


1. An easy way to check that would be to write your own as pi then try sudo uv4l --config-file mytest.conf.

1
  • 1
    use vflip=1 or vflip=yes in the conf. file
    – prinxis
    Commented Jun 26, 2016 at 0:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.