Skip to content

V0.4 Troubleshooting Camera Webcam Issues

FormerLurker edited this page May 30, 2020 · 11 revisions

Under Construction

This page is currently under construction. I'm trying to get Octolapse V0.4 stable released ASAP at the moment, and this has led to some documentation shortcuts. As you might know, Octolapse v4.0 has a TON of documentation built right into the plugin that may help. Click on the various help icons (blue question marks) throughout the system to see detailed help on almost every setting. There are also help buttons that will show up for many error notifications. ALWAYS click on those if you need help.

First steps

Make sure your webcam is working properly in OctoPrint before following any of the troubleshooting recommendations. There are many guides available for getting webcams working with Octoprint.

If your webcam is working in OctoPrint, you can be sure it can be made to work in Octolapse. Make sure your camera passes both of these tests in OctoPrint Settings->Webcam & Timelapse:

webcams_and_timelapse_tests

Now that you know your webcam is working properly, you can try the other troubleshooting steps.

My Webcam Fails the Test

This is usually a problem with the snapshot URL. Let's explain how the webcam settings work, because it's a little different than the way Octoprint is configured.

Base and Snapshot Addresses

I'll explain the Base Address and the Snapshot Address by using OctoPi's default snapshot URL as an example:

http://127.0.0.1:8080/?action=snapshot

In this example the Base Address is http://127.0.0.1:8080/. This isn't entirely obvious, but this is the URL that all other camera requests are based on. Typically, navigating to that camera address will display some kind of webpage or stream. Check your streaming webcam server documentation for details. Here is what you would see if you were using mjpg-streamer provided this page is available (it's disabled by default if you are using OctoPi):

mjpg-streamer_about_page

The Snapshot Address will be the address that returns a JPG image. Most streaming camera servers have this capability. Refer to your server's documentation for more information. It must return a valid JPG file and must NOT be embedded in an HTML page.

Here is the default OctoPi address: http://127.0.0.1:8080/?action=snapshot.

You can just use the full address, or you can embed the Base Address within of the Snapshot Address using the {camera_address} token. Here is the exact same snapshot address using the token: {camera_address}?action=snapshot

My Snapshots Are Rotated or Mirrored

Even if your webcam stream appears to be in the correct orientation, it's possible that your snapshots will not be. OctoPrint uses a trick to rotate your camera stream that does not apply to still images.

Fortunately you can tell Octolapse to rotate or mirror your camera image. Edit your camera profile and find the Rotate, Mirror, Flip, or Transpose Snapshots option:

Rotate, Mirror, Flip, or Transpose Snapshots

Select the correct option from above, and each image will be rotated/flipped according to your selection.

Once you have changed this setting, be sure to save your profile!

Important Note: This setting will not be applied to any existing snapshots, so don't expect any snapshots on the Octolapse tab to be immediately rotated/flipped. It will take effect as soon as you start a new print with Octolapse enabled when the first snapshot is taken, and it will apply to every subsequent snapshot thereafter.

My Camera Requires a Password

Octolapse does support some password-enabled camera servers.

Warning: Octolapse does NOT encrypt your password or username. It is stored within the settings.json file in plain text. If your camera address is not secure (not HTTPS), your password will also be sent in plain text. Make sure you understand this before entering a password into Octolapse!

You can find the User Name and Password settings within the Advanced Webcam Options here:

settings_username_and_password

When you are finished entering your username and password, try testing your camera by clicking the Test button:

Test Webcam Button

When you are finished, be sure to save your changes!

I'm Getting SSL Errors When Testing My Webcam

If your camera URL starts with HTTPS, and it is using a self-signed certificate (it probably will be), you may get SSL connection errors when attempting to take a snapshot. You can tell Octolapse to ignore SSL errors. This setting is located within the Advanced Webcam Options here:

settings_ignore_ssl_errors

Warning: Ignoring SSL Errors may open you up to man in the middle or other attacks. I'm not sure what sorts of nefarious things could really be done with that in this case, but you should at the very least be aware of the possibility. If you are running OctoPrint on a secured local network and have your firewall correctly configured (you're not using port-forwarding to enable access to OctoPrint through the internet, are you?), this should be reasonably safe.

Now, try testing your camera:

test-webcam.png

Be sure to save your changes once you are finished!

My Timelapse Looks Shaky or Jittery

There are a few things that can cause this, and not all of them are related to your camera settings. One thing you can try is increasing the Snapshot Delay:

settings_snapshot_delay

The default setting of 125ms is usually good enough to get a sharp image. However, in some cases, like if your webcam mount isn't very stable and wobbles or if your printer is on a stand and your camera is on a tripod, mechanical vibration might be causing your printer or stand to move relative to your camera.

Increasing the camera delay will add time to every snapshot, which could cause oozing that will lead to print artifacts. There are a few other ways to eliminate the vibrations:

  1. Mount your camera directly to the frame of your printer - This means your printer and camera will vibrate together. The background may still appear to shake, but the printed part and your extruder will appear to be stationary.
  2. Use a more stable mount - It could be the mount itself that is shaking.
  3. Affix your printer to a heavy object - My printer is on a tall Lack enclosure, and it shakes quite a bit. To reduce this I used a large and heavy granite slab and attached it to the printer with velcro. This eliminated the shake I was seeing when creating a timelapse with my DSLR on a tripod.

If you still can't eliminate the jitter, or if it is extremely severe, your printer may not fully support the M400 command (wait for moves to finish). Some printers use an alternative command, G4 P0, to wait for moves to finish. Octolapse does not support this command at the moment, but I'm planning to add it as an option.

My Timelapse is Stable But Appears To Flicker

There are a couple things that can cause flicker, and most are easy to fix:

  1. Your printer is illuminated by LEDs that use Pulse Width Modulation (PWM) with a low refresh rate. This can cause some snapshots to appear brighter or dimmer than others. To test this, turn off your LEDs and use an incandescent or halogen light instead. If your flicker goes away, it's time to find some high frequency LEDs.
  2. Your camera is using automatic exposure, white balance, or focus. Octolapse works best with stable lighting conditions and manual camera settings. Try closing the blinds to keep out the sun, using very bright lighting (brighter than you think you need), and setting your camera to use manual focus, exposure, and white balance. See this guide for enabling Custom Image Preferences
  3. Your camera may be affected by the frequency of your power. Most power systems operate on a frequency of either 50hz or 60hz. Many cameras have a feature to eliminate flicker caused by the powerline frequency. You might look into enabling Custom Image Preferences, since many cameras (including most Logitech and Raspberry Pi cameras) support a powerline frequency correction. Here is the setting for my Logitech 920:

settings_image_preferences_powerline_frequency

Clone this wiki locally