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

After receiving several contractor quotes over $50k for a basement remodel, homeowner empowers himself to tackle his first DIY for $8k: ‘I’ve gained a...

DIY endeavors are not for the weak-hearted. Often costing more than paying a professional, after buying all of the tools, DIY guidebooks, and specialty...

Inside Pierpaolo Piccioli’s S/S 26 Balenciaga Collection

Pierpaolo Piccioli’s debut at Balenciaga was one of the most anticipated shows of fashion month. His spring 2026 designs celebrate the fashion house, touching...

What Red Lipstick Does Taylor Swift Wear?

While each product featured is independently selected by our editors, we may include paid promotion. If you buy something through our links, we may...

Analog(ue) #199: A Little Bit of Personal News

#199: A Little Bit of Personal News March 5th, 2022 · 77 minutes This episode of Analog(ue) is sponsored by: Squarespace: Make your next move. Enter offer code ANALOGUE at checkout...

Tom Hanks on Living in New York, Meeting Joe DiMaggio & His New Play This World of Tomorrow | Jimmy Kimmel Live

Tom talks about the FAO Schwarz scene in BIG, Jimmy showing the movie to his kids, being...