Problems connecting to Canon Powershot G9X using PTPIP

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problems connecting to Canon Powershot G9X using PTPIP

Michael Schaffner
Hi,

i am trying to use my Canon Powershot G9 X with gphoto2.
Using USB everything works (using digikam in debian stretch).
Using PTPIP there is no success so far (after reading lots of blog
posts,mailing list posts and so on).

I connected the camera successfully using the original canon software
and captured the initial Handshake using Wireshark/libpcap on a Windows
10 machine.

When filtering the captured packets for ptpip, the first lines i got were:
Init Command Request GUID: 0000000000000000ffff821934822fef Name: AEBOOK
Init Command Ack Connection #:23213 GUID:
372671113c97074fb908945be4dfa273 Name: Canon PowerShot G9 X

So i put the line
ptp2_ip=guid=00:00:00:00:00:00:00:00:ff:ff:82:19:34:82:2f:ef
in ~/.gphoto2/settings.

Being still not successful i used
env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt --port
ptpip:192.168.10.211 --camera "PTP/IP Camera" -L
to get a logfile. Here is the relevant (imho) part:

0.092198 gp_camera_folder_list_files (2): Listing files in '/'...
0.092231 gp_camera_init              (2): Initializing camera...
0.092265 gp_camera_init              (2): Loading
'/usr/lib/x86_64-linux-gnu/libgphoto2/2.5.12/ptp2'...
0.094304 gp_port_open                (2): Opening  port...
0.094496 ptp_ptpip_connect           (2): connecting to
ptpip:192.168.10.211.
0.099013 ptp_ptpip_init_command_request(3): ptpip/init_cmd data:
(hexdump of 42 bytes)
0000  2a 00 00 00 01 00 00 00-00 00 00 00 00 00 00 00  *...............
0010  ff ff 82 19 34 82 2f ef-41 00 45 00 42 00 4f 00  ....4./.A.E.B.O.
0020  4f 00 4b 00 00 00 00 00-01 00                    O.K.......

0.099136 ptp_ptpip_init_command_request [ptpip.c:473](0): return 42 / len 42
0.101962 ptp_ptpip_generic_read      (3): ptpip/generic_read header:
(hexdump of 8 bytes)
0000  0c 00 00 00 05 00 00 00-                         ........

0.101994 ptp_ptpip_generic_read      (3): ptpip/generic_read data:
(hexdump of 4 bytes)
0000  01 00 00 00            -                         ....

0.102004 ptp_ptpip_init_command_ack [ptpip.c:498](0): bad type returned 5
0.102056 camera_init [library.c:7678](0): Failed to connect.
0.102065 gp_port_close               (2): Closing port...
0.102423 gp_context_error            (0): An error occurred in the
io-library ('Unspecified error'): No error description available
0.103179 gp_camera_free              (2): Freeing camera...
0.103199 gp_port_free                (2): Freeing port...
0.103206 gp_port_close               (2): Closing port...
0.103251 gp_filesystem_reset         (2): resetting filesystem
0.103259 gp_filesystem_lru_clear     (2): Clearing fscache LRU list...
0.103265 gp_filesystem_lru_clear     (2): fscache LRU list already empty
0.103271 delete_all_folders          (2): Internally deleting all
folders from '/'...
0.103277 lookup_folder               (2): Lookup folder '/'...
0.103284 lookup_folder               (2): Found! / is 0x5556a2498420
0.103290 recurse_delete_folder       (2): Recurse delete folder
0x5556a2498420//

The error "bad type returned 5" is still the same as in my first tests
without any capturing/messing with GUIDs, etc.
As im not really understanding whats going on here i even tried to use
both GUIDs from the Capture - in desperation i even patched libgphoto2
to hardcode the hostname to AEBOOK (which is the name of the Windows
machine i used for testing) just in case :-).

Still no luck.

Has anybody succesfully connected a G9X (or another newer Canon Camera)
using PTPIP and libgphoto2 or are some of the above steps terribly wrong?

Thanks and bye..
Michael Schaffner

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gphoto-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gphoto-user
Reply | Threaded
Open this post in threaded view
|

Re: Problems connecting to Canon Powershot G9X using PTPIP

Marcus Meissner
On Sun, May 21, 2017 at 08:07:44PM +0200, Michael Schaffner wrote:

> Hi,
>
> i am trying to use my Canon Powershot G9 X with gphoto2.
> Using USB everything works (using digikam in debian stretch).
> Using PTPIP there is no success so far (after reading lots of blog
> posts,mailing list posts and so on).
>
> I connected the camera successfully using the original canon software
> and captured the initial Handshake using Wireshark/libpcap on a Windows
> 10 machine.
>
> When filtering the captured packets for ptpip, the first lines i got were:
> Init Command Request GUID: 0000000000000000ffff821934822fef Name: AEBOOK
> Init Command Ack Connection #:23213 GUID:
> 372671113c97074fb908945be4dfa273 Name: Canon PowerShot G9 X
>
> So i put the line
> ptp2_ip=guid=00:00:00:00:00:00:00:00:ff:ff:82:19:34:82:2f:ef
> in ~/.gphoto2/settings.
>
> Being still not successful i used
> env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt --port
> ptpip:192.168.10.211 --camera "PTP/IP Camera" -L
> to get a logfile. Here is the relevant (imho) part:
>
> 0.099013 ptp_ptpip_init_command_request(3): ptpip/init_cmd data:
> (hexdump of 42 bytes)
> 0000  2a 00 00 00 01 00 00 00-00 00 00 00 00 00 00 00  *...............
> 0010  ff ff 82 19 34 82 2f ef-41 00 45 00 42 00 4f 00  ....4./.A.E.B.O.
> 0020  4f 00 4b 00 00 00 00 00-01 00                    O.K.......
>
> 0.099136 ptp_ptpip_init_command_request [ptpip.c:473](0): return 42 / len 42
> 0.101962 ptp_ptpip_generic_read      (3): ptpip/generic_read header:
> (hexdump of 8 bytes)
> 0000  0c 00 00 00 05 00 00 00-                         ........
>
> 0.101994 ptp_ptpip_generic_read      (3): ptpip/generic_read data:
> (hexdump of 4 bytes)
> 0000  01 00 00 00            -                         ....
>
> 0.102004 ptp_ptpip_init_command_ack [ptpip.c:498](0): bad type returned 5
> 0.102056 camera_init [library.c:7678](0): Failed to connect.
> 0.102065 gp_port_close               (2): Closing port...
> 0.102423 gp_context_error            (0): An error occurred in the
> io-library ('Unspecified error'): No error description available
> 0.103179 gp_camera_free              (2): Freeing camera...
> 0.103199 gp_port_free                (2): Freeing port...
> 0.103206 gp_port_close               (2): Closing port...
> 0.103251 gp_filesystem_reset         (2): resetting filesystem
> 0.103259 gp_filesystem_lru_clear     (2): Clearing fscache LRU list...
> 0.103265 gp_filesystem_lru_clear     (2): fscache LRU list already empty
> 0.103271 delete_all_folders          (2): Internally deleting all
> folders from '/'...
> 0.103277 lookup_folder               (2): Lookup folder '/'...
> 0.103284 lookup_folder               (2): Found! / is 0x5556a2498420
> 0.103290 recurse_delete_folder       (2): Recurse delete folder
> 0x5556a2498420//
>
> The error "bad type returned 5" is still the same as in my first tests
> without any capturing/messing with GUIDs, etc.
> As im not really understanding whats going on here i even tried to use
> both GUIDs from the Capture - in desperation i even patched libgphoto2
> to hardcode the hostname to AEBOOK (which is the name of the Windows
> machine i used for testing) just in case :-).
>
> Still no luck.
>
> Has anybody succesfully connected a G9X (or another newer Canon Camera)
> using PTPIP and libgphoto2 or are some of the above steps terribly wrong?

type 5 is INIT_FAILED, so something was amiss. It would be the GUID usually
and it is weird that its the same as windows uses :( That really should work.

What is the full packet content in hex from windows?

The hostname should not really matter though.

Ciao, Marcus

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gphoto-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gphoto-user
Reply | Threaded
Open this post in threaded view
|

Re: Problems connecting to Canon Powershot G9X using PTPIP

Michael Schaffner
Am 21.05.2017 um 21:33 schrieb Marcus Meissner:

>> 0.099013 ptp_ptpip_init_command_request(3): ptpip/init_cmd data:
>> (hexdump of 42 bytes)
>> 0000  2a 00 00 00 01 00 00 00-00 00 00 00 00 00 00 00  *...............
>> 0010  ff ff 82 19 34 82 2f ef-41 00 45 00 42 00 4f 00  ....4./.A.E.B.O.
>> 0020  4f 00 4b 00 00 00 00 00-01 00                    O.K.......

> What is the full packet content in hex from windows?

Command Request:
0000   2a 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00  *...............
0010   ff ff 82 19 34 82 2f ef 41 00 45 00 42 00 4f 00  ....4./.A.E.B.O.
0020   4f 00 4b 00 00 00 00 00 01 00                    O.K.......

Command Ack:
0000   4a 00 00 00 02 00 00 00 ad 5a 00 00 37 26 71 11  J........Z..7&q.
0010   3c 97 07 4f b9 08 94 5b e4 df a2 73 43 00 61 00  <..O...[...sC.a.
0020   6e 00 6f 00 6e 00 20 00 50 00 6f 00 77 00 65 00  n.o.n. .P.o.w.e.
0030   72 00 53 00 68 00 6f 00 74 00 20 00 47 00 39 00  r.S.h.o.t. .G.9.
0040   20 00 58 00 00 00 00 00 01 00                     .X.......

As you can see, its the exact same byte-sequence.

I don't get it, maybe the ip-address is checked, too?

Bye..
Michael


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gphoto-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gphoto-user