Code Monkey home page Code Monkey logo

freemote's Introduction

Freemote - Sony Alpha BLE Remote implemented on the NRF52840

image

This is a BLE implementation for the NRF52840 that acts like a BLE (Bluetooth Low Energy) remote for the Sony Alpha series that support the BLE remotes similar to JJC-RMT-P1BT. I've tried this on a Sony A7 III but from my understanding it should work with ZV-1, RX100VII, ZV-E10, A7C, A6100, A6600, A1, A7RIV, A7SIII, A9II, 6400 and A7RIII as well.

Specifically this code runs on the Adafruit NRF52840 Express which costs about $25. The repo is a PlatformIO project meaning if you open this it should handle dependencies and the toolchain to program your NRF52840. Currently the code will try to pair with whatever camera is open for pairing (described further down) and save that pairing and then automatically reconnect to that camera when avaliable. There is prob better ways of solving this but yeah, took the easy route here.

Sony Alpha BLE Remote Protocol

When trying to discover the camera, you have to specifically scan for the "manufacturer data" as Sony uses this to indicate state etc for the camera. So for example an advertistment header might look like this: 0x2D, 0x01, 0x03, 0x00, 0x64, 0x00, 0x45, 0x31, 0x22, 0xEF, 0x00. Decoding this you get:

Code Meaning
2d 01 Sony Corporation Company Identifier (0x012D)
03 00 Camera
64 Protocol Version
00 ???
45 31 Model Code
22 EF 00 <tag> CODE </tag>

The interesting part here is 0x22 0xEF 0x00 which indicates that the camera is open to pairing. If the camera is not in pairing mode you will get 0x22 0xAF 0x00 instead.

Remote Control Service

We are specifically interested in consuming the 8000FF00-FF00-FFFF-FFFF-FFFFFFFFFFFF service which contains two characteristics.

Codes from remote (RemoteCommand 0xFF01)

This is what I initially thought and reflected in the variable names in the code:

Code Description
0x0106 Shutter released
0x0107 Transitioning to focus
0x0108 Focus held
0x0109 Shutter fully pressed

However, Greg Leeds did a better job reversing this. With additional testing script done by tao-j, the best guesstimate of the command code is summarized in the following table.

Code Description
0x0106 Shutter Half Up
0x0107 Shutter Half Down
0x0108 Shutter Fully Up
0x0109 Shutter Fully Down
0x010e Record Up
0x010f Record Down
0x0114 AF-On Up
0x0115 AF-On Down
0x0120 C1 Up
0x0121 C1 Down
0x0244[00~0f] Optical Zoom Tele?
0x0245[10~8f] Digital Zoom Tele?
0x0246[00~0f] Optical Zoom Wide?
0x0247[10~8f] Digital Zoom Wide?
0x026a[00~0f] ??
0x026b[00~7f] Focus In
0x026c[00~0f] ??
0x026d[00~7f] Focus Out

In summary, those codes discovered so far have a length of either 2 or 3 bytes of the format:

+-----------------+-----------------+----------------------+
|     Length      |     Command     | Step size (optional) |
+-----------------+-----------------+----------------------+

The first byte Length is always present, it denotes how many bytes proceeding it: 0x01 for 1 byte, and 0x02 for two bytes. The second byte Command is the actual command, it either simulates a button or indicates a property change like zoom or focus. The third byte Step size is optional, which is usually accompanied by a property change second byte to denote a step size. Known valid step sizes are listed in the bracket for each command, there could be more, only Sony engineering know that so far.

Sadly, an exhaustive scan for Command codes from 0x00 to 0xff revealed no extra hidden code.

For button codes, it's of best practice to issue them in pairs of Down and Up. The shutter button commands must go through the sequence of "Half down -> Fully down -> Half up -> Fully up", otherwise the camera will be stuck in an inoperable state.

Answers from camera (RemoteCommand 0xFF02)

Code Meaning
Focus
0x02 3F 00 Lost
0x02 3F 20 Acquired
Shutter
0x02 A0 00 Ready
0x02 A0 20 Shutter active
Recording
0x02 D5 00 Recording stopped
0x02 D5 20 Recording started

Acknowledgments & Thanks

freemote's People

Contributors

coral avatar tao-j avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

freemote's Issues

Not releasing in bulb mode

Hi, I've found, that «Half down -> Fully down -> Half up -> Fully up» works only when shutter speed is fixed. When I set shutter speed to BULB on ILCE-7C (for example, to control timings programmatically), something weird is happening:

  1. I send «Half down -> Fully down», shutter is pressed in camera
  2. I wait for some time while image is well exposed
  3. I send «Half up -> Fully up» supposing it should release the shutter

But the shutter isn't released, the camera doesn't respond at all to «Half up -> Fully up». I was able to release the shutter only with sending «Half down -> Fully down» second time (in manual focus mode one can only send just «Fully down» both times).

What's even stranger is that remote controls work the same way: if you press and hold the button in BULB mode, the shutter will not release after you release the button on RC, but it will release after you press it again. Tested on aodelan rmt-p1bta and JJC RMT-P1BT.

Focus distance information?

Do you know if it's possible to get the current focal distance, aperture, etc info from the camera? Given we can step the focus and zoom by sending commands, one would presume this information may be available. It does appear to be available in the Sony Wi-Fi protocol.

multiple remotes

Hi! thanks for the code! I havent tested this but I wonder if is possible to pair multiple controllers to the camera? I guess you did this a lot while testing (I want to port this to an esp32)

Can We check Pairing Status

Hey , nice work ,
After Sending Pair request to camera , is there any way to detect if users accepts that pairing request in camera , or canceled that
or in case if we want to check the pairing status with camera . ( i know we can check if camera if in Pairing mode , or enabled from manufacturer data )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.