The Perfect Exchange - MTP
I’ve been learning more about MTP as I start thinking about how I want to implement the indexer. I’m just going to do a brain dump here.
Resources
- MTP 1.1 Spec - Looks like a good resource.
libmtp
- A C library for interacting with MTP devices. I could use this to write the indexer, but talking to the Firebase index would be painful.- Ruby LibMTP - A ruby library that wraps libmtp. This is attractive because there is also a ruby gem for talking to Firebase. The downside is that the libmtp wrapper isn’t in Gem form.
- rubymtp - Supposed to be better to work with than Ruby LibMTP? (This is a gem.)
- MTP - ArchWiki - ArchWiki’s page describing how to get a linux system to automatically recognize MTP devices. I’ll need to set this up on the indexer to avoid having to manually intervene.
Something interesting that I found: libmtp only supports connecting to the first device that it finds. (So I can only have one MTP device plugged in at a time.)
Conclusions
- I’m going to need to do all my testing and development on a linux box. OSX is different enough that it’s not going to cut it here.
- The indexer will only be able to handle one MTP device at a time.
- I need to experiment with both Ruby LibMTP and rubymtp to see which one meets my needs, or which I prefer if they both will work.
And just a random final thought I had: it would be slick if the Pi could give some kind of visual feedback to signal that indexing for a device is complete.