Zoom button for usbwebcam

The keygen part of that tutorial though was necessary so that the pi user can do password-less sudo (even if remotely). In order for OctoPrint to be able to do password-less sudo for that v4l2-ctl command you'll need to create a file in the /etc/sudoers.d folder similar to the technique talked about here.

I "copy&past"ed the code right out of my config.yaml file, so it should be ok.
I am working in a linux-only environment. Do you have Windows? How have you edited the config.yaml file? I don't know how robust the config.yaml file is regarding white space, blank lines and Windows line-end vs. Linux line-end handling...

v4l2-ctl doesnt need sudo exec, no necesary password-less sudo command

1 Like

I guess they need to be removed in the configuration as seen in the first post.

I have a Logitech C525. When connected to a PC it can Zoom, Pan and Tilt a little bit.

I've been able to get mine to Zoom to three different levels and Pan to the Left and Right. I haven't been able to get the Tilt working though.

config.yaml contains:

- children:
  - command: OCTO911
    name: Zoom 1x
  - command: OCTO912
    name: Zoom 2x
  - command: OCTO913
    name: Zoom 3x
  - command: OCTO920
    name: Left
  - command: OCTO921
    name: Center
  - command: OCTO922
    name: Right
  name: Custom Events
  type: section`

Settings/ GCODE System Commands


On the "Control" tab the buttons appear aligned vertically.

Does anyone know how we can arrange the buttons horizontally instead of vertically?

From Pimp my web interface ...add Themeify and then create the two custom ones marked "form.custom_control".

form.custom_control didn't work?

This seems to take precedence?

.custom_section_vertical>.custom_control {
display: block;

Not sure what to tell you since this technique works on mine, nicely making the custom buttons go horizontally across the page with a 10px padding between them.

I didn't add all items from your list, maybe it depends on some more of the lines?

EDIT: can't see which one that could possibly be...

It only requires the two as indicated and probably a page reload.

caching maybe... shift f5 doesn't help... let me see...

nope, stubborn one... it's horizontal at first but after a second or so it pops down to vertical.

I wonder where the "ko" "/ko" "if: layout == horizontal" stuff originates from in the code base...

You mean here in control.jinja2? So in theory, something above this level has a key/arg pair of something like layout: horizontal. You would think that this would be the ViewModel for Control. Which takes us to here in the docs for custom controls.

Wow. I got it to work (without Themeify this time).

Be super careful about editing your config.yaml. If you put the attribute in the wrong place it simply won't come up.


1 Like

Nice find! Thanks. So it was a built in tweak feature :smiley:

Docs: http://docs.octoprint.org/en/master/features/custom_controls.html

1 Like

Well... yeahUH...


The Custom Control Editor plugin worked very well.

1 Like

I have the Logitech C270, and, it seems that my cam doesn't zoom, it only has one speed :stuck_out_tongue_winking_eye:

I see... brightness, contrast, saturation, white balance temperature (what the heck is that ?) , power line frequency, sharpness, backlight compensation, exposure auto, and exposure absolute, but, nothing about zooming or I'd be copy pasting like a madman

What the heck, I tried it anyway, and got...

unknown control 'zoom_absolute'

Oh well, that's what I get for having a cheap camera

On the other hand, it adjusts from dark to light excellently, and when you take it apart you can spin the little focus knob (after you break the glue they put on it to stop you from spinning the little focus knob) so it can see perfectly right up to about two inches away, which is really cool (if, of course, you feel like manually moving the camera... hey, maybe a robotic arm. Okay, I'm a geek)

1 Like

I wonder how practical it would be to add just a "digital zoom" to the interface, that wouldn't depend on camera capabilities? For instance, when I'm keeping an eye on printing progress on a print that doesn't take up much of the view, it would be helpful if I could just enlarge a smaller area of what the camera sees to fill the viewport. There's way more resolution from the camera than I need for print monitoring, but when I have a browser window sized down on my laptop for watching a print while I'm doing other stuff in another larger window, the image of the printing part I can see can be pretty tiny.
Or maybe there's already something like this? (I couldn't find it with a search though)