No more videolan.html

Camera model
Logitech 9000

What is the problem?
Can no longer access control for camera settings. Which I suspect is reason I can't get the USB cam show anything but a blank screen.

What did you already try to solve it?
I have found the videolan.html file in /home/pi/mjpg-streamer/www/videolan.html
I reflashed to Octo print 0.18
I've got webcamd and webcamd2 both showing as active. One with Raspi and Second one as USB

Logs (/var/log/webcamd.log, syslog, dmesg, ... no logs, no support)
Last section of /var/log/webcamd2.log:

Starting up webcamDaemon...

--- Configuration: ----------------------------
cfg_file: /boot/octopi2.txt
camera: usb
usb options: -d /dev/logitech9000 -r 640x480 -f 10
raspi options: -fps 10
http options: -w ./www-octopi -p 8082

Explicitly USB device:

Found video devices:
/dev/video0
/dev/video1
/dev/video10
/dev/video11
/dev/video12
/dev/video13
/dev/video14
/dev/video15
/dev/video16
/dev/video2
raspi
config file='/boot/octopi2.txt':USB device was not set in options, start MJPG-streamer with the first found video device: /dev/video0
<13>Mar 27 19:01:52 root: Starting USB webcam
Checking for VL805 (Raspberry Pi 4)...

  • It seems that you don't have VL805 (Raspberry Pi 4).
    There should be no problems with USB (a.k.a. select() timeout)
    Running ./mjpg_streamer -o output_http.so -w ./www-octopi -p 8082 -i input_uvc.so -d /dev/logitech9000 -r 640x480 -f 10
    MJPG Streamer Version: git rev: 5554f42c352ecfa7edaec6fc51e507afce605a34
    i: Using V4L2 device.: /dev/video0
    i: Desired Resolution: 640 x 480
    i: Frames Per Second.: 10
    i: Format............: JPEG
    i: TV-Norm...........: DEFAULT
    UVCIOC_CTRL_ADD - Error at Pan (relative): Inappropriate ioctl for device (25)
    UVCIOC_CTRL_ADD - Error at Tilt (relative): Inappropriate ioctl for device (25)
    UVCIOC_CTRL_ADD - Error at Pan Reset: Inappropriate ioctl for device (25)
    UVCIOC_CTRL_ADD - Error at Tilt Reset: Inappropriate ioctl for device (25)
    UVCIOC_CTRL_ADD - Error at Pan/tilt Reset: Inappropriate ioctl for device (25)
    UVCIOC_CTRL_ADD - Error at Focus (absolute): Inappropriate ioctl for device (25)
    UVCIOC_CTRL_MAP - Error at Pan (relative): Inappropriate ioctl for device (25)
    UVCIOC_CTRL_MAP - Error at Tilt (relative): Inappropriate ioctl for device (25)
    UVCIOC_CTRL_MAP - Error at Pan Reset: Inappropriate ioctl for device (25)
    UVCIOC_CTRL_MAP - Error at Tilt Reset: Inappropriate ioctl for device (25)
    UVCIOC_CTRL_MAP - Error at Pan/tilt Reset: Inappropriate ioctl for device (25)
    UVCIOC_CTRL_MAP - Error at Focus (absolute): Inappropriate ioctl for device (25)
    UVCIOC_CTRL_MAP - Error at LED1 Mode: Inappropriate ioctl for device (25)
    UVCIOC_CTRL_MAP - Error at LED1 Frequency: Inappropriate ioctl for device (25)
    UVCIOC_CTRL_MAP - Error at Disable video processing: Inappropriate ioctl for device (25)
    UVCIOC_CTRL_MAP - Error at Raw bits per pixel: Inappropriate ioctl for device (25)
    o: www-folder-path......: ./www-octopi/
    o: HTTP TCP port........: 8082
    o: HTTP Listen Address..: (null)
    o: username:password....: disabled
    o: commands.............: enabled
    Done bring up all configured video device

Additional information about your setup (OctoPrint version, OctoPi version, ...)
OctoPrint version : 1.5.3
OctoPi version : 0.18.0
on Rpi 3 B+
the logitech9000 shows up in ls /dev & lsusb
I had both cameras running with multicam and octolapse but only intermitently then I flashed to 0.18 and now I can't get the USB Logitech to show up anymore and thought it could be not being able to change the setting on the camera through the videolan.html

I think this is the reason why. You need to modify the txt file to also have.

camera="usb"
camera_usb_options="-d /dev/v4l/<device_id> -r 1280x720 -f 10"
camera_http_webroot="./www"
camera_http_options="-p 8082"

We recently found out the easiest way to do the multicam setup is to copy /boot/octopi.txt to /boot/octopi.conf.d/octopi2.txt and then modify the parameters in that file to match your second instance. Then you don't have to have the second service either.

1 Like

I'm a little unclear on what you are recommending.
I have
camera_http_webroot="./www-octopi"
and
camera_usb_options="-d /dev/logitech9000 -r 640x480 -f 10"
in my octopi2.txt that was copied from my original octopi.txt and uncommented per the directions on hatoum.com.
are you suggesting that I change the ./www-octopi to simply ./www
and insert a v4l into the folder path for my device_id? a
Also did you mean for the octopi2.txt to be in the /boot/conf.d instead of just in /boot like octopi.txt?
Also what do you mean about not needing the second service? webcamd2?

Yes, that will enable the default mjpg-streamer web interface on the back end.

Yes

Correct, with this approach you don't need the webcamd2 service described in step 5, the main webcam service will run both. If you made changes to default webcamd you will want to revert those changes.

you can keep this -d /dev/logitech9000 since you've already setup the dev rules for it, assuming that's working.

Quick correction on this one - the directory is /boot/octopi.conf.d.

Does that mean I don't do Hatoum steps 5 , 6 or 7? So I should go in and remove the webcamd2 changes in haproxy.cfg as well?

Yeah, sorry that was a typo.

The reconfiguration of haproxy is optional, you may want those if you are using any tunneling services like octoeverywhere or ngrok plugins for remote access.

ok I've got it where the status shows both the raspi and the USB cam. Now my browser is not recognizing the octoprint IP but I can still ssh into it Mmmmm. I'm also still seeing the
/.www-octopi come up in the status. See below
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 Sun 2021-03-28 11:01:08 EDT; 26s ago
Process: 446 ExecStart=/root/bin/webcamd (code=exited, status=0/SUCCESS)
Tasks: 12 (limit: 1939)
CGroup: /system.slice/webcamd.service
β”œβ”€489 ./mjpg_streamer -o output_http.so -w ./www-octopi -p 8082 -i input_uvc.so -d /dev/logitech9000 -r 320x240 -f 5 -d /dev/vid
└─492 ./mjpg_streamer -o output_http.so -w ./www-octopi -p 8080 -i input_raspicam.so -fps 10

Mar 28 11:00:29 octopi mjpg_streamer[489]: MJPG-streamer [489]: www-folder-path......: ./www-octopi/
Mar 28 11:00:29 octopi mjpg_streamer[489]: MJPG-streamer [489]: HTTP TCP port........: 8082
Mar 28 11:00:29 octopi mjpg_streamer[489]: MJPG-streamer [489]: HTTP Listen Address..: (null)
Mar 28 11:00:29 octopi mjpg_streamer[489]: MJPG-streamer [489]: username:password....: disabled
Mar 28 11:00:29 octopi mjpg_streamer[489]: MJPG-streamer [489]: commands.............: enabled
Mar 28 11:00:29 octopi mjpg_streamer[489]: MJPG-streamer [489]: starting input plugin input_uvc.so
Mar 28 11:00:29 octopi mjpg_streamer[489]: MJPG-streamer [489]: starting output plugin: output_http.so (ID: 00)
Mar 28 11:00:34 octopi mjpg_streamer[489]: MJPG-streamer [489]: select() timeout
Mar 28 11:00:34 octopi mjpg_streamer[489]: MJPG-streamer [489]: cleaning up resources allocated by input thread
Mar 28 11:01:08 octopi systemd[1]: Started the OctoPi webcam daemon with the user specified config.

I've uncommented the camera_http_webroot="./www-octopi" in octopi2.txt and changed it to just just ./www to see how that goes.

Very weird, now I can not access octopi. I can ssh into it by the IP address but through the browser on Chrome, Brave or Edge cannot get to octopi by octopi.local or IP address. Now here is the really weird thing i can now get to http://octopi.local:8080/stream.html again and http://octopi.local:8082/stream.html shows up again but with a white screen for my logitech 9000 but after awhile I lose http://octopi.local:8082/stream.html and I get a " This site can’t be reached octopi.local refused to connect." message. I'm thinking something is up with the ./www vs ./www-octopi thing

Curiouser and curiouser......

the only difference between the two is the web pages that the mjpg-streamer uses to display information. If you want the videolan.html and control.html pages you have to change that. I'd lean more towards that your haproxy configuration is messed up if you are no longer able to access the web interface of octoprint.

You may be right. I decided to "put another nickel in the machine" and start fresh once again. So I reflashed 0.18 octopi and I could once again access octopi through the web browser.

I followed Hartoum up to step five but putting octopi2.txt in a directory called octopi.conf.d.

When I then did the IP address:8080 in the browser I got a a simple white page with a snapshot and a stream. When I did IP address:8081 I got a the white screen with only the titles Snapshot and Stream but no image from the logitech.

I then uncommented the "camera_http_webroot="./www-octopi" line and changed it to only "./www" in both octopi.txt and octopi2.txt. Then the browser brought up the mjpg-streamer webpages for both addresses with 8081 one being blank. When I tried to use the "controls" tab on the webpage to change the image it crashes and will no longer access the webpage until i reboot.

I'm now trying to learn how to send the Logitech camera settings by the command line thru ssh that will give me an image. I do not have another webcam to try but I'm hoping I'll be able to find settings that work for the Logitech 9000 that I could then have preloaded I a script file.

I know the Logitech camera works because I had it running under 0.17

using " v4l2-ctl --set-ctrl=whatever parameter=some value" I was able to cycle through the available parameters without luck. The mjpg-streamer seems to hang on the IPaddress:8081. I also lowered the res to 320 x 240 -f 5 without luck. The Logitech 9000 on the 8081 port will not work on either the multicam or octolapse plugin. So although I can't get the Logitech to work under 0.18 that perhaps belongs on another thread since this one was about videolan.html working and I got that back. I look for a more appropriate thread. Thank you @jneilliii and @Charlie_Powell .

2 Likes

Thanks to a post I found by @Scruff_R in GitHub I can get the Logitech 9000 working again as the second cam to the Raspi cam by
"sudo systemctl restart webcamd".

Now I need to figure out how I can use the System Command Editor to put in the command with password to execute the sudo command. That way I won't have to open SSH after any reboot.

1 Like

I don't think you need to supply a password for sudo service webcamd restart, you just need to add it to your config.yaml for system commands. This is because of the sudoers config in octopi, unless you have a manual install.

I must be missing something. I put this in the command line "sudo systemctl restart webcamd". Or should I put that in the action line?

I get this error when its in the command line :

Command for custom:Restart Webcam failed with return code 1:
STDOUT:
STDERR: sudo: no tty present and no askpass program specified

try with sudo service webcamd restart

Nope. I tried various combinations in both the action field and the command field. Maybe if @Scruff_R sees this he can tell us what he put in the System Command Editor.

I do remember also having some issues to get the command working as expected at first, but I finally found the solution.
Unfortunately I since have switched to another cam and didn't need that command anymore and forgot what I once knew :blush: :man_facepalming:

But I'll dig up the Logitech 9000 again and see if I can jog my memory.

The other service commands can be run because octopi updates the sudoers file stuff to allow it. You may be able to adjust for a similar thing, but looking at my octopi, it seems that "service" should not require a password.

cat /etc/sudoers.d/octoprint-service
pi ALL=NOPASSWD: /usr/sbin/service

This is the system commands I have set up for restarting other services, maybe it will help you figure it out.

system:
  actions:
  - action: octodash_start
    command: sudo service octodash start
    name: Start OctoDash
  - action: octodash_stop
    command: sudo service octodash stop
    name: Stop OctoDash

That rings a bell :+1: