Maaajaaa / CanonConnext

Prototype of a FOSS Canon Connect App for Connecting to Canon Cameras via WiFi
GNU General Public License v3.0
5 stars 0 forks source link

It recognises my camera but cannot talk to it #1

Open Pythone opened 1 year ago

Pythone commented 1 year ago

Camera: Canon EOS Rebel T7 OS:Pop!_OS 20.04 Here is what it keeps showing me:

('192.168.1.2', 53356) b'HTTP/1.1 200 OK\r\nCache-Control: max-age=1800\r\nEXT: \r\nLocation: http://192.168.1.2:49152/upnp/CameraDevDesc.xml\r\nServer: Camera OS/1.0 UPnP/1.0 Canon Device Discovery/1.0\r\nST: urn:schemas-canon-com:service:ICPO-SmartPhoneEOSSystemService:1\r\nUSN: uuid:00000000-0000-0000-0001-6C3C7C1CAC9C::urn:schemas-canon-com:service:ICPO-SmartPhoneEOSSystemService:1\r\n\r\n'

Maaajaaa commented 1 year ago

Hi, I think the CameraDesc.xml would be helpful (just open the link under Location: in the browser and remove private details before uploading it such as MAC). I have only ever tested this on my G7X, and it's been a while since I actively worked on it, but I'm willing to give it a look.

Pythone commented 1 year ago

Ok. I will do that later.

Pythone commented 1 year ago

found it

Pythone commented 1 year ago
<?xml version="1.0"?>
<root xmlns="urn:schemas-upnp-org:device-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<URLBase>http://192.168.1.2:49152/upnp/</URLBase>
<device>
<deviceType>urn:schemas-upnp-org:device:Basic:1</deviceType>
<friendlyName>Canon EOS Rebel T7</friendlyName>
<manufacturer>Canon</manufacturer>
<manufacturerURL>http://www.canon.com/</manufacturerURL>
<modelDescription>Canon Digital Camera</modelDescription>
<modelName>Canon EOS Rebel T7</modelName>
<serialNumber>{serial number goes here}</serialNumber>
<UDN>uuid:{UDN UUID goes here}</UDN>
<serviceList>
<service>
<serviceType>urn:schemas-canon-com:service:ICPO-SmartPhoneEOSSystemService:1</serviceType>
<serviceId>urn:schemas-canon-com:serviceId:ICPO-SmartPhoneEOSSystemService-1</serviceId>
<SCPDURL>CameraSvcDesc.xml</SCPDURL>
<controlURL>control/CanonCamera/</controlURL>
<eventSubURL></eventSubURL>
<ns:X_targetId xmlns:ns="urn:schemas-canon-com:schema-upnp">uuid:{Target ID UUID goes here}</ns:X_targetId>
<ns:X_onService xmlns:ns="urn:schemas-canon-com:schema-upnp">0</ns:X_onService>
<ns:X_deviceUsbId xmlns:ns="urn:schemas-canon-com:schema-upnp">32e1</ns:X_deviceUsbId>
<ns:X_deviceNickname xmlns:ns="urn:schemas-canon-com:schema-upnp">EOST7</ns:X_deviceNickname>
</service>
</serviceList>
<presentationURL>/</presentationURL>
</device>
</root>

I do not consider the local IP address private. It is only useful when someone is connecting to my camera.

Maaajaaa commented 1 year ago

Alright so the EOS cameras seem to use a different protocol than the PowerShot models. I am not sure how different it is. The Canon Service is basically an in-house XML/HTTP-based protocol. If the EOS protocol is very similar to that adaption could be relatively easy. I made a hotspot with my laptop, connected the phone and camera to it and could easily sniff all the communication between app and camera using wireshark.

jamesarthur commented 1 year ago

I have an EOS M10 and encountered a similar problem when trying this and ptpip.py a couple of months ago. gphoto2 can connect to my camera fine, it looks like it uses the same protocol to connect to all canons over ptpip but there seem to be a couple of fudges that I can’t work out without diving deeper into the code.

I’m still looking for a python implementation since gphoto2 requires Linux, and I need to use windows, so I might be able to provide another datapoint.