Open wesleym opened 7 years ago
I hit the same issue
macOS 10.12.5
bin/go-mtpfs -debug usb,data,mtp,fuse xoom
2017/06/30 09:28:52 fatal error LIBUSB_ERROR_NOT_FOUND; closing connection.
2017/06/30 09:28:52 MTP request OpenSession [726241119]
send: 0x10 bytes with ep 0x1:
0000: 1000 0000 0100 0210 0000 0000 5f8f 492b ............_.I+
recv: 0x10 bytes with ep 0x81:
0000: 1000 0000 0300 1e20 0000 0000 c7f2 3424 ....... ......4$
2017/06/30 09:28:52 MTP response SessionAlreadyOpened [607449799]
2017/06/30 09:28:52 MTP request CloseSession []
send: 0xc bytes with ep 0x1:
0000: 0c00 0000 0100 0310 0000 0000 ............
recv: 0xc bytes with ep 0x81:
0000: 0c00 0000 0300 0120 0000 0000 ....... ....
2017/06/30 09:28:52 MTP response OK []
2017/06/30 09:28:52 MTP request OpenSession [1615948533]
send: 0x10 bytes with ep 0x1:
0000: 1000 0000 0100 0210 0000 0000 f56a 5160 .............jQ`
recv: 0xc bytes with ep 0x81:
0000: 0c00 0000 0300 0120 0000 0000 ....... ....
2017/06/30 09:28:52 MTP response OK []
2017/06/30 09:28:52 MTP request GetStorageIDs []
send: 0xc bytes with ep 0x1:
0000: 0c00 0000 0100 0410 0100 0000 ............
recv: 0x14 bytes with ep 0x81:
0000: 1400 0000 0200 0410 0100 0000 0100 0000 ................
0010: 0100 0100 ....
2017/06/30 09:28:52 MTP data 0x14 bytes
recv: 0xc bytes with ep 0x81:
0000: 0c00 0000 0300 0120 0100 0000 ....... ....
2017/06/30 09:28:52 MTP response OK []
2017/06/30 09:28:52 MTP decoded &mtp.Uint32Array{Values:[]uint32{0x10001}}
2017/06/30 09:28:52 MTP request GetStorageInfo [65537]
send: 0x10 bytes with ep 0x1:
0000: 1000 0000 0100 0510 0200 0000 0100 0100 ................
recv: 0x4a bytes with ep 0x81:
0000: 4a00 0000 0200 0510 0200 0000 0300 0200 J...............
0010: 0000 00f0 5a23 0300 0000 00e0 5f7d 0000 ....Z#......_}..
0020: 0000 0000 0040 1149 006e 0074 0065 0072 .....@.I.n.t.e.r
0030: 006e 0061 006c 0020 0073 0074 006f 0072 .n.a.l. .s.t.o.r
0040: 0061 0067 0065 0000 0000 .a.g.e....
2017/06/30 09:28:52 MTP data 0x4a bytes
recv: 0xc bytes with ep 0x81:
0000: 0c00 0000 0300 0120 0200 0000 ....... ....
2017/06/30 09:28:52 MTP response OK []
2017/06/30 09:28:52 MTP decoded &mtp.StorageInfo{StorageType:0x3, FilesystemType:0x2, AccessCapability:0x0, MaxCapability:0x3235af000, FreeSpaceInBytes:0x7d5fe000, FreeSpaceInImages:0x40000000, StorageDescription:"Internal storage", VolumeLabel:""}
2017/06/30 09:28:52 MTP request GetDeviceInfo []
send: 0xc bytes with ep 0x1:
0000: 0c00 0000 0100 0110 0300 0000 ............
recv: 0x13f bytes with ep 0x81:
0000: 3f01 0000 0200 0110 0300 0000 6400 0600 ?...........d...
0010: 0000 6400 266d 0069 0063 0072 006f 0073 ..d.&m.i.c.r.o.s
0020: 006f 0066 0074 002e 0063 006f 006d 003a .o.f.t...c.o.m.:
0030: 0020 0031 002e 0030 003b 0020 0061 006e . .1...0.;. .a.n
0040: 0064 0072 006f 0069 0064 002e 0063 006f .d.r.o.i.d...c.o
0050: 006d 003a 0020 0031 002e 0030 003b 0000 .m.:. .1...0.;..
0060: 0000 001e 0000 0001 1002 1003 1004 1005 ................
0070: 1006 1007 1008 1009 100a 100b 100c 100d ................
0080: 1014 1015 1016 1017 101b 1001 9802 9803 ................
0090: 9804 9805 9810 9811 98c1 95c2 95c3 95c4 ................
00a0: 95c5 9505 0000 0002 4003 4004 4005 4006 ........@.@.@.@.
00b0: 4004 0000 0001 d402 d403 5001 5000 0000 @.........P.P...
00c0: 001a 0000 0000 3001 3004 3005 3008 3009 ......0.0.0.0.0.
00d0: 300b 3001 3802 3804 3807 3808 380b 380d 0.0.8.8.8.8.8.8.
00e0: 3801 b902 b903 b982 b983 b984 b905 ba10 8...............
00f0: ba11 ba14 ba82 ba06 b904 4c00 4700 4500 ..........L.G.E.
0100: 0000 084e 0065 0078 0075 0073 0020 0035 ...N.e.x.u.s. .5
0110: 0000 0004 3100 2e00 3000 0000 1130 0034 ....1...0....0.4
0120: 0061 0064 0033 0039 0039 0038 0066 0030 .a.d.3.9.9.8.f.0
0130: 0063 0037 0034 0062 0061 0030 0000 00 .c.7.4.b.a.0...
2017/06/30 09:28:52 MTP data 0x13f bytes
recv: 0xc bytes with ep 0x81:
0000: 0c00 0000 0300 0120 0300 0000 ....... ....
2017/06/30 09:28:52 MTP response OK []
2017/06/30 09:28:52 MTP decoded &mtp.DeviceInfo{StandardVersion:0x64, MTPVendorExtensionID:0x6, MTPVersion:0x64, MTPExtension:"microsoft.com: 1.0; android.com: 1.0;", FunctionalMode:0x0, OperationsSupported:[]uint16{0x1001, 0x1002, 0x1003, 0x1004, 0x1005, 0x1006, 0x1007, 0x1008, 0x1009, 0x100a, 0x100b, 0x100c, 0x100d, 0x1014, 0x1015, 0x1016, 0x1017, 0x101b, 0x9801, 0x9802, 0x9803, 0x9804, 0x9805, 0x9810, 0x9811, 0x95c1, 0x95c2, 0x95c3, 0x95c4, 0x95c5}, EventsSupported:[]uint16{0x4002, 0x4003, 0x4004, 0x4005, 0x4006}, DevicePropertiesSupported:[]uint16{0xd401, 0xd402, 0x5003, 0x5001}, CaptureFormats:[]uint16{}, PlaybackFormats:[]uint16{0x3000, 0x3001, 0x3004, 0x3005, 0x3008, 0x3009, 0x300b, 0x3801, 0x3802, 0x3804, 0x3807, 0x3808, 0x380b, 0x380d, 0xb901, 0xb902, 0xb903, 0xb982, 0xb983, 0xb984, 0xba05, 0xba10, 0xba11, 0xba14, 0xba82, 0xb906}, Manufacturer:"LGE", Model:"Nexus 5", DeviceVersion:"1.0", SerialNumber:"04ad3998f0c74ba0"}
2017/06/30 09:28:52 MTP request GetStorageInfo [65537]
send: 0x10 bytes with ep 0x1:
0000: 1000 0000 0100 0510 0400 0000 0100 0100 ................
recv: 0x4a bytes with ep 0x81:
0000: 4a00 0000 0200 0510 0400 0000 0300 0200 J...............
0010: 0000 00f0 5a23 0300 0000 00e0 5f7d 0000 ....Z#......_}..
0020: 0000 0000 0040 1149 006e 0074 0065 0072 .....@.I.n.t.e.r
0030: 006e 0061 006c 0020 0073 0074 006f 0072 .n.a.l. .s.t.o.r
0040: 0061 0067 0065 0000 0000 .a.g.e....
2017/06/30 09:28:52 MTP data 0x4a bytes
recv: 0xc bytes with ep 0x81:
0000: 0c00 0000 0300 0120 0400 0000 ....... ....
2017/06/30 09:28:52 MTP response OK []
2017/06/30 09:28:52 MTP decoded &mtp.StorageInfo{StorageType:0x3, FilesystemType:0x2, AccessCapability:0x0, MaxCapability:0x3235af000, FreeSpaceInBytes:0x7d5fe000, FreeSpaceInImages:0x40000000, StorageDescription:"Internal storage", VolumeLabel:""}
2017/06/30 09:28:52 mount failed: no FUSE devices found
dmaclach-macbookpro4:go dmaclach$
I think this is the message if OSX FUSE is not isntalled. Can you confirm that you have some FUSE FS mounted?
Having similar symptoms here. 2010 MacBook OSX 10.11.6
Looks like the same output before/after installing OSX FUSE using osxfuse-3.6.3.dmg from their site, here's what I got after installing and rebooting:
./go-mtpfs -debug usb,data,mtp,fuse n7 2017/08/16 13:46:31 fatal error LIBUSB_ERROR_NOT_FOUND; closing connection. 2017/08/16 13:46:31 MTP request OpenSession [1661691511] send: 0x10 bytes with ep 0x2: 0000: 1000 0000 0100 0210 0000 0000 7766 0b63 ............wf.c recv: 0x10 bytes with ep 0x81: 0000: 1000 0000 0300 1e20 0000 0000 f93c c738 ....... .....<.8 2017/08/16 13:46:31 MTP response SessionAlreadyOpened [952581369] 2017/08/16 13:46:31 MTP request CloseSession [] send: 0xc bytes with ep 0x2: 0000: 0c00 0000 0100 0310 0000 0000 ............ recv: 0xc bytes with ep 0x81: 0000: 0c00 0000 0300 0120 0000 0000 ....... .... 2017/08/16 13:46:31 MTP response OK [] 2017/08/16 13:46:31 MTP request OpenSession [890242095] send: 0x10 bytes with ep 0x2: 0000: 1000 0000 0100 0210 0000 0000 2f04 1035 ............/..5 recv: 0xc bytes with ep 0x81: 0000: 0c00 0000 0300 0120 0000 0000 ....... .... 2017/08/16 13:46:31 MTP response OK [] 2017/08/16 13:46:31 MTP request GetStorageIDs [] send: 0xc bytes with ep 0x2: 0000: 0c00 0000 0100 0410 0100 0000 ............ recv: 0x14 bytes with ep 0x81: 0000: 1400 0000 0200 0410 0100 0000 0100 0000 ................ 0010: 0100 0100 .... 2017/08/16 13:46:31 MTP data 0x14 bytes recv: 0xc bytes with ep 0x81: 0000: 0c00 0000 0300 0120 0100 0000 ....... .... 2017/08/16 13:46:31 MTP response OK [] 2017/08/16 13:46:31 MTP decoded &mtp.Uint32Array{Values:[]uint32{0x10001}} 2017/08/16 13:46:31 MTP request GetStorageInfo [65537] send: 0x10 bytes with ep 0x2: 0000: 1000 0000 0100 0510 0200 0000 0100 0100 ................ recv: 0x4a bytes with ep 0x81: 0000: 4a00 0000 0200 0510 0200 0000 0300 0200 J............... 0010: 0000 00f0 cde4 0600 0000 00d0 6ce0 0400 ............l... 0020: 0000 0000 0040 1149 006e 0074 0065 0072 .....@.I.n.t.e.r 0030: 006e 0061 006c 0020 0073 0074 006f 0072 .n.a.l. .s.t.o.r 0040: 0061 0067 0065 0000 0000 .a.g.e.... 2017/08/16 13:46:31 MTP data 0x4a bytes recv: 0xc bytes with ep 0x81: 0000: 0c00 0000 0300 0120 0200 0000 ....... .... 2017/08/16 13:46:31 MTP response OK [] 2017/08/16 13:46:31 MTP decoded &mtp.StorageInfo{StorageType:0x3, FilesystemType:0x2, AccessCapability:0x0, MaxCapability:0x6e4cdf000, FreeSpaceInBytes:0x4e06cd000, FreeSpaceInImages:0x40000000, StorageDescription:"Internal storage", VolumeLabel:""} 2017/08/16 13:46:31 MTP request GetDeviceInfo [] send: 0xc bytes with ep 0x2: 0000: 0c00 0000 0100 0110 0300 0000 ............ recv: 0x141 bytes with ep 0x81: 0000: 4101 0000 0200 0110 0300 0000 6400 0600 A...........d... 0010: 0000 6400 266d 0069 0063 0072 006f 0073 ..d.&m.i.c.r.o.s 0020: 006f 0066 0074 002e 0063 006f 006d 003a .o.f.t...c.o.m.: 0030: 0020 0031 002e 0030 003b 0020 0061 006e . .1...0.;. .a.n 0040: 0064 0072 006f 0069 0064 002e 0063 006f .d.r.o.i.d...c.o 0050: 006d 003a 0020 0031 002e 0030 003b 0000 .m.:. .1...0.;.. 0060: 0000 001e 0000 0001 1002 1003 1004 1005 ................ 0070: 1006 1007 1008 1009 100a 100b 100c 100d ................ 0080: 1014 1015 1016 1017 101b 1001 9802 9803 ................ 0090: 9804 9805 9810 9811 98c1 95c2 95c3 95c4 ................ 00a0: 95c5 9505 0000 0002 4003 4004 4005 4006 ........@.@.@.@. 00b0: 4004 0000 0001 d402 d403 5001 5000 0000 @.........P.P... 00c0: 001a 0000 0000 3001 3004 3005 3008 3009 ......0.0.0.0.0. 00d0: 300b 3001 3802 3804 3807 3808 380b 380d 0.0.8.8.8.8.8.8. 00e0: 3801 b902 b903 b982 b983 b984 b905 ba10 8............... 00f0: ba11 ba14 ba82 ba06 b905 6100 7300 7500 ..........a.s.u. 0100: 7300 0000 084e 0065 0078 0075 0073 0020 s....N.e.x.u.s. 0110: 0037 0000 0004 3100 2e00 3000 0000 1130 .7....1...0....0 0120: 0031 0035 0064 0032 0036 0032 0065 0033 .1.5.d.2.6.2.e.3 0130: 0031 0030 0063 0031 0030 0031 0033 0000 .1.0.c.1.0.1.3.. 0140: 00 . 2017/08/16 13:46:31 MTP data 0x141 bytes recv: 0xc bytes with ep 0x81: 0000: 0c00 0000 0300 0120 0300 0000 ....... .... 2017/08/16 13:46:31 MTP response OK [] 2017/08/16 13:46:31 MTP decoded &mtp.DeviceInfo{StandardVersion:0x64, MTPVendorExtensionID:0x6, MTPVersion:0x64, MTPExtension:"microsoft.com: 1.0; android.com: 1.0;", FunctionalMode:0x0, OperationsSupported:[]uint16{0x1001, 0x1002, 0x1003, 0x1004, 0x1005, 0x1006, 0x1007, 0x1008, 0x1009, 0x100a, 0x100b, 0x100c, 0x100d, 0x1014, 0x1015, 0x1016, 0x1017, 0x101b, 0x9801, 0x9802, 0x9803, 0x9804, 0x9805, 0x9810, 0x9811, 0x95c1, 0x95c2, 0x95c3, 0x95c4, 0x95c5}, EventsSupported:[]uint16{0x4002, 0x4003, 0x4004, 0x4005, 0x4006}, DevicePropertiesSupported:[]uint16{0xd401, 0xd402, 0x5003, 0x5001}, CaptureFormats:[]uint16{}, PlaybackFormats:[]uint16{0x3000, 0x3001, 0x3004, 0x3005, 0x3008, 0x3009, 0x300b, 0x3801, 0x3802, 0x3804, 0x3807, 0x3808, 0x380b, 0x380d, 0xb901, 0xb902, 0xb903, 0xb982, 0xb983, 0xb984, 0xba05, 0xba10, 0xba11, 0xba14, 0xba82, 0xb906}, Manufacturer:"asus", Model:"Nexus 7", DeviceVersion:"1.0", SerialNumber:"015d262e310c1013"} 2017/08/16 13:46:31 MTP request GetStorageInfo [65537] send: 0x10 bytes with ep 0x2: 0000: 1000 0000 0100 0510 0400 0000 0100 0100 ................ recv: 0x4a bytes with ep 0x81: 0000: 4a00 0000 0200 0510 0400 0000 0300 0200 J............... 0010: 0000 00f0 cde4 0600 0000 00d0 6ce0 0400 ............l... 0020: 0000 0000 0040 1149 006e 0074 0065 0072 .....@.I.n.t.e.r 0030: 006e 0061 006c 0020 0073 0074 006f 0072 .n.a.l. .s.t.o.r 0040: 0061 0067 0065 0000 0000 .a.g.e.... 2017/08/16 13:46:31 MTP data 0x4a bytes recv: 0xc bytes with ep 0x81: 0000: 0c00 0000 0300 0120 0400 0000 ....... .... 2017/08/16 13:46:31 MTP response OK [] 2017/08/16 13:46:31 MTP decoded &mtp.StorageInfo{StorageType:0x3, FilesystemType:0x2, AccessCapability:0x0, MaxCapability:0x6e4cdf000, FreeSpaceInBytes:0x4e06cd000, FreeSpaceInImages:0x40000000, StorageDescription:"Internal storage", VolumeLabel:""} 2017/08/16 13:46:31 mount failed: no FUSE devices found
Good news guys (seems to be outdated issue anyway), I had similar issue and found that calling mtp.Device.claim()
before any communication solves the LIBUSB_ERROR_NOT_FOUND
issue.
git clone
-> go build .
diff --git a/mtp/mtp.go b/mtp/mtp.go
index 3c90d5b..0524e22 100644
--- a/mtp/mtp.go
+++ b/mtp/mtp.go
@@ -146,6 +146,7 @@ func (d *Device) Open() error {
return err
}
+ d.claim()
if d.ifaceDescr.InterfaceStringIndex == 0 {
// Some of the win8phones have no interface field.
info := DeviceInfo{}
@@ -168,7 +169,6 @@ func (d *Device) Open() error {
}
}
- d.claim()
return nil
}
I don't know if it's portable between serveral OSes but anyway it's working on my Mac.
I was hacking my fork and it seems it works on Windows, macOS, and Linux.
@puhitaku
I was hacking my fork and it seems it works on Windows, macOS, and Linux.
I have raised a PR with your patch.
I built go-mtpfs from source but can't make it connect to my phone.
The debug output seems to show some MTP communication. The DeviceInfo retrieved doesn't seem obviously wrong. It's not clear why LIBUSB_ERROR_NOT_FOUND is printed first though.
Hardware
MacBook Pro (Retina, 15-inch, Mid 2015); MacBookPro11,5 HTC One X+
Versions
go-mtpfs: bc7c0f7 go-fuse: 6c2b7d8 usb: 69aee45
libusb: from Homebrew, described as: stable 1.0.20 (bottled), HEAD FUSE for macOS: 3.5.4, installed without MacFUSE compatibility layer
macOS 10.12.2 Android 4.2.2