ludiazv / octocitrico

OctoPrint for other fruits
149 stars 18 forks source link

Webcam dont work! #11

Open derTimm0 opened 3 years ago

derTimm0 commented 3 years ago

hey,

can someone help me to configur my webcam? i testing two cams (logitech quickcam pro / wansview Webcam 1080P) both work fine out of the box on my other octopi (raspi 3+ / octoprint 1.5.3) both cams were find with "lsusb" and the cam service is naturaly startet. i tried to edit the "octopi.txt", without positiv result.

what information is required to put one of the cameras into operation?

sorry, but i'm a linux beginner ;-)

ludiazv commented 3 years ago

Hi, Is the webcam service started? In this distribution it should be explicitly started as by default is off.

derTimm0 commented 3 years ago

Yes, i started it over your "scripts/citrico-config". How can i check if the service realy run? (ps -e?)

ludiazv commented 3 years ago

To check status of the service: systemctl status webcamd.service To view logs: journalctl -u webcamd.service

derTimm0 commented 3 years ago

i will check it this afternoon/evening i report the result. thanks you for all ;-)

derTimm0 commented 3 years ago

hi ludiazv,

you see, ther service is activate:

image

the resault of "systemctl status webcamd.service"

`pi@citrico-opipc:~$ systemctl status webcamd.service ● webcamd.service - the OctoPi webcam daemon with the user specified config Loaded: loaded (/etc/systemd/system/webcamd.service; enabled; vendor preset: Active: failed (Result: start-limit-hit) since Wed 2021-03-03 15:52:46 UTC; 5 Process: 1566 ExecStart=/root/bin/webcamd (code=exited, status=0/SUCCESS) ESCOC emon with the user specified config ebcamd.service; enabled; vendor preset: enabled) it) since Wed 2021-03-03 15:52:46 UTC; 52s ago amd (code=exited, status=0/SUCCESS) ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ESCOD ● webcamd.service - the OctoPi webcam daemon with the user specified config Loaded: loaded (/etc/systemd/system/webcamd.service; enabled; vendor preset: Active: failed (Result: start-limit-hit) since Wed 2021-03-03 15:52:46 UTC; 5 Process: 1566 ExecStart=/root/bin/webcamd (code=exited, status=0/SUCCESS) ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ESCOC emon with the user specified config ebcamd.service; enabled; vendor preset: enabled) it) since Wed 2021-03-03 15:52:46 UTC; 52s ago amd (code=exited, status=0/SUCCESS) ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ESCOC

enabled) 2s ago

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ESCOC

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ESCOD

enabled) 2s ago

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ESCOD emon with the user specified config ebcamd.service; enabled; vendor preset: enabled) it) since Wed 2021-03-03 15:52:46 UTC; 52s ago amd (code=exited, status=0/SUCCESS) ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ESCOD ● webcamd.service - the OctoPi webcam daemon with the user specified config Loaded: loaded (/etc/systemd/system/webcamd.service; enabled; vendor preset: Active: failed (Result: start-limit-hit) since Wed 2021-03-03 15:52:46 UTC; 5 Process: 1566 ExecStart=/root/bin/webcamd (code=exited, status=0/SUCCESS) ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ESCOD ● webcamd.service - the OctoPi webcam daemon with the user specified config Loaded: loaded (/etc/systemd/system/webcamd.service; enabled; vendor preset: Active: failed (Result: start-limit-hit) since Wed 2021-03-03 15:52:46 UTC; 5 Process: 1566 ExecStart=/root/bin/webcamd (code=exited, status=0/SUCCESS) `

derTimm0 commented 3 years ago

pi@citrico-opipc:~$ journalctl -u webcamd.service Hint: You are currently not seeing messages from other users and the system. Users in the 'systemd-journal' group can see all messages. Pass -q to turn off this notice. No journal files were opened due to insufficient permissions. pi@citrico-opipc:~$

ludiazv commented 3 years ago

The webcam service failed. to see the log try sudo journalctl

derTimm0 commented 3 years ago

puhhhh..... this is are much information.... Sorry but i "Verstehe nur Bahnhof" :-p

P.s. i have a OrangePI PC

log.txt

derTimm0 commented 3 years ago

image

is that important information?

ludiazv commented 3 years ago

journalctl -u webcamd.service show only the log of the webcam.

derTimm0 commented 3 years ago

log_webcam.txt

pi@citrico-opipc:~ $ lsusb Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 002: ID 0bda:8179 Realtek Semiconductor Corp. RTL8188EUS 802.11n Wireless Network Adapter Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 002: ID 046d:0991 Logitech, Inc. QuickCam Pro for Notebooks Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 009 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

ludiazv commented 3 years ago

The log shows that the service is trying in /dev/video0 and this device doesn't work. You should check to which /dev/videoX your cam is associated.

Try these commands:

ls -ltrh /dev/video*
(this should show the video devices in your system)
sudo v4l2-ctl --list-devices
(this show the properties of the devices)
sudo v4l2-ctl --device=/dev/video0 --all
(this will show details of specific device)

To configure the camera properly check this issue #8. On how to modify the configuration file /boot/octopi.txt.

derTimm0 commented 3 years ago

Last login: Wed Mar 3 21:32:23 2021 from 192.168.0.100 pi@citrico-opipc:~ $ ls -ltrh /dev/video* crw-rw---- 1 root video 81, 0 Mar 3 21:31 /dev/video0 pi@citrico-opipc:~ $ sudo v4l2-ctl --list-devices [sudo] password for pi: sudo: v4l2-ctl: command not found pi@citrico-opipc:~ $ sudo v4l2-ctl --device=/dev/video0 --all sudo: v4l2-ctl: command not found pi@citrico-opipc:~ $ v4l2-ctl: command not found

sudo: v4l2-ctl: command not found

does this mean that v412-ctl (is that the syntax of a program?) is not installed?

ludiazv commented 3 years ago

you need to install v4l-utils package using apt.

derTimm0 commented 3 years ago

now i has install "v4l-utils" and try this

ls -ltrh /dev/video* (this should show the video devices in your system) sudo v4l2-ctl --list-devices (this show the properties of the devices) sudo v4l2-ctl --device=/dev/video0 --all (this will show details of specific device)

attached the octopi.txt with my try to reproduce this

To configure the camera properly check this issue #8. On how to modify the configuration file /boot/octopi.txt.

the resault of there**the resault of there**

UVC Camera (046d:0991) (usb-1c1c000.usb-1): /dev/video1 /dev/video2

pi@citrico-opipc:~$ sudo v4l2-ctl --device=/dev/video0 --all Driver Info: Driver name : cedrus Card type : cedrus Bus info : platform:cedrus Driver version : 5.9.14 Capabilities : 0x84208000 Video Memory-to-Memory Streaming Extended Pix Format Device Capabilities Device Caps : 0x04208000 Video Memory-to-Memory Streaming Extended Pix Format Media Driver Info: Driver name : cedrus Model : cedrus Serial : Bus info : platform:cedrus Media version : 5.9.14 Hardware revision: 0x00000000 (0) Driver version : 5.9.14 Interface Info: ID : 0x0300000c Type : V4L Video Entity Info: ID : 0x00000001 (1) Name : cedrus-source Function : V4L2 I/O Pad 0x01000002 : 0: Source Link 0x02000008: to remote pad 0x1000004 of entity 'cedrus-proc': Data, Enabled, Immutable Priority: 2 Format Video Capture: Width/Height : 16/32 Pixel Format : 'ST12' (Sunxi Tiled NV12 Format) Field : None Bytes per Line : 32 Size Image : 1536 Colorspace : Default Transfer Function : Default (maps to Rec. 709) YCbCr/HSV Encoding: Default (maps to ITU-R 601) Quantization : Default (maps to Full Range) Flags : Format Video Output: Width/Height : 16/32 Pixel Format : 'MG2S' (MPEG-2 Parsed Slice Data) Field : None Bytes per Line : 0 Size Image : 1024 Colorspace : Default Transfer Function : Default (maps to Rec. 709) YCbCr/HSV Encoding: Default (maps to ITU-R 601) Quantization : Default (maps to Full Range) Flags :

Codec Controls

    mpeg_2_slice_parameters 0x009909fa (unknown): type=103 flags=has-payload

mpeg_2_quantization_matrices 0x009909fb (unknown): type=104 flags=has-payload h264_sequence_parameter_set 0x00990ce8 (unknown): type=110 flags=has-payload h264_picture_parameter_set 0x00990ce9 (unknown): type=111 flags=has-payload h264_scaling_matrix 0x00990cea (unknown): type=112 flags=has-payload h264_slice_parameters 0x00990ceb (unknown): type=113 flags=has-payload h264_decode_parameters 0x00990cec (unknown): type=114 flags=has-payload h264_decode_mode 0x00990ced (menu) : min=0 max=0 default=0 value=0 h264_start_code 0x00990cee (menu) : min=0 max=0 default=0 value=0 hevc_sequence_parameter_set 0x00990cf0 (unknown): type=120 flags=has-payload hevc_picture_parameter_set 0x00990cf1 (unknown): type=121 flags=has-payload hevc_slice_parameters 0x00990cf2 (unknown): type=122 flags=has-payload hevc_decode_mode 0x00990cf7 (menu) : min=0 max=0 default=0 value=0 hevc_start_code 0x00990cf8 (menu) : min=0 max=0 default=0 value=0 octopi.txt

derTimm0 commented 3 years ago

short question: where is the problem? on my two cams or on your image/orangepi pc? i think its better to buy a raspi because my linux skill not able :-p

catallo commented 3 years ago

I'm using an Orange PI PC+ and I had to change MJPGStreamer to use /dev/video1 instead of the default /dev/video0 to make it work.

To do that you have to edit /boot/octopi.txt and add -d /dev/video1 to camera_usb_options. It should like like this:

camera_usb_options="-d /dev/video1 -r 1920x1080 -f 20"

.. then reboot.

derTimm0 commented 3 years ago

I'm using an Orange PI PC+ and I had to change MJPGStreamer to use /dev/video1 instead of the default /dev/video0 to make it work.

To do that you have to edit /boot/octopi.txt and add -d /dev/video1 to camera_usb_options. It should like like this:

camera_usb_options="-d /dev/video1 -r 1920x1080 -f 20"

.. then reboot.

that was the first thing I tested — unfortunately without success :-/

ludiazv commented 3 years ago

--list-devices shows /dev/video1 and /dev/video2 have you check the properpties of these devices? have you tried to take a snapshot of short video with ffmpeg? The key is to test what device is associated with your cam and with what parameters (resolution,format,...) does it work. Once you have it you need to use the camera_usb_options variable to pass the proper parameters.

derTimm0 commented 3 years ago

it works, i switched to video 2. strange is that it still works when I switch back to video 0 or 1 XD. orangepi and i still don't become friends, and our connections are constantly lost during printing. I have already taped the 5v pin on the cable and tried it without a camera. sometimes earlier sometimes later, but not reproducible :-(

ludiazv commented 3 years ago

The problem with disconnects depends is not an easy problem and also happens in RPI (check octoprint forums and you will find a lot of reports on this). The best advice I can give here is:

I personally run two printeres with Opis without problems. I power them from the same PSU as the printer with a buck converter via GPIOs. My usb cables are high quality about 15cm long. I had almost no issues with the printers. I run OPIZero LTS.

Best,

derTimm0 commented 3 years ago

it can only be due to the power supply or orange pi. use the same cable (approx. 30cm) with the raspi and there are no problems. that’s no longer fun: - /