Code Monkey home page Code Monkey logo

canonbleintervalometer's Introduction

ESP32 intervalometer

The "src" contains the code for an ESP32-IDF based intervalometer.

Canon BLE protocol

Overview

There are 4 services in a Canon camera, which can be used to control it:

  • 00010000-0000-1000-0000-d8492fffa821: Used for pairing.
    • 00010005-0000-1000-0000-d8492fffa821: Unknown
    • 00010006-0000-1000-0000-d8492fffa821: Pairing commands.
    • 0001000a-0000-1000-0000-d8492fffa821: Pairing data.
    • 0001000b-0000-1000-0000-d8492fffa821: Unknown
  • 0002000-0000-1000-0000-d8492fffa821: Unknown. Seems to contain information about the camera.
  • 0003000-0000-1000-0000-d8492fffa821: Used for triggering the camera.
    • 00030010-0000-1000-0000-d8492fffa821: Seems to configure the trigger state notifications.
    • 00030030-0000-1000-0000-d8492fffa821: Trigger.
    • 00030031-0000-1000-0000-d8492fffa821: Trigger state notifications.
  • 0004000-0000-1000-0000-d8492fffa821: Unknown.

The camera only connects to paired devices so in order to communicate with the camera the pairing process needs to be done first. Also only BLE bonded devices can communicate.

Pairing commands:

  • 0x01: Confirm.
  • 0x02: Fail.
  • 0x03: Set UUID.
  • 0x04: Set nickname.
  • 0x05: Set type:
    • Types:
    • 0x01: iOS
    • 0x02: Android
    • 0x03: Remocon

Pairing commands start with the command byte then the data:

  • UUID: [ 0x03, 128bits of UUID ]
  • Nickname: [ 0x04, ASCII name ]
  • Type: [ 0x05, 0x03 ] (Android)

Pairing indication results:

  • 0x01: Request (does not seem to be used)
  • 0x02: OK
  • 0x03: "NG" (?)

Pairing process

The pairing process uses Service 1, the pairing process looks as follows:

  1. Connect to the camera and find all services and characteristics.
  2. Send the Set nickname command to the pairing command characteristic with security and bonding enabled, this should fail because the devices are not bonded.
  3. Wait for the bonding process to finish.
  4. Send the Set name command again without any security requirements.
  5. Enable indications for the pairing command characteristic.
  6. Wait for a callback, if the pairing is accepted continue, otherwise abort.
  7. Send the Set name command, Set platform command and the Confirm command to the pairing data characteristic.
  8. The devices are now paired.

Connection process

After a device is paired with a camera and wants to connect it needs to do the following:

  1. Connect to the camera and find all services and characteristics.
  2. Write any characteristic or characteristic descriptor with security, this should fail and initiate the bonding process.
  3. After the bonding is finished commands can be sent to the camera.

Triggering

  1. Write 0x0001 to the trigger characteristic. This triggers the camera.
  2. Write 0x0002 to the trigger characteristic. This finishes the trigger process and shows the result.

(Tested and works with Canon EOS M50)

canonbleintervalometer's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.