guysoft / OctoPi

Scripts to build OctoPi, a Raspberry PI distro for controlling 3D printers over the web
GNU General Public License v3.0
2.48k stars 367 forks source link

OctoPi not picking up raspi camera first on auto after update or reflash #647

Closed jmlumpkin closed 2 months ago

jmlumpkin commented 4 years ago

Moving over from OctoPrint. I first made this at https://github.com/OctoPrint/OctoPrint/issues/3564.

What were you doing?

I was setting up a new printer, and ran a few updates. I then realized my pi cam was defaulting back to 640x480. I have always had "-x 1280 -y 720 -fps 10", and this worked fine. This was even in my octopi.txt file, but was not being read, after many restarts, etc. Now I must force it to say 'raspi'. Not sure if this is a regression or change.

I then did a complete reinstall of octopi 0.17, made the edit to octopi.txt, and still it is defaulting to 640x480. If I look at the output of 'ps', it notes ./mjpg_streamer -o output_http.so -w ./www-octopi -n -i input_uvc.so -r 640x480 -f 10 -d /dev/video0

Also, I noticed in webcamd, that it is looking for a config file folder, like /boot/octopi.conf.d/

  1. install new copy of octopi 0.17 on a Pi 3B+
  2. Edit Octopi.txt to use camera_raspi_options="-x 1280 -y 720 -fps 10"
  3. Install and start raspberry pi
  4. Camera defaults to 640x480

What did you expect to happen?

I expected to see a different view on my camera

What happened instead?

Showed in default 640x480.

Did the same happen when running OctoPrint in safe mode?

Brand new install with default config.

Version of OctoPrint

1.3.12 (also in 1.4)

Operating System running OctoPrint

Octopi 0.17

Printer model & used firmware incl. version

Ender 3, but never even set it up yet.

Browser and version of browser, operating system running browser

Up to date Chrome on Windows 10.

Logs

This is what I saw in the logs. There are no other cameras plugged in.

Found video devices:
/dev/video0
/dev/video10
/dev/video11
/dev/video12
raspi
config file='/boot/octopi.txt':USB device was not set in options, start MJPG-streamer with the first found video device: /dev/video0
<13>May 10 22:33:10 pi: Starting USB webcam
Running ./mjpg_streamer -o output_http.so -w ./www-octopi -n -i input_uvc.so -r 640x480 -f 10 -d /dev/video0
MJPG Streamer Version: git rev: 501f6362c5afddcfb41055f97ae484252c85c912
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: 10
 i: Format............: JPEG
 i: TV-Norm...........: DEFAULT
libv4l2: error setting pixformat: Device or resource busy
Unable to set format: 1196444237 res: 640x480
Init v4L2 failed !! exit fatal
 i: init_VideoIn failed
Done bring up all configured video device

Goodbye...

I have read the FAQ.

guysoft commented 4 years ago

Is this a V1 camera or V2?

Also it says there: libv4l2: error setting pixformat: Device or resource busy Try making sure nothing is hogging the /dev/video process: https://unix.stackexchange.com/a/144260/33742