A $19.90 Seeed XIAO ESP32-S3 board was used to build a Sony remote with programmable intervals, timed long exposures, and clap-activated shutter. Sony’s RMT-P1BT accessory costs $80, according to XDA, and does not automate its controls.
The original project uses ESP-IDF, LVGL, and BLE GATT, but the published description does not include the firmware or Sony command bytes. So this guide turns four of its design decisions into executable Python prototypes: they can be used to test the logic, but not to pair directly with a camera or replace the ESP32 firmware.
What the remote automates
The project’s ESP32 communicates with the camera via Bluetooth Low Energy. One GATT characteristic receives button commands, and another sends focus, shutter, and recording notifications. This response makes it possible to wait for the camera to confirm focus before taking a picture, rather than relying solely on fixed delays.
The board adds timer, interval, bulb, burst, and video modes. The author also implemented two claps for a photo and three to start or stop video. The practical limitation of this guide is clear: it does not reproduce the BLE protocol, as the specific commands are not included here.
1. Schedule intervals without accumulating drift
The interval is calculated against a schedule rather than by adding the duration of each shot to the next wait time. If a capture is delayed so much that the next scheduled time has already passed, the scheduler shifts the schedule; it does not try to make up lost time by firing several times in quick succession.
from time import monotonic, sleep
def interval_schedule(interval, count):
"""Generates timestamps using a monotonic clock."""
if interval <= 0 or count <= 0:
raise ValueError("interval and count must be positive")
next_shot = monotonic()
for _ in range(count):
now = monotonic()
if now < next_shot:
sleep(next_shot - now)
yield monotonic()
next_shot += interval
now = monotonic()
if next_shot < now:
next_shot = now + interval
if __name__ == "__main__":
for number, timestamp in enumerate(interval_schedule(2.0, 3), 1):
print(f"Capture {number}: {timestamp:.2f}")
The example generates three timestamps two seconds apart. In firmware, the point where the generator produces each timestamp would be where a capture is requested through the BLE layer; it does not send any command to the camera.
2. Wait for focus confirmation
XDA describes a sequence of half-press, waiting for focus confirmation, and full-press. The remote sets a 1.5-second limit so that a failed focus operation does not leave it waiting indefinitely. This small state machine models that policy using simulated events.
from time import monotonic
class Shutter:
def __init__(self, timeout=1.5):
self.timeout = timeout
self.state = "idle"
self.deadline = 0.0
def start(self, now=None):
now = monotonic() if now is None else now
self.state = "waiting_focus"
self.deadline = now + self.timeout
return "half_press"
def event(self, name, now=None):
now = monotonic() if now is None else now
if self.state == "waiting_focus":
if name == "focus_acquired":
self.state = "waiting_shutter"
return "full_press"
if now >= self.deadline:
self.state = "idle"
return "focus_timeout"
elif self.state == "waiting_shutter" and name == "shutter_fired":
self.state = "idle"
return "release_full_then_half"
return "wait"
if __name__ == "__main__":
shutter = Shutter()
print(shutter.start(now=10.0))
print(shutter.event("focus_acquired", now=10.4))
print(shutter.event("shutter_fired", now=10.7))
The final response represents the release order described by XDA: first release the full press, then the half-press. In a real implementation, events would come from the camera’s notifications, not manual calls to event().
3. Time the end of a video recording
The author adds automatic recording with a set duration: the remote starts the video, waits, and sends the stop command. XDA notes that the a7 V can delay the start, but cannot schedule a specific end time from the camera. This program tests the timing sequence without sending camera commands.
from time import monotonic, sleep
def timed_recording(duration, start_recording, stop_recording):
if duration <= 0:
raise ValueError("duration must be positive")
start_recording()
deadline = monotonic() + duration
try:
while True:
remaining = deadline - monotonic()
if remaining <= 0:
break
sleep(min(remaining, 0.1))
finally:
stop_recording()
def demo_start():
print("Start recording")
def demo_stop():
print("Stop recording")
if __name__ == "__main__":
timed_recording(1.0, demo_start, demo_stop)
The demo functions only print messages. When adapting this pattern for firmware, they must be replaced with the sending and release of the corresponding BLE commands; the bytes for those commands are not specified here.
4. Detect a sequence of claps
The remote processes audio in 10-millisecond windows, filters low-frequency noise, and groups threshold crossings separated by less than 650 milliseconds. It also requires the level to fall 6 dB below the threshold before accepting another hit. The detector recognizes loud sounds, not claps specifically: laughter could trigger it.
The following block implements grouping from decibel levels that have already been calculated. It does not read the PDM microphone or perform the project’s audio filtering.
class ClapSequence:
def __init__(self, threshold_db, window_seconds=0.650, hysteresis_db=6.0):
self.threshold = threshold_db
self.window = window_seconds
self.hysteresis = hysteresis_db
self.armed = True
self.last_clap = None
self.count = 0
def sample(self, level_db, timestamp):
if level_db <= self.threshold - self.hysteresis:
self.armed = True
detected = self.armed and level_db >= self.threshold
if detected:
self.armed = False
if self.last_clap is None or timestamp - self.last_clap > self.window:
self.count = 0
self.count += 1
self.last_clap = timestamp
return self.count
return None
def finish(self, timestamp):
if self.last_clap is None or timestamp - self.last_clap <= self.window:
return None
result = self.count
self.count = 0
self.last_clap = None
if result == 2:
return "photo"
if result == 3:
return "toggle_video"
return "ignored"
if __name__ == "__main__":
detector = ClapSequence(threshold_db=60.0)
for t in (0.0, 0.2):
detector.sample(62.0, t)
detector.sample(53.0, t + 0.05)
print(detector.finish(1.0))
The 60 dB threshold is an illustrative value for the demonstration, not a recommended calibration for the board. The original project lets users adjust the threshold while observing the on-screen sound meter.
Mistakes to avoid
A timer is not the same as knowing the camera’s state: its BLE notifications are needed to confirm focus, shutter release, or recording. The shutter release order also matters; XDA says the full press must be released before the half-press.
The clap logic can be triggered by other loud sounds, and the author had to reduce the microphone’s PDM clock drive strength to avoid interference with the display. Turning these prototypes into a physical remote also requires a BLE controller, a display controller, and commands compatible with the camera.
XDA’s firmware was tested only with an a7 V; the author says they expect it to work with other models, but does not guarantee that all functions will behave the same way. The board also does not include a battery or enclosure: those need to be added to make it portable.
Useful logic, not firmware ready to pair
These examples isolate four ideas that distinguish the project: drift-free scheduling, focus confirmation, automatic video stopping, and acoustic sequence recognition. The actual connection depends on implementing ESP-IDF, BLE GATT, and the Sony commands the remote needs to send.
The original project is published on GitHub under the MIT license, according to XDA. The camera does not allow this remote and the RMT-P1BT to be used at the same time; in addition, keeping the Bluetooth connection active consumes battery power in both the remote and the camera.