Gphoto2 PTP Operation not supported in

Hi there,

I am running octoprint in a docker container. Octoprint itself works but I am unable to get gphoto2 to perform "capture-image-and-download" successfully.

Observed result
gphoto2 --list-ports : lists ports as expected
gphoto2 --summary : Reports everything about the DSLR camera attached (Nikon D3100)
gphoto2 --capture-image-and-download : triggers image capture on the camera and downloads the image to the docker container. But it also reports " Error PTP Operation Not Supported"

Desired result
gphoto2 --capture-image-and-download : triggers image capture on the camera and downloads the image to docker. No error reported.

I tested this by re-creating a docker container with debian:11 (ie. instead of the octoprint docker image) and I am able to achieve the desired result, ie. image capture and download with no error reported.

Any advice is highly appreciated.

Kind regards,

Dockerfile (octoprint)

FROM octoprint/octoprint:latest


# install the image dependencies
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install build-essential -y
RUN apt-get install locales -y && dpkg-reconfigure locales
RUN apt-get install vim -y

RUN apt-get install libtool -y
RUN apt-get install libusb-1.0-0-dev -y
RUN apt-get install libexif-dev -y
RUN apt-get install libusb-dev -y
RUN apt-get install usbutils -y
RUN apt-get install libpopt-dev -y

RUN apt-get install libgphoto2-6 -y
RUN apt-get install gphoto2 -y

docker-compose file (octoprint)

version: '2.2'

      context: .
      dockerfile: Dockerfile
    privileged: true
    restart: unless-stopped
      - 80:80
    # use `python -m` to see what the name is of the printer, this requires pyserial
      - /dev/ttyACM0:/dev/ttyACM0
      - /dev/bus/usb:/dev/bus/usb
        #- /dev/video0:/dev/video0
      - octoprint:/octoprint
      - /usr/bin/vcgencmd:/usr/bin/vcgencmd
      - /usr/lib/arm-linux-gnueabihf/
      - /usr/lib/arm-linux-gnueabihf/
    # uncomment the lines below to ensure camera streaming is enabled when
    # you add a video device
        #- MJPG_STREAMER_INPUT=-n -r 1920x1080 -f 30
        #- CAMERA_DEV=/dev/video0
        #- TZ=Europe/Berlin


Does it work outside the docker container?

Oh, overlooked the fact it worked in a different one. The OctoPrint container is based on Buster(? I think?), so maybe that is a source of differences for your setup.

Hello Charlie,

Yes it works outside the container and you are right it's an issue with buster.... though I don't know what it is exactly. I tested it on an image using buster and it reported the same PTP error as the octoprint image. Bullseye works fine though. Perhaps it would have been more appropriate to have posted this on the raspberry pi forum instead. Thank you for your suggestion!

Kind regards,


Hello there,

Thank you for the suggestion! Short update, just in case someone else runs into this issue. I found it was easier to build a new docker image with bullseye, rather than debugging the existing image that is on buster.

Managed to get it working but need to increase the required timeout on my ancient camera.

Kind regards,

1 Like