Any Camera Connect reverse engineering? - page 3 - General Discussion and Assistance - CHDK Forum

Any Camera Connect reverse engineering?

  • 28 Replies
  • 5515 Views
*

Offline RaduP

  • *****
  • 926
Re: Any Camera Connect reverse engineering?
« Reply #20 on: 25 / December / 2023, 21:38:37 »
Advertisements
Ok, that sucks.
What I would try if I were you is see if gphoto2 can trigger the usb capture somehow. On their supported devices page SX710 is missing, but so is SX730. So maybe give it a try with the command line client. G7x is supported though, so see if it works there, then read the source or use wireshark? Also maybe try other values instead of 8?


I am having some trouble with a different (non Canon) camera where I can't set a prop by PTP/IP on my code, but ghpto2 does it well. I am trying to capture the USB traffic with wireshark, but I guess I must look at some tutorials, because I don't understand how it works, and the traffic it captures is very hard to process.






*

Offline reyalp

  • ******
  • 14126
Re: Any Camera Connect reverse engineering?
« Reply #21 on: 25 / December / 2023, 22:47:25 »
Ok, that sucks.
What I would try if I were you is see if gphoto2 can trigger the usb capture somehow.
gphoto2 --capture fails with G7 X on USB, (gphoto 2.5.28, libgphoto2 2.5.30 from raspberry pi bookworm).
Code: [Select]
*** Error ***
Canon EOS M Full-Press failed (0x2019: PTP Device Busy)
ERROR: Could not capture image.
ERROR: Could not capture.
*** Error (-110: 'I/O in progress') ***

It does extend the lens, but immediately switches back to playback mode . From the debug log, appears to be attempting to use some combination of CHDK PTP and Canon PTP operations to shoot. The failure to switch to rec appears to be behavior I've seen before where relatively modern cameras sent to black screen PTP mode by GetObjectHandles (which gphoto appears to call by default) fail to switch.

Without CHDK, it doesn't extend the lens and fails with the same errors.
Don't forget what the H stands for.

Re: Any Camera Connect reverse engineering?
« Reply #22 on: 26 / December / 2023, 05:05:17 »
I'm not sure my opinion is really interesting as this is, by far, beyond my competency scope. However I've tried multiple connections after having successfully loaded the .cpp program in arduino to ESP32.connections to esp32 network are not systematic and most of the time, the network is not visible. when  connected the webpage opens, but I never succeeded having a shoot with G7x, G9xii nor M200, (this last one being also CCAPI compliant).I would be happy to perform any tests if needed, alghough I do not always understand what I'm doing. After years using CHDK/SDM while camera had video out features, i'm currently using a esp32+webpage with ccapi camera.I would be really happy to get a liveview feed and shooting option for cameras like G9x2.

*

Offline RaduP

  • *****
  • 926
Re: Any Camera Connect reverse engineering?
« Reply #23 on: 26 / December / 2023, 05:58:51 »
I'm not sure my opinion is really interesting as this is, by far, beyond my competency scope. However I've tried multiple connections after having successfully loaded the .cpp program in arduino to ESP32.connections to esp32 network are not systematic and most of the time, the network is not visible. when  connected the webpage opens, but I never succeeded having a shoot with G7x, G9xii nor M200, (this last one being also CCAPI compliant).I would be happy to perform any tests if needed, alghough I do not always understand what I'm doing. After years using CHDK/SDM while camera had video out features, i'm currently using a esp32+webpage with ccapi camera.I would be really happy to get a liveview feed and shooting option for cameras like G9x2.


Ok, so try to do things in this order:
After you uploaded the code to the ESP32, go with your phone/laptop to the newly created hotspot, then Config SSID, and put your wifi network info there, so that it logs in to your wifi network. Then restart the ESP32 if needed.
Connect from your PC to the esp32 (via your network, not via hotspot)


Make sure the camera is connected to your router, and in the same network as your PC (not as hotspot). Then get the IP of the camera (check the router clients page) and then go to Config Camera on the esp32 webpage. Put there the camera IP, and click Set. Make sure the camera is in the Connecting to phone mode, then click the Canon PTP Shoot.


If it still doesn't work, please look at the log of the ESP32, see what it outputs by serial. Are you using Arduino or Platformio?

*

Offline RaduP

  • *****
  • 926
Re: Any Camera Connect reverse engineering?
« Reply #24 on: 26 / December / 2023, 06:17:54 »
gphoto2 --capture fails with G7 X on USB, (gphoto 2.5.28, libgphoto2 2.5.30 from raspberry pi bookworm).


Yes, unfortunately it seems that this camera is not behaving well: https://github.com/gphoto/libgphoto2/issues/513

Re: Any Camera Connect reverse engineering?
« Reply #25 on: 27 / December / 2023, 02:48:37 »
Quote
Are you using Arduino or Platformio?
Arduino.Thanks for detailed explanations. I had not realised before that the connection could not use direct hotspot ssid. this has helped to  get more resuts in proper connection: much more infos in serial, but unfortunately the M200 did not shoot. Also tried the G9x2 but this one has always been tricky with wifi and is always deconnecting very quickly. so no need to spend time with it.for my use in kite aerial photography, i cannot rely on a router ssid, so I will later on this winter try to see in your sw if I can test something with my config. Maybe also try to read the other infos you provide. last but not least, I will also try to connect the G7x3 to see the results but unfortunately I don"t  have it with me currently. Thanks again for sharing this !

*

Offline RaduP

  • *****
  • 926
Re: Any Camera Connect reverse engineering?
« Reply #26 on: 27 / December / 2023, 10:31:41 »
The code can be easily adapted to connect to the camera by logging to it's AP.
So what happened with the M200? Can you post the serial log please? Also maybe from the G9x2?

Re: Any Camera Connect reverse engineering?
« Reply #27 on: 27 / December / 2023, 11:39:14 »
did it again for g9x2 o get log, joined.
Surprisingly stayed connected a bit longer.
I've added also new test for M200. I hope this helps
« Last Edit: 27 / December / 2023, 11:57:54 by Michel2e »

*

Offline RaduP

  • *****
  • 926
Re: Any Camera Connect reverse engineering?
« Reply #28 on: 27 / December / 2023, 12:23:44 »
Ok, that's strange. I think it would be best if we can talk by chatting rather than forum messages. Do you have FB? If so, please add me: https://www.facebook.com/radu.privantu

 

Related Topics


SimplePortal © 2008-2014, SimplePortal