Camera model
Raspberry Pi Camera v2
What is the problem?
The Camera is useable with libcamera-* (see Raspberry Pi Documentation - Camera) in Raspberry Pi OS lite (latest updates), so there is no hardware problem.
Every guide on how to set up the docker image advises using /dev/video0
as the camera device (works with my Fuji X-T200 in webcam mode), but neither octoprint in docker nor ffplay /dev/video0
are able to use the camera.
What did you already try to solve it?
Going into raspi-config
and setting the camera to legacy mode (Interface Options > Legacy Camera) fixes this, however I have only been able to get a resolution of 640Γ480 this way (the v2 camera should do 1920x1080).
My best guess is that I am using the wrong device for the docker container, but I cannot figure outh what to use instead of /dev/video0
.
Logs (/var/log/webcamd.log
, syslog, dmesg, ... no logs, no support)
Systeminfo
browser.user_agent: Mozilla/5.0 (X11; Linux x86_64; rv:101.0) Gecko/20100101 Firefox/101.0
connectivity.connection_check: 1.1.1.1:53
connectivity.connection_ok: True
connectivity.enabled: True
connectivity.online: True
connectivity.resolution_check: octoprint.org
connectivity.resolution_ok: True
env.hardware.cores: 4
env.hardware.freq: 1500.0
env.hardware.ram: 3978801152
env.os.bits: 64
env.os.id: linux
env.os.platform: linux
env.python.pip: 22.0.4
env.python.version: 3.8.13
env.python.virtualenv: False
octoprint.last_safe_mode.date: unknown
octoprint.last_safe_mode.reason: unknown
octoprint.safe_mode: False
octoprint.version: 1.8.1
systeminfo.generated: 2022-06-11T13:14:15Z
systeminfo.generator: zipapi
relevant octoprint.log
2022-06-11 13:09:35,623 - octoprint.startup - INFO - ******************************************************************************
2022-06-11 13:09:35,627 - octoprint.startup - INFO - Starting OctoPrint 1.8.1
2022-06-11 13:09:35,628 - octoprint.startup - INFO - ******************************************************************************
2022-06-11 13:09:35,974 - octoprint.util.connectivity.connectivity_checker - INFO - Connectivity changed from offline to online
2022-06-11 13:09:36,006 - octoprint.util.connectivity.connectivity_checker - INFO - Connectivity state is currently: online
2022-06-11 13:09:36,006 - octoprint.util.connectivity.connectivity_checker - INFO - Connecting to 1.1.1.1:53 is working
2022-06-11 13:09:36,007 - octoprint.util.connectivity.connectivity_checker - INFO - Resolving octoprint.org is working
2022-06-11 13:09:36,121 - octoprint.startup - INFO - Blacklist processing done, adding 3 blacklisted plugin versions: roomtemp (any), GcodeEditor (>=0.1.1,<=0.2.8), gcodeleveling (>=0.1.0,<=0.1.1)
2022-06-11 13:09:36,131 - octoprint.plugin.core - INFO - Loading plugins from /usr/local/lib/python3.8/site-packages/octoprint/plugins, /octoprint/octoprint/plugins and installed plugin packages...
2022-06-11 13:09:37,602 - octoprint.plugin.core - INFO - Plugin Octolapse (0.4.1) is disabled.
2022-06-11 13:09:37,647 - octoprint.plugin.core - INFO - Plugin Pi Support Plugin (2022.3.28) did not pass check, not loading.
2022-06-11 13:09:37,774 - octoprint.plugin.core - INFO - Found 24 plugin(s) providing 23 mixin implementations, 47 hook handlers
2022-06-11 13:09:37,822 - octoprint.server.heartbeat - INFO - Starting server heartbeat, 900.0s interval
2022-06-11 13:09:37,834 - octoprint.server - INFO - Intermediary server started
2022-06-11 13:09:37,844 - octoprint.filemanager.storage - INFO - Initializing the file metadata for /octoprint/octoprint/uploads...
2022-06-11 13:09:37,867 - octoprint.filemanager.storage - INFO - ... file metadata for /octoprint/octoprint/uploads initialized successfully.
2022-06-11 13:09:37,876 - octoprint.server - INFO - Added new permission from plugin action_command_notification: PLUGIN_ACTION_COMMAND_NOTIFICATION_SHOW (needs: "Need(method='role', value='plugin_action_command_notification_show')")
2022-06-11 13:09:37,877 - octoprint.server - INFO - Added new permission from plugin action_command_notification: PLUGIN_ACTION_COMMAND_NOTIFICATION_CLEAR (needs: "Need(method='role', value='plugin_action_command_notification_clear')")
2022-06-11 13:09:37,878 - octoprint.server - INFO - Added new permission from plugin action_command_prompt: PLUGIN_ACTION_COMMAND_PROMPT_INTERACT (needs: "Need(method='role', value='plugin_action_command_prompt_interact')")
2022-06-11 13:09:37,879 - octoprint.server - INFO - Added new permission from plugin announcements: PLUGIN_ANNOUNCEMENTS_READ (needs: "Need(method='role', value='plugin_announcements_read')")
2022-06-11 13:09:37,880 - octoprint.server - INFO - Added new permission from plugin announcements: PLUGIN_ANNOUNCEMENTS_MANAGE (needs: "Need(method='role', value='plugin_announcements_read'), Need(method='role', value='plugin_announcements_manage')")
2022-06-11 13:09:37,881 - octoprint.server - INFO - Added new permission from plugin appkeys: PLUGIN_APPKEYS_ADMIN (needs: "Need(method='role', value='plugin_appkeys_admin')")
2022-06-11 13:09:37,904 - octoprint.server - INFO - Added new permission from plugin appkeys: PLUGIN_APPKEYS_GRANT (needs: "Need(method='role', value='plugin_appkeys_user')")
2022-06-11 13:09:37,907 - octoprint.server - INFO - Added new permission from plugin backup: PLUGIN_BACKUP_ACCESS (needs: "Need(method='role', value='plugin_backup_access')")
2022-06-11 13:09:37,915 - octoprint.server - INFO - Added new permission from plugin firmware_check: PLUGIN_FIRMWARE_CHECK_DISPLAY (needs: "Need(method='role', value='plugin_firmware_check_display')")
2022-06-11 13:09:37,918 - octoprint.server - INFO - Added new permission from plugin logging: PLUGIN_LOGGING_MANAGE (needs: "Need(method='role', value='plugin_logging_manage')")
2022-06-11 13:09:37,923 - octoprint.server - INFO - Added new permission from plugin pluginmanager: PLUGIN_PLUGINMANAGER_LIST (needs: "Need(method='role', value='plugin_pluginmanager_manage')")
2022-06-11 13:09:37,924 - octoprint.server - INFO - Added new permission from plugin pluginmanager: PLUGIN_PLUGINMANAGER_MANAGE (needs: "Need(method='role', value='plugin_pluginmanager_manage')")
2022-06-11 13:09:37,927 - octoprint.server - INFO - Added new permission from plugin pluginmanager: PLUGIN_PLUGINMANAGER_INSTALL (needs: "Need(method='role', value='plugin_pluginmanager_manage'), Need(method='role', value='plugin_pluginmanager_install')")
2022-06-11 13:09:37,930 - octoprint.server - INFO - Added new permission from plugin softwareupdate: PLUGIN_SOFTWAREUPDATE_CHECK (needs: "Need(method='role', value='plugin_softwareupdate_check')")
2022-06-11 13:09:37,935 - octoprint.server - INFO - Added new permission from plugin softwareupdate: PLUGIN_SOFTWAREUPDATE_UPDATE (needs: "Need(method='role', value='plugin_softwareupdate_update')")
2022-06-11 13:09:37,939 - octoprint.server - INFO - Added new permission from plugin softwareupdate: PLUGIN_SOFTWAREUPDATE_CONFIGURE (needs: "Need(method='role', value='plugin_softwareupdate_configure')")
2022-06-11 13:09:39,402 - octoprint.util.pip - INFO - Using "/usr/local/bin/python -m pip" as command to invoke pip
2022-06-11 13:09:40,874 - octoprint.util.pip - INFO - Version of pip is 22.0.4
2022-06-11 13:09:40,887 - octoprint.util.pip - INFO - pip installs to /usr/local/lib/python3.8/site-packages (writable -> yes), --user flag needed -> no, virtual env -> no
2022-06-11 13:09:40,887 - octoprint.util.pip - INFO - ==> pip ok -> yes
2022-06-11 13:09:40,911 - octoprint.plugins.softwareupdate - INFO - Loaded version cache from disk
2022-06-11 13:09:40,968 - octoprint.plugins.excluderegion - INFO - Logging mode set to 'octoprint'
2022-06-11 13:09:40,970 - octoprint.plugins.excluderegion - INFO - Setting update detected: g90InfluencesExtruder=False, clearRegionsAfterPrintFinishes=False, mayShrinkRegionsWhilePrinting=False, loggingMode=octoprint, enteringExcludedRegionGcode=None, exitingExcludedRegionGcode=None, extendedExcludeGcodes={'G4': {"gcode": "G4", "mode": "exclude", "description": "Ignore all dwell commands in an excluded area to reduce delays while excluding", "type": "ExcludedGcode"}, 'M117': {"gcode": "M117", "mode": "last", "description": "Suppress display messages while excluding and output the last message encountered when exiting the excluded area", "type": "ExcludedGcode"}, 'M204': {"gcode": "M204", "mode": "merge", "description": "Record default acceleration changes while excluding and apply the most recent values in a single command after exiting the excluded area", "type": "ExcludedGcode"}, 'M205': {"gcode": "M205", "mode": "merge", "description": "Record advanced setting changes while excluding and apply the most recent values in a single command after exiting the excluded area", "type": "ExcludedGcode"}, 'M73': {"gcode": "M73", "mode": "merge", "description": "Suppress progress updates while excluding and output the most recent progress values encountered when exiting the excluded area", "type": "ExcludedGcode"}}, atCommandActions={'ExcludeRegion': [{"command": "ExcludeRegion", "parameterPattern": "^\\s*(enable|on)(\\s|$)", "action": "enable_exclusion", "description": "Default action to enable exclusion", "type": "AtCommandAction"}, {"command": "ExcludeRegion", "parameterPattern": "^\\s*(disable|off)(\\s|$)", "action": "disable_exclusion", "description": "Default action to disable exclusion", "type": "AtCommandAction"}]}
2022-06-11 13:09:40,986 - octoprint.plugin.core - INFO - Initialized 23 plugin implementation(s)
2022-06-11 13:09:41,010 - octoprint.plugin.core - INFO - 24 plugin(s) registered with the system:
| Action Command Notification Support (bundled) = /usr/local/lib/python3.8/site-packages/octoprint/plugins/action_command_notification
| Action Command Prompt Support (bundled) = /usr/local/lib/python3.8/site-packages/octoprint/plugins/action_command_prompt
| Announcement Plugin (bundled) = /usr/local/lib/python3.8/site-packages/octoprint/plugins/announcements
| Anonymous Usage Tracking (bundled) = /usr/local/lib/python3.8/site-packages/octoprint/plugins/tracking
| Application Keys Plugin (bundled) = /usr/local/lib/python3.8/site-packages/octoprint/plugins/appkeys
| Backup & Restore (bundled) = /usr/local/lib/python3.8/site-packages/octoprint/plugins/backup
| Camera Settings (0.4.0) = /octoprint/plugins/lib/python3.8/site-packages/octoprint_CameraSettings
| Core Wizard (bundled) = /usr/local/lib/python3.8/site-packages/octoprint/plugins/corewizard
| Creality Temperature (1.2.4) = /octoprint/plugins/lib/python3.8/site-packages/octoprint_CrealityTemperature
| Creality-2x-temperature-reporting-fix (0.0.4) = /octoprint/plugins/lib/python3.8/site-packages/octoprint_ender3v2tempfix
| Discovery (bundled) = /usr/local/lib/python3.8/site-packages/octoprint/plugins/discovery
| Error Tracking (bundled) = /usr/local/lib/python3.8/site-packages/octoprint/plugins/errortracking
| Event Manager (bundled) = /usr/local/lib/python3.8/site-packages/octoprint/plugins/eventmanager
| Exclude Region (0.3.0) = /octoprint/plugins/lib/python3.8/site-packages/octoprint_excluderegion
| File Check (2021.2.23) (bundled) = /usr/local/lib/python3.8/site-packages/octoprint_file_check
| Firmware Check (2021.10.11) (bundled) = /usr/local/lib/python3.8/site-packages/octoprint_firmware_check
| GCode Viewer (bundled) = /usr/local/lib/python3.8/site-packages/octoprint/plugins/gcodeviewer
| Logging (bundled) = /usr/local/lib/python3.8/site-packages/octoprint/plugins/logging
| !Octolapse (0.4.1) = /octoprint/plugins/lib/python3.8/site-packages/octoprint_octolapse
| Plugin Manager (bundled) = /usr/local/lib/python3.8/site-packages/octoprint/plugins/pluginmanager
| PrettyGCode (1.2.4) = /octoprint/plugins/lib/python3.8/site-packages/octoprint_prettygcode
| Software Update (bundled) = /usr/local/lib/python3.8/site-packages/octoprint/plugins/softwareupdate
| TouchUI (0.3.18) = /octoprint/plugins/lib/python3.8/site-packages/octoprint_touchui
| Virtual Printer (bundled) = /usr/local/lib/python3.8/site-packages/octoprint/plugins/virtual_printer
Prefix legend: ! = disabled, # = blacklisted, * = incompatible
2022-06-11 13:09:41,022 - octoprint.environment - INFO - Detected environment is Python 3.8.13 under Linux (linux). Details:
| hardware:
| cores: 4
| freq: 1500.0
| ram: 3978801152
| os:
| bits: 64
| id: linux
| platform: linux
| python:
| pip: 22.0.4
| version: 3.8.13
2022-06-11 13:09:41,042 - octoprint.server - INFO - Reset webasset folder /octoprint/octoprint/generated/webassets...
2022-06-11 13:09:41,044 - octoprint.server - INFO - Reset webasset folder /octoprint/octoprint/generated/.webassets-cache...
2022-06-11 13:09:41,045 - octoprint.server - INFO - Reset webasset folder /octoprint/octoprint/generated/.webassets-manifest.json...
2022-06-11 13:09:41,610 - octoprint.server - INFO - Shutting down intermediary server...
2022-06-11 13:09:41,844 - octoprint.server - INFO - Intermediary server shut down
2022-06-11 13:09:41,848 - octoprint.events - INFO - Processing startup event, this is our first event
2022-06-11 13:09:41,849 - octoprint.events - INFO - Adding 1 events to queue that were held back before startup event
2022-06-11 13:09:41,849 - octoprint.filemanager - INFO - Adding backlog items from all storage types to analysis queue...
2022-06-11 13:09:41,874 - octoprint.filemanager - INFO - Added 0 items from storage type "local" to analysis queue
2022-06-11 13:09:41,893 - octoprint.plugins.softwareupdate - INFO - Fetching check overlays from https://plugins.octoprint.org/update_check_overlay.json
2022-06-11 13:09:41,893 - octoprint.server.util.watchdog - INFO - Running initial scan on watched folder...
2022-06-11 13:09:41,914 - octoprint.plugins.pluginmanager - INFO - Loaded plugin repository data from disk, was still valid
2022-06-11 13:09:41,932 - octoprint.server.util.watchdog - INFO - ... initial scan done.
2022-06-11 13:09:42,864 - octoprint.plugins.discovery - INFO - Registered 'OctoPrint instance on 2a72915ba736._http._tcp.local.' for _http._tcp.local.
2022-06-11 13:09:43,280 - octoprint.plugins.pluginmanager - INFO - Loaded notice data from disk, was still valid
2022-06-11 13:09:43,732 - octoprint.plugins.discovery - INFO - Registered 'OctoPrint instance on 2a72915ba736._octoprint._tcp.local.' for _octoprint._tcp.local.
2022-06-11 13:09:43,736 - octoprint.plugins.discovery - INFO - Registered OctoPrint instance on 2a72915ba736 for SSDP
2022-06-11 13:09:43,741 - octoprint.server - INFO - Listening on http://0.0.0.0:5000
2022-06-11 13:09:43,785 - octoprint.plugins.pluginmanager - INFO - Loaded plugin repository data from disk, was still valid
2022-06-11 13:09:45,143 - octoprint.plugins.pluginmanager - INFO - Loaded notice data from disk, was still valid
2022-06-11 13:09:45,346 - octoprint.util.pip - INFO - Using "/usr/local/bin/python -m pip" as command to invoke pip
2022-06-11 13:09:45,349 - octoprint.util.pip - INFO - pip installs to /usr/local/lib/python3.8/site-packages (writable -> yes), --user flag needed -> no, virtual env -> no
2022-06-11 13:09:45,350 - octoprint.util.pip - INFO - ==> pip ok -> yes
2022-06-11 13:09:45,358 - octoprint.plugins.softwareupdate - INFO - Minimum free storage across all update relevant locations is 16.3GB. That is considered sufficient for updating.
2022-06-11 13:09:45,452 - octoprint.plugins.prettygcode - INFO - Pretty GCode.
2022-06-11 13:09:45,493 - octoprint.server.util.sockjs - INFO - New connection from client: 192.168.151.57
2022-06-11 13:09:45,515 - octoprint.server.preemptive_cache - INFO - Preemptively caching / (ui _default) for {'base_url': 'http://rpi:8080/', 'path': '/', 'query_string': 'l10n=en'}
2022-06-11 13:09:45,536 - octoprint.server.util.flask - INFO - Passively logging in user felix from 192.168.151.57
2022-06-11 13:09:45,536 - octoprint.access.users - INFO - Logged in user: felix
2022-06-11 13:09:45,560 - octoprint.plugins.tracking - INFO - Sent tracking event ping, payload: {'octoprint_uptime': 8, 'printer_state': 'OFFLINE'}
2022-06-11 13:09:45,678 - octoprint.plugins.tracking - INFO - Sent tracking event pong, payload: {'version': '1.8.1', 'os': 'linux', 'bits': 64, 'python': '3.8.13', 'pip': '22.0.4', 'cores': 4, 'freq': 1500.0, 'ram': 3978801152, 'plugins': 'touchui:0.3.18,prettygcode:1.2.4,excluderegion:0.3.0,crealitytemperature:1.2.4,camerasettings:0.4.0,ender3v2tempfix:0.0.4'}
2022-06-11 13:09:45,841 - octoprint.plugins.tracking - INFO - Sent tracking event startup, payload: {'version': '1.8.1', 'os': 'linux', 'bits': 64, 'python': '3.8.13', 'pip': '22.0.4', 'cores': 4, 'freq': 1500.0, 'ram': 3978801152}
2022-06-11 13:09:46,421 - octoprint.server.util.sockjs - INFO - User felix logged in on the socket from client 192.168.151.57
2022-06-11 13:09:48,209 - octoprint.plugins.camerasettings - INFO - Excluding camera bcm2835-isp-capture1 based on ^bcm2835-isp-\w+$
2022-06-11 13:09:48,222 - octoprint.plugins.camerasettings - INFO - Excluding camera bcm2835-isp-stats2 based on ^bcm2835-isp-\w+$
2022-06-11 13:09:48,250 - octoprint.plugins.camerasettings - INFO - Excluding camera bcm2835-isp-output0 based on ^bcm2835-isp-\w+$
2022-06-11 13:09:48,273 - octoprint.plugins.camerasettings - INFO - Excluding camera bcm2835-codec-encode_image based on ^bcm2835-codec-\w+$
2022-06-11 13:09:48,316 - octoprint.plugins.camerasettings - INFO - Excluding camera bcm2835-isp-capture0 based on ^bcm2835-isp-\w+$
2022-06-11 13:09:48,445 - octoprint.plugins.camerasettings - INFO - Excluding camera bcm2835-codec-encode based on ^bcm2835-codec-\w+$
2022-06-11 13:09:48,551 - octoprint.plugins.camerasettings - INFO - Excluding camera bcm2835-codec-image_fx based on ^bcm2835-codec-\w+$
2022-06-11 13:09:48,560 - octoprint.plugins.camerasettings - INFO - Excluding camera bcm2835-isp-stats2 based on ^bcm2835-isp-\w+$
2022-06-11 13:09:48,588 - octoprint.plugins.camerasettings - INFO - Excluding camera bcm2835-isp-capture0 based on ^bcm2835-isp-\w+$
2022-06-11 13:09:48,620 - octoprint.plugins.camerasettings - INFO - Excluding camera bcm2835-isp-capture1 based on ^bcm2835-isp-\w+$
2022-06-11 13:09:48,643 - octoprint.plugins.camerasettings - INFO - Excluding camera bcm2835-codec-isp based on ^bcm2835-codec-\w+$
2022-06-11 13:09:48,676 - octoprint.plugins.camerasettings - INFO - Excluding camera bcm2835-isp-output0 based on ^bcm2835-isp-\w+$
2022-06-11 13:09:48,783 - octoprint.plugins.camerasettings - INFO - Excluding camera bcm2835-codec-decode based on ^bcm2835-codec-\w+$
2022-06-11 13:09:53,451 - octoprint.server.preemptive_cache - INFO - ... done in 7.94s
2022-06-11 13:09:53,452 - octoprint.server.preemptive_cache - INFO - Preemptively caching / (ui _default) for {'base_url': 'http://192.168.151.62:8080/', 'path': '/', 'query_string': 'l10n=en'}
2022-06-11 13:09:53,930 - octoprint.server.preemptive_cache - INFO - ... done in 0.48s
2022-06-11 13:10:19,910 - octoprint.server.util.sockjs - INFO - Client connection closed: 192.168.151.57
docker-compose.yml & stdout of `docker-compose up`
docker-compose.yml
version: '2.4'
services:
octoprint:
image: octoprint/octoprint:latest
restart: unless-stopped
ports:
- 8080:80
devices:
# use `python -m serial.tools.miniterm` to see what the name is of the printer, this requires pyserial
- /dev/ttyUSB0:/dev/ttyUSB0
- /dev/video0:/dev/video0
volumes:
- octoprint:/octoprint
# uncomment the lines below to ensure camera streaming is enabled when
# you add a video device
environment:
- ENABLE_MJPG_STREAMER=true
volumes:
octoprint:
docker-compose up
(until the point where it is identical to octoprint.log)
octoprint_1 | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
octoprint_1 | [s6-init] ensuring user provided files have correct perms...exited 0.
octoprint_1 | [fix-attrs.d] applying ownership & permissions fixes...
octoprint_1 | [fix-attrs.d] done.
octoprint_1 | [cont-init.d] executing container initialization scripts...
octoprint_1 | [cont-init.d] 01-mjpg-streamer-config: executing...
octoprint_1 | [cont-init.d] 01-mjpg-streamer-config: exited 0.
octoprint_1 | [cont-init.d] v3-dir-structure-check: executing...
octoprint_1 | [cont-init.d] v3-dir-structure-check: exited 0.
octoprint_1 | [cont-init.d] done.
octoprint_1 | [services.d] starting services
octoprint_1 | MJPG Streamer Version.: 2.0
octoprint_1 | i: Using V4L2 device.: /dev/video0
octoprint_1 | i: Desired Resolution: 640 x 480
octoprint_1 | i: Frames Per Second.: -1
octoprint_1 | i: Format............: JPEG
octoprint_1 | i: TV-Norm...........: DEFAULT
octoprint_1 | i: Could not obtain the requested pixelformat: MJPG , driver gave us: YUYV
octoprint_1 | ... will try to handle this by checking against supported formats.
octoprint_1 | ... Falling back to YUV mode (consider using -yuv option). Note that this requires much more CPU power
octoprint_1 | o: www-folder-path......: /usr/local/share/mjpg-streamer/www/
octoprint_1 | o: HTTP TCP port........: 8080
octoprint_1 | o: HTTP Listen Address..: (null)
octoprint_1 | o: username:password....: disabled
octoprint_1 | o: commands.............: enabled
octoprint_1 | libv4l2: error turning on stream: Invalid argument
octoprint_1 | Unable to start capture: Invalid argument
octoprint_1 | i: Can't enable video in first time
octoprint_1 | i: cleaning up resources allocated by input thread
octoprint_1 | [services.d] done.
Additional information about your setup (OctoPrint version, OctoPi version, ...)
- latest version of the official docker image
- latest updates of Raspberry Pi OS lite (and thus docker & docker-compose)
- Raspberry Pi 4 Model B Rev 1.1
- Raspberry Pi Camera v2