PyKS2: the open source Pentax K-S2 WiFi API

The Pentax K-S2 has an undocumented WiFi remote-control API like many of it’s K-family relatives. This project maps almost the entire surface against a physical camera and ships a clean Python client and CLI built on the findings.

  • Protocol dissection is the endpoints and quirks I mapped, with captured evidence.
  • Methodology is how it was probed, including the false trails and the PENTAX Image Sync app traffic capture that cracked the gallery grid view.

The raw captured responses are in examples/, and the machine-readable spec is examples/API_REFERENCE.json.

Highlights

  • 40 endpoints, cleanly structured as read-groups × subsystems + actions + a WebSocket event stream.
  • Two protocol laws (errCode-in-body; inconsistent datetime formats).
  • Every hardware interlock explained (AF/MF lever, movie mode disabling WiFi, SD-door killing the connection, AP client isolation).
  • A capture of how the official Image Sync app works — and why this client’s event-driven design beats it.

This site uses Just the Docs, a documentation theme for Jekyll.