Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Sony RX100 M4 #21

Open
mar20kus opened this issue Jul 4, 2020 · 4 comments
Open

Problem with Sony RX100 M4 #21

mar20kus opened this issue Jul 4, 2020 · 4 comments

Comments

@mar20kus
Copy link

mar20kus commented Jul 4, 2020

Hello falk0069,

I've a problem getting the full connection to the camera.

Camera Side
If I do "Send to computer" the camera says

Connecting...
linux
SSID:foo.bar

looks good till now, but that's all.
After some minutes the camera says, that it can't get a connection to the computer.

Computer Side
NOTES:

  • I've changed the python script a little bit.
  • The code never comes to the lines
L.debug("Got XML - verify if our camera")
if "Sony Corporation" in r.content:

Debug output

2020-07-04 19:20:15,432 [INFO ] Server starting
2020-07-04 19:20:15,432 [INFO ] Setting download dir [PHOTO_DIR] to: /home/markus/Gphoto/Sony
2020-07-04 19:20:15,432 [INFO ] Setting LD_LIBRARY_PATH to: /usr/local/lib
2020-07-04 19:20:15,432 [DEBUG] BCAST_IP set to: 239.255.255.250
2020-07-04 19:20:15,432 [DEBUG] UPNP_PORT set to: 1900
2020-07-04 19:20:15,432 [DEBUG] GPHOTO_SETTINGS set to: /home/markus/.gphoto/settings
2020-07-04 19:20:15,432 [DEBUG] PTP_GUID set to: ff:ff:52:54:00:b6:fd:a9:ff:ff:52:3c:28:07:a9:3a
2020-07-04 19:20:15,432 [DEBUG] GPHOTO_ARGS set to: ['--debug', '--debug-logfile=gphoto2.debug', '-P', '--summary']
2020-07-04 19:20:40,492 [INFO ] received MtpNullService from ('169.254.209.3', 1900)
2020-07-04 19:20:40,493 [DEBUG]  data:
NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
NT: urn:microsoft-com:service:MtpNullService:1
NTS: ssdp:byebye
USN: uuid:00000000-0001-0010-8000-d44da4f6c16b::urn:microsoft-com:service:MtpNullService:1
MB: searchObj: None
2020-07-04 19:20:40,494 [DEBUG] ----------------------
2020-07-04 19:20:40,494 [DEBUG]   
2020-07-04 19:20:40,697 [INFO ] received MtpNullService from ('169.254.209.3', 1900)
2020-07-04 19:20:40,697 [DEBUG]  data:
NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
NT: urn:microsoft-com:service:MtpNullService:1
NTS: ssdp:byebye
USN: uuid:00000000-0001-0010-8000-d44da4f6c16b::urn:microsoft-com:service:MtpNullService:1
MB: searchObj: None
2020-07-04 19:20:40,697 [DEBUG] ----------------------
2020-07-04 19:20:40,698 [DEBUG]   
2020-07-04 19:20:40,701 [INFO ] received MtpNullService from ('169.254.209.3', 1900)
2020-07-04 19:20:40,701 [DEBUG]  data:
NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
CACHE-CONTROL: max-age=1800
LOCATION: http://169.254.209.3:1900/DeviceDescription.xml
NT: urn:microsoft-com:service:MtpNullService:1
NTS: ssdp:alive
SERVER: FedoraCore/2 UPnP/1.0 MINT-X/1.8.1
USN: uuid:00000000-0001-0010-8000-d44da4f6c16b::urn:microsoft-com:service:MtpNullService:1
MB: searchObj: <_sre.SRE_Match object at 0x7fef798eaeb8>
MB: searchObj.group(0): LOCATION: http://169.254.209.3:1900/DeviceDescription.xml
MB: searchObj.group(1): http://169.254.209.3:1900/DeviceDescription.xml
2020-07-04 19:20:40,701 [DEBUG] MB-Debug: Got '://'
2020-07-04 19:20:40,702 [DEBUG] Camera Found...starting gphoto
2020-07-04 19:20:40,702 [DEBUG] Current settings in /home/markus/.gphoto/settings
----------
gphoto2=port=ptpip:169.254.222.108
gphoto2=model=PTP/IP Camera
ptp2_ip=guid=ff:ff:52:54:00:b6:fd:a9:ff:ff:52:3c:28:07:a9:3a
----------
2020-07-04 19:20:40,702 [DEBUG] New settings file needed
2020-07-04 19:20:40,703 [INFO ] Creating backup: /home/markus/.gphoto/settings.20200704192040.bak
2020-07-04 19:20:40,703 [INFO ] New settings written to /home/markus/.gphoto/settings
2020-07-04 19:20:40,704 [DEBUG] 
----------
gphoto2=port=ptpip:169.254.209.3
gphoto2=model=PTP/IP Camera
ptp2_ip=guid=ff:ff:52:54:00:b6:fd:a9:ff:ff:52:3c:28:07:a9:3a
----------
2020-07-04 19:20:40,704 [DEBUG] Executing: ['gphoto2', '--port', 'ptpip:169.254.209.3', '--debug', '--debug-logfile=gphoto2.debug', '-P', '--summary']
2020-07-04 19:20:40,709 [DEBUG] ----------------------
2020-07-04 19:20:40,709 [DEBUG]   
2020-07-04 19:23:09,888 [INFO ] Waiting for connections to end before exiting

Even if I run photo2 with the IP-address found by sony-pm-alt.py gphoto2 can't continue.
For me it looks like the communication is only from the camera to the computer but not back.
Interesting - I don't know if it's important: I can configure a network settings with
IP-Address
Network Mask
Gateway
and I use 192.168.1.XXX
but the camera always uses a different 169.254.XXX.XXX address.

My gphoto2:

This version of gphoto2 is using the following software versions and options:
gphoto2         2.5.3          gcc, popt(m), exif, cdk, aa, jpeg, readline
libgphoto2      2.5.3.1        all camlibs, gcc, ltdl, EXIF
libgphoto2_port 0.10.0         gcc, ltdl, no USB, serial without locking

Any ideas?

Markus

@falk0069
Copy link
Owner

falk0069 commented Jul 8, 2020

That 169.254 address is an automatic private IP address. An IP in this range means that the camera cannot see the network. Do you disable DHCP on your wifi router? Your camera need to be able to find an DHCP server (typically running on your router) in order to get a 192.168.1.x IP address. That is the only way your camera and your computer will be able to communicate. You might also want to check if there is a way to set a static IP address (192.168.1.xxx) on your camera. This is the first I've heard of someone having the 169.254 issue on their camera.

@mar20kus
Copy link
Author

mar20kus commented Jul 9, 2020

Thank you for your reply. I double-checked again. "DHCP" is turned OFF on my WiFi-Router.
As I wrote above the Sony RX100 has a feature "AccessPoint Settings" - "IP-Address Setting" - "Manual"
There I define my 192.168.1.x IP-Address, 255.255.255.0 Netmask and the 192.168.1.x Gateway. But these settings are simply ignored. As I see in the DebugOutput of the script, the camera answers with an 169.254.x.y address.

The wifi-router is 192.168.1.1
The Gateway is 192.168.1.121

My "normal" routing table on the computer I want to use as target for the camera:

Kernel IP routing table
Destination     Gateway       Genmask         Flags Metric Ref Use Iface
0.0.0.0         192.168.1.121 0.0.0.0         UG    0      0     0 wlan0
192.168.1.0     0.0.0.0       255.255.255.0   U     9      0     0 wlan0

When I want to access the camera I add the 169.254.0.0 net so the routing table looks like:

Kernel IP routing table
Destination     Gateway       Genmask         Flags Metric Ref Use Iface
0.0.0.0         192.168.1.121 0.0.0.0         UG    0      0     0 wlan0
169.254.0.0     192.168.1.1   255.255.0.0     UG    0      0     0 wlan0
192.168.1.0     0.0.0.0       255.255.255.0   U     9      0     0 wlan0

Perhaps the routing table is not quite correct ...

Markus

@falk0069
Copy link
Owner

falk0069 commented Jul 9, 2020

If your camera doesn't have a 192.168 address, I don't think it will be able to communicate with your PC. My understanding is these IP ranges are in the private range and aren't routable. I'm sure there is a way but probably involves SNAT/NAT and/or iptable trickery.

Why are you against using DHCP on your network? You can still statically assign your IP addresses, but at least then your camera will get a valid IP on the same network. I really think you need to figure out a way to get your camera to have a 192.168.1.x address in order for things to work.

@mar20kus
Copy link
Author

Status:

The key-point was your statement [...]
Your camera need to be able to find an DHCP server (typically running on your router) in order to get a 192.168.1.x IP address
...

So I enabled DHCP on my WLAN-Router.

After this and ... some quirks ... I managed to send a file from the camera to a computer.
I usually don't use DHCP in my network and had problems with some of my raspberry-pis: they took DHCP-addresses.
Ok - I'm not very firm with DHCP (I told my WLAN router to accept only the MAC-Address of the Sony Camera - but it seems that this didn't work).

My experience:
Transfer from camera to computer worked:

gphoto2         2.5.11         gcc, popt(m), exif, cdk, aa, jpeg, readline
libgphoto2      2.5.12         all camlibs, gcc, ltdl, EXIF
libgphoto2_port 0.12.0         gcc, ltdl, USB, serial without locking

Transfer from camera to computer did not work:

gphoto2         2.5.3          gcc, popt(m), exif, cdk, aa, jpeg, readline
libgphoto2      2.5.3.1        all camlibs, gcc, ltdl, EXIF
libgphoto2_port 0.10.0         gcc, ltdl, no USB, serial without locking

Thanks for your support and your script.

Markus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants