Sony cameras can transfer photos to PC using a WIFI connection. To implement support on a host they provided software called “Playmemories”. This software was never working very well and eventually was completely abandoned by Sony. After upgrading to macOS Catalina I found that it is not working anymore, without any vendor updates available. So I started to look for alternatives.
How it works
Internally Sony using PTP/IP protocol to transfer files. The device starts sending the UDP packet to the 126.96.36.199:1900 broadcast address when the user choosing the ‘Send to Computer’ option from the camera menu. Software (Playmemories) captures this packet, connects to the camera, and start the sync process.
After the initial network configuration camera needs to be connected to the station using USB to set PTP/IP GUID. This is a one-time operation which is also handled by Playmemories.
I have been able to find 2 working OSS implementations for that:
- falk0069/sony-pm-alt – using gphoto2 and python wrapper and provides C program to set initial guid on camera.
- shezi/airmtp – pure Python2 MTP implementation, includes some additional options. Does not provide any way to initialize the camera over USB.
I found that both tools are working fine.
The tool has an initial GUID setter, which using libusb-1.0 to configure GUID on camera. I have been able to compile it on macOS:
clang `pkg-config libusb-1.0 --libs --cflags` sony-guid-setter.c -o sony-guid-setter
However, found that it is useless, as macOS opens USB exclusively when you connecting the camera. To workaround that I compiled this tool in the VirtualBox Linux VM and passed the camera using USB pass-thru functionality. This was working well and I got the camera configured. In my case exact command was
sudo ./sony-guid-setter.o 054c:08af -g. This operation needs to be done only once per camera network setup.
To use wireless transfer I installed gphoto2 from brew (
brew install gphoto2) and changed
PHOTO_DIR in the
sony-pm-alt.py to the user folder. I found that this application is working fine and able to transfer photos from the camera.
AirMTP is a pure python2 application, so it does not have any external dependencies. Also, it supports many additional sync options, e.g. ability to skip old files, specify extensions to download, etc.
To use it with the camera you need to run it with a command-line like
airmtp.py --ipaddress auto --outputdir and start the transfer on the camera.
I found that the performance of both tools is +- the same, so decided to use airmtp as it has no external dependencies and supports more options. To run it on startup I created such plist and places it in the
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>KeepAlive</key> <true/> <key>Label</key> <string>airmtp</string> <key>ProgramArguments</key> <array> <string>/usr/local/airmtp/airmtp.py</string> <string>--extlist</string> <string>JPG</string> <string>--ipaddress</string> <string>auto</string> <string>--outputdir</string> <string>/Users/user/pics</string> <string>--ifexists</string> <string>skip</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist>
To enable service do
launchctl load -w ~/Library/LaunchAgents/airmtp.plist. Additionally, I added python code which adds macOS notification on camera connect and file transfer. I will publish my changes later.
Thanks to OSS software – i can use camera sync functionality again and this time without vendor lock.