0

We have a python program that scans the mounted drive letters (or volumes, for Linux) for a certain file that indicates a Garmin handheld GPS. But, the Garmin Alpha 200i is mounted by windows as a 'Device' and not as a 'Drive', and therefore it has no drive letter and you can't get to it from Windows batch or Powershell in the standard C:/Folder notation.

How can we go about accessing the files on the 'Device' from python (or batch or PowerShell)?

enter image description here

It's definitely a mass storage device and has a directory structure - just not sure how to get to it programmatically:

enter image description here

enter image description here

Thinking that this is a Windows or python question, rather than a Garmin question. This is the first Garmin handheld GPS model we've encountered that mounts as a 'Device' instead of a 'Drive'.

The Garmin manual says that the handheld should be recognized as one or two removable drives, but, that is not the case. Earlier GPS models do mount up as two drives - one for the handheld's internal storage and another for its memory card if any.

AABULUT
  • 50
  • 4
Tom Grundy
  • 736
  • 5
  • 26
  • I guess it works in MTP mode: https://stackoverflow.com/questions/11161747/how-to-access-an-mtp-usb-device-with-python – viilpe Apr 07 '21 at 08:56

1 Answers1

0

Modern devices use Media Transfer Protocol (MTP) instead of USB Mass storage.

This protocol is intentionally nerved, however, and cannot provide drive letters.

You can try one of the Python wrappers for LibMTP.

Turbo J
  • 7,563
  • 1
  • 23
  • 43
  • Thanks - I never noticed that my phone behaves the same way in that it doesn't mount as a drive letter. Looking at available options for libmtp and its python wrappers on Windows, (pymtp is apparently python2-only; mtpy is apparently linux-only) it doesn't seem like there are any turn-key out-of-the-box solutions, except for MPTDrive.com which is not free. It's interesting that there's no out-of-the-box solution for this by now - or maybe I'm missing something more obvious? – Tom Grundy Apr 07 '21 at 17:09
  • Yup - MTP it is, thanks for pointing it out. I was not familiar with MTP before. I've been exploring the best way to talk with it, and the mtpmount project is what I'm going with for now, mainly since it has easy turnkey installation. Currently I'm trying to figure out if the unmount process is strictly required (from the point of view of mtpmount and dokany) since we work in an environment where things are just usually hot-unplugged immediately after the file transfer. Anyway thanks for the solution to this particular question! – Tom Grundy Apr 25 '21 at 14:06