Connect an MTP client via USB OTG to a SFOS device

Hi forum,
short explanation: In the past, on vacation trips, I often copied GPX files to my Garmin GPS device via USB OTG. The old devices just mounted as an USB drive when connected to USB.
Unfortunatly the newer Garmin devices (im my case an GPSMAP 67) now present themselves as an MTP client. Is there any chance to mount such drive so I can transfer a file from my SFOS phone to the Garmin?

Thanks.

2 Likes

Of course you can. MTP = Media Transfer Protocol. Default when connecting USB cable.

Sure, when you connect a SFOS device to a computer you see it via MTP. However in my situation, I have no computer at hand and just want to connect the GARMIN GPS device , which also uses MTP to my SFOS phone via USB OTG. However I cannot see the GARMIN in the file manager on the phone.

No, youā€™ll have to do the operation from your Garmin, if possible. I donā€™t have a garmin so I couldnā€™t tell for sure. I just thought that there was some import option.
Otherwise you could possible go phone to PC to Garmin workaround.

Unfortunately, I think the Garmin also has only a client site implementation (if that is the right term) for MTP. The only (inconvenient) way, I found is plugging the micro SD Card out of the GARMIN and plug it into the phone and copy the file to the SD card. This is quite a hassle, because I need to get the SIM tray out of the phone.

Wouldnā€™t it be nice if the SFOS phone could also act like the MTP server (like a computer does). This way you could also plug e.g. also two SFOS phones together via USB OTG and move files back an forth?

1 Like

So you canā€™t export from PC to Garmin?

Edit:
Sorry, somehow I missed that you do not have a PC.

I have a PC. I just donā€™t take it with me on a hiking trip. I download a GPX track from the internet with the phone and want to put it on the GPS device. Surely I could also use the GPX track file with e.g. Puremaps and use my phone for navigation. The GARMIN device however has a much better battery life compared to the phone.

4 Likes

Not that I know anything about Garnin devices, but maybe thereā€™s another way to get stuff off it?

E.g. Connecting to the deviceā€™s wifi, like you can do with many digital cameras?

The spec page lists both Wifi and ā€˜appā€™ connectivity (which I assume is bluetooth, which is complicated).

The device can connect via Wifi as well as BT. For an Android or iOS phone, there is a dedicated ā€œGarmin connectā€ app to transfer data. This App however doesnā€™t work with the Android App Support under SFOS due to the well known Bluetooth restrictions. I couldnā€™t figure out how the app communicates with the device.

Yes, what I meant is can it offer a wlan conection (access point) for the phone to connect to?

If so thereā€™s a good chance thereā€™s some kind of web-based API one could use to get what you want using e.g. a python script. In the easiest case just connect via Browser.

@kraemera
Maybe it is possible to connect an USB-Stick with SD-Card reader via USB OTG cable to your phone.

I checked, it doesnā€™t offer an access point. It can connect to WLAN access points and you enter the SSID and password on the device.

Thanks, I will try this out.

Well, I was successful with transfer photos and remotely control digital camera from Xperia 10 II via USB OTG cable. TimeLapse tools is using gphoto library for thatā€¦

So, I believe that everything you need is to find command line tool / library that is able to communicate with Garmin via MTP protocol and compile it for phone. GPhoto2 may be enough, but I have no Garmin device to try it. Or libmtp possiblyā€¦?

Thanks very much for the hint. I will look into it. I however did not yet compile anything for the phone.
One question: In your case with the camera. Do you think, that you could mount the MTP share of the camera, so it appears in the file browser? Something in the direction of this article:

?

Looks promising. On it!

Well, it compilesā€¦

Completely and utterly untested:

https://build.sailfishos.org/package/show/home:nephros:devel:packaging/jmtpfs

and the lib dependency:

https://build.sailfishos.org/package/show/home:nephros:devel:packaging/libmtp

Please play with it, and report any findings!

1 Like

Compiling should not be neccessary for a quick test. I just pulled jmtpfs_0.5-3_armhf.deb and libmtp9_1.1.17-3_armhf.deb from a Debian repository, extracted them and moved libmtp.so.9.4.0 and jmtpfs into a subdirectory of my XA2. After renaming/linking libmtp.so.9.4.0 to libmtp.so.9 and setting LD_LIBRARY_PATH to point to the work directory, jsmtpfs could be started.

Unfortunately I havent got a wire to link USB-C to the socket of my Zumo, but jsmtp from my pc to the Garmin Zumo works.

2 Likes

I will try it out, when I find some time. Thanks a lot.

I have aUSB-C OTG adapter, but I think connecting it should work also with any USB-C dock ā€¦ for example from a laptop.