Camera_raspi_options seems to be ignored

What is the problem?

I am trying to change the resolution on a pi cam used with octoprint by adding the following line to octopi.txt ...

camera_raspi_options="-x 1280 -y 720 -fps 10"

...to no effect. I believe the currrent resolution is 640 x 380

What did you already try to solve it?

I found a few examples online of what the line (above should look like and don't see a difference.

Additional information about your setup

OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible

Running a Ender 3 Pro with octoprint, RP3b+, stock ender controller board and all is working well except the resolution of the pi cam.

does it work in safe mode? maybe a plugin is interfering with your settings

Not sure what you mean. If you're talking about running the pi in safe mode, I'm not sure how to do that. I am running the pi headless from a pc.

Can you elaborate?

Click on the words safe mode
It's a link to a post which tells you everything you need to know :slight_smile:

Also, once you change those settings (& save them), you need to restart webcamd - sudo service webcamd restart, so it changes the config. It could also be that your camera is being detected as a USB camera, and therefore using the USB options, since I came across this earlier:

I've run into the "same" issue: the camera_raspi_options in the /boot/octopi.txt is not respected.

camera_raspi_options="-fps 10 -rot 180 -x 1280 -y 1024"
pi@octopi:/boot $ sudo service webcamd restart
pi@octopi:/boot $ sudo service webcamd status
● webcamd.service - the OctoPi webcam daemon with the user specified config
   Loaded: loaded (/etc/systemd/system/webcamd.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2020-10-28 21:10:28 GMT; 7s ago
  Process: 1475 ExecStart=/root/bin/webcamd (code=exited, status=0/SUCCESS)
 Main PID: 1488 (mjpg_streamer)
    Tasks: 3 (limit: 2077)
   Memory: 1.2M
   CGroup: /system.slice/webcamd.service
           └─1488 ./mjpg_streamer -o output_http.so -w ./www-octopi -n -i input_uvc.so -r 640x480 -f 10 -d /dev/video0

Oct 28 21:10:27 octopi mjpg_streamer[1488]: MJPG-streamer [1488]: www-folder-path......: ./www-octopi/
Oct 28 21:10:27 octopi mjpg_streamer[1488]: MJPG-streamer [1488]: HTTP TCP port........: 8080
Oct 28 21:10:27 octopi mjpg_streamer[1488]: MJPG-streamer [1488]: HTTP Listen Address..: (null)
Oct 28 21:10:27 octopi mjpg_streamer[1488]: MJPG-streamer [1488]: username:password....: disabled
Oct 28 21:10:27 octopi mjpg_streamer[1488]: MJPG-streamer [1488]: commands.............: disabled
Oct 28 21:10:27 octopi mjpg_streamer[1488]: MJPG-streamer [1488]: starting input plugin input_uvc.so
Oct 28 21:10:27 octopi mjpg_streamer[1488]: MJPG-streamer [1488]: starting output plugin: output_http.so (ID: 00)
Oct 28 21:10:28 octopi webcamd[1475]: Done bring up all configured video device
Oct 28 21:10:28 octopi webcamd[1475]: Goodbye...
Oct 28 21:10:28 octopi systemd[1]: Started the OctoPi webcam daemon with the user specified config.

Specifically showing that the webcam service was started with this command:

./mjpg_streamer -o output_http.so -w ./www-octopi -n -i input_uvc.so -r 640x480 -f 10 -d /dev/video0

So, is there a different config for the mjpg streamer / webcamd.service?


Additional Info

webcamd.service

[Unit]
Description=the OctoPi webcam daemon with the user specified config

[Service]
WorkingDirectory=/root/bin
ExecStart=/root/bin/webcamd
Restart=always
Type=forking

[Install]
WantedBy=multi-user.target

octopi.txt

(commented lines redacted)

camera="auto"
camera_raspi_options="-fps 10 -rot 180 -x 1280 -y 1024"

Change camera="auto" to camera="raspi" and see if that changes it. Seems that newer models of the camera (or software) identify themselves in the same way as a regular USB cam, so that's used instead on auto mode.

1 Like

that did the trick! Time to update the docs ...

Thoughts on how to update this to be more clear

### Configure which camera to use
#
# Available options are:
# - auto: tries first usb webcam, if that's not available tries raspi cam
# - usb: only tries usb webcam
# - raspi: only tries raspi cam
#
# Defaults to auto
#
camera="auto"

maybe:

### Configure which camera to use
#
# Available options are:
# - auto: tries first usb webcam, if that's not available tries raspi cam
# - usb: only tries usb webcam
# - raspi: only tries raspi cam
#
# Note: Some newer models of the RasPi Cam identify self as usb and will need to be manually set
#
# Defaults to auto
#
camera="auto"

Guy accepts PRs in the source, so you could change to whatever you think would be more helpful. :slightly_smiling_face:.
From this comment, user implies that it is expected behaviour. Maybe a larger rework of the detection code would be the real solution, but we don't have extra resources to 'just do that'. By all means, a better explanation would stop people having to come to the forums to solve the problems.

Here's the file:

1 Like

That was my plan - thanks for pointing me in the right direction.

1 Like