Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse
Brand Logo

ModalAI Forum

  1. ModalAI Support Forum
  2. Software Development
  3. How to save images into the SD card using gphoto2.

How to save images into the SD card using gphoto2.

Scheduled Pinned Locked Moved Software Development
9 Posts 3 Posters 3.1k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alex123
    Contributor
    wrote on last edited by
    #1

    Hi,
    I'm using gphoto library to save the camera images into the voxl core-board by following https://docs.modalai.com/voxl-libgphoto2/

    I am looking for a way to save the images into the SD card instead of saving them into the internal memory of the voxl core-board.

    As well as I am looking for a way to have filenames numbered as they're saved instead of asking to overwrite the previous photos (like capt001.arw, capt002.arw, and so on).
    Command: gphoto2 --capture-image-and-download

    Thank you.

    1 Reply Last reply
    0
    • modaltbM Offline
      modaltbM Offline
      modaltb
      ModalAI Team
      wrote on last edited by
      #2

      Hi @Alex123 ,

      Have you tried using the --filename FILENAME option?

      http://www.gphoto.org/doc/manual/ref-gphoto2-cli.html

      Thanks!

      A 2 Replies Last reply
      0
      • modaltbM modaltb

        Hi @Alex123 ,

        Have you tried using the --filename FILENAME option?

        http://www.gphoto.org/doc/manual/ref-gphoto2-cli.html

        Thanks!

        A Offline
        A Offline
        Alex123
        Contributor
        wrote on last edited by
        #3

        @modaltb
        No.
        I'll try this and let you know.
        And how can I save the images on SD card?

        Thanks!

        tomT 1 Reply Last reply
        0
        • A Alex123

          @modaltb
          No.
          I'll try this and let you know.
          And how can I save the images on SD card?

          Thanks!

          tomT Offline
          tomT Offline
          tom
          admin
          wrote on last edited by
          #4

          @Alex123 If you save a file to the /sdcard/ directory it will be saved onto the SD card.

          1 Reply Last reply
          0
          • modaltbM modaltb

            Hi @Alex123 ,

            Have you tried using the --filename FILENAME option?

            http://www.gphoto.org/doc/manual/ref-gphoto2-cli.html

            Thanks!

            A Offline
            A Offline
            Alex123
            Contributor
            wrote on last edited by
            #5

            Hi @modaltb

            I've tried it using --filename FILENAME option, but it's saving images only in a specified pattern. It's not ignoring the overwrite option.
            The image name should be different from the previous images in my case.

            Thanks!

            1 Reply Last reply
            0
            • A Offline
              A Offline
              Alex123
              Contributor
              wrote on last edited by Alex123
              #6

              Hi @tom

              Using voxl core-board, when we run "docker run -i -t --rm -v /dev/bus/usb/:/dev/bus/usb --net=host --privileged libgphoto2" command, we get
              root@apq8096:/#

              In this, we are unable to get an SD card.

              root@apq8096:/# ls
              FFmpeg etc media root sys voxl-libgphoto2
              bin gphoto2-updater.sh mnt run tmp voxl-libgphoto2.py
              boot home opt sbin usr
              dev lib proc srv var

              root@apq8096:/# cd mnt/
              root@apq8096:/mnt# ls
              root@apq8096:/mnt#

              In adb shell,
              / # ls
              WEBSERVER data flight_controller lost+found proc srv usr
              bin dev home media run sys var
              boot dsp lib mnt sbin system vendor
              build.prop etc lib64 opt sdcard target
              cache firmware linuxrc persist share tmp

              we can get an SD card in the /mnt directory.
              / # cd mnt/

              /mnt # ls
              sdcard

              So if we are in "root@apq8096:/#" then how to access the /sdcard/ directory?
              And how to write an image into sdcard?

              I've tried like this,
              gphoto2 --capture-image-and-download --folder=/mnt/sdcard/
              It's not saving the images into an SD card.

              Thanks!

              1 Reply Last reply
              0
              • tomT Offline
                tomT Offline
                tom
                admin
                wrote on last edited by
                #7

                Hi @Alex123

                It looks like in order to access the sdcard directory in Docker you will have to mount it similar to how the /dev/bus/usb directory is mounted.

                You can do this by adding another mounting path to the Docker run command, similar to:
                docker run -i -t --rm -v /dev/bus/usb/:/dev/bus/usb -v /sdcard:/sdcard --net=host --privileged libgphoto2

                You should now be able to access the /sdcard directory in Docker.

                As for the naming issues, I'm not positive on the correct answer however gphoto2 has fairly good documentation on their different command line options here: http://www.gphoto.org/doc/manual/ref-gphoto2-cli.html#cli-examples

                A 1 Reply Last reply
                0
                • tomT tom

                  Hi @Alex123

                  It looks like in order to access the sdcard directory in Docker you will have to mount it similar to how the /dev/bus/usb directory is mounted.

                  You can do this by adding another mounting path to the Docker run command, similar to:
                  docker run -i -t --rm -v /dev/bus/usb/:/dev/bus/usb -v /sdcard:/sdcard --net=host --privileged libgphoto2

                  You should now be able to access the /sdcard directory in Docker.

                  As for the naming issues, I'm not positive on the correct answer however gphoto2 has fairly good documentation on their different command line options here: http://www.gphoto.org/doc/manual/ref-gphoto2-cli.html#cli-examples

                  A Offline
                  A Offline
                  Alex123
                  Contributor
                  wrote on last edited by Alex123
                  #8

                  @tom
                  Yes, it's working.

                  Thanks!

                  tomT 1 Reply Last reply
                  0
                  • A Alex123

                    @tom
                    Yes, it's working.

                    Thanks!

                    tomT Offline
                    tomT Offline
                    tom
                    admin
                    wrote on last edited by
                    #9

                    @Alex123 Glad I could help!

                    1 Reply Last reply
                    0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    ModalAI
                    Categories Recent Tags ModalAI.com Docs
                    © 2026 ModalAI® · Accelerating autonomy for smaller, smarter, safer drones · Powered by NodeBB
                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups