A Linux-only helper built on Sony’s official Camera Remote SDK.
It connects to a Sony A6700 camera over Wi-Fi/Ethernet, listens for new photos, downloads them automatically, and can optionally run a script on each downloaded file.
- Auto-connect via enumeration or direct IP/MAC.
- Watches for new capture events and fetches the newest files.
- Saves into a chosen directory with unique filenames.
- Post-download hook: run any executable/script with the saved file path as argument.
- Keepalive mode: auto-retry on startup failure or after disconnects.
- Cleaned, Linux-only code (no Windows ifdefs, simpler logging).
./sony-remote --dir /photos [options]
--dir
: Directory to save files (required in most real setups).--ip
: Connect directly by IPv4 (e.g.192.168.10.184
).--mac
: Optional MAC (e.g.10:32:2c:2a:1a:6d
) for direct IP.--cmd
: Executable/script to run after each download, invoked as
cmd /photos/DSC01234.JPG
--keepalive
: Retry interval when offline or after disconnect.-v
,--verbose
: Verbose property-change logging.
Enumerate + keep retrying every 2s, run a hook after each file:
./sony-remote --dir /photos --keepalive 2000 --cmd /usr/local/bin/ingest-photo
Direct IP connect, verbose logs, retry every 3s:
./sony-remote --ip 192.168.10.184 --mac 10:32:2c:2a:1a:6d --dir /photos -v --keepalive 3000
Requires Linux, g++, and the Sony Camera Remote SDK.
See INSTALL.md
or (untested)
g++ -std=c++17 sony-a6700-remote-cleaned.cpp \
-I/path/to/CrSDK/include \
-L/path/to/CrSDK/lib -lCameraRemoteSDK \
-lpthread -o sony-remote
How It Works (short version)
- Connect to the camera (via IP or enumeration).
Stores/reuses SDK fingerprint under~/.cache/sonyshell/
. - Wait for notifications: when the camera signals new contents,
spawn a download thread. - Download newest files to
--dir
.
Safe naming ensures no overwrite (file_1.jpg
, etc.). - Hook: if
--cmd
is set, fork/exec the script with the saved path. - Reconnect on errors/disconnects if
--keepalive
is set.
- Core behavior is driven by
QuietCallback
(anIDeviceCallback
impl). - Download workers use threads + condition variables to sync progress.
- Logging is plain
std::cout
/std::cerr
withstd::endl
flushing. - Minimal globals, coordinated by atomics for stop/reconnect flags.
- See DOCS.md for a deep dive into the internals.
- Built on/for Ubuntu 24.04
- It uses Sony’s official Camera Remote SDK (not included here).
- I leaned heavily on ChatGPT while creating this, so please don’t mind the mess! 😉