goudvuur/sonyshell: An effort to “ssh into your Sony DSLR”

Date:

Share:

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)

  1. Connect to the camera (via IP or enumeration).
    Stores/reuses SDK fingerprint under ~/.cache/sonyshell/.
  2. Wait for notifications: when the camera signals new contents,
    spawn a download thread.
  3. Download newest files to --dir.
    Safe naming ensures no overwrite (file_1.jpg, etc.).
  4. Hook: if --cmd is set, fork/exec the script with the saved path.
  5. Reconnect on errors/disconnects if --keepalive is set.

  • Core behavior is driven by QuietCallback (an IDeviceCallback impl).
  • Download workers use threads + condition variables to sync progress.
  • Logging is plain std::cout/std::cerr with std::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! 😉

Source link

Subscribe to our magazine

━ more like this

What NASA Is Looking For In Yellowstone National Park

This is a transcript of an episode of Untold Earth, a series from Atlas Obscura in partnership with Nature and PBS Digital Studios, which...

Adira’s Story – PostSecret

Dear Frank,  I write to you with incredible news. Last month, I brought home my new service...

Is it weird facelifts are becoming normalized, or am I being too judgmental? | Well actually

Dear Ugly,I’m 36 and I don’t need or want a facelift – but lately I feel like I’m being made to want a facelift....

15 Winter Hair Color Trends Predicted By Experts 2025

In his recent cold-weather trend report, hair artist Tom Smith predicted that muted mid — essentially “soft, neutral-warm shades that sit between blonde, brunette,...

Oura Is Suing These Smart Ring Makers

We may earn a commission from links on this page. ...