BlueMagic32 | Blackmagic Bluetooth Arduino Library

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline
User avatar

Csaba Nagy

  • Posts: 276
  • Joined: Sat Jul 13, 2013 7:01 pm
  • Location: AB, Canada

BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostFri Nov 29, 2019 3:50 am

Since I’ve learned about the Bluetooth functionality of the Blackmagic Cameras earlier this year, I’ve sought to bring functional and interesting hardware/software implementations to these great cameras.

To help aid in the pursuit, I’ve been developing an easy-to-use Arduino library, to enable anyone to build their own Bluetooth controllers. From experienced programmers to newcomers, should be very flexible to use.

The library is still in development and will soon be available and I highly encourage people to extend/improve this library as they see fit when it becomes available. ( likely could use some under the hood improvements as It’s my first time developing C++ Library )

Here’s an early look at a really simple piece of demo code that can create a remote trigger with live timecode ( using a $15 development device ) and an example of an integration with a Samsung Gear VR Remote to control the camera. ( really cool possibilities with this as it has lots of buttons, a touchpad, gyroscope/accelerometer and is widely available and cost effective.)

Still working on adding an example or two, would love to hear what kind of examples you’d like to see included with the library and I’ll see If I can make those happen.

Last edited by Csaba Nagy on Wed Jan 22, 2020 1:14 am, edited 2 times in total.
Csaba Nagy
Filmmaker
BMPCC4K
Offline

Brendan Dower

Blackmagic Design

  • Posts: 33
  • Joined: Thu Oct 10, 2019 5:56 am
  • Real Name: Brendan Dower

Re: BlackMagic Bluetooth Arduino Library | Early look

PostSun Dec 01, 2019 11:30 pm

Excellent Job Csaba!
We always love to see examples of what developers create with our products!
Brendan Dower
Blackmagic Design Developer Support
Offline

Chris Maier

  • Posts: 37
  • Joined: Fri Sep 22, 2017 3:04 pm
  • Location: Germany

Re: BlackMagic Bluetooth Arduino Library | Early look

PostMon Dec 02, 2019 4:39 pm

Hi Csaba,

great job indeed!
I am wondering why everyone is adding additional hardware to their circuits (e.g. M5StickC, WifiKit 32 or anything based on the ESP32 chip) to control the BMPCC.
Samsung VR remote or Tilta Nucleous Nano in another case.

I managed (with a ton of help!) to successfully add a cheap potentiometer to the board to control the aperture via Bluetooth.
Unfortunately I was still to busy to write better code to "debounce" the reading of the potentiometer.
I will be a long cold winter...
(The original controlling code was not written by myself! I am not sure if the kind developer is part of this community.)

I am really looking forward to see your library!
It would bet great to change the aperture via a rotary encoder instead of a potentiometer.
This might be more reliable.

I have just received my M5StickC today...

Thank you,
Chris
BMPCC 6K | BMD eGPU | Davinci Resolve Studio
Offline

PauliJ

  • Posts: 1
  • Joined: Sun Dec 15, 2019 6:33 am
  • Real Name: Pauli Juppi

Re: BlackMagic Bluetooth Arduino Library | Early look

PostSun Dec 15, 2019 6:54 am

Hello Csaba!

I'm really excited about this! I tried to do a simple ble controller for pocket 4k a year ago but got stuck in the bonding problems with nFR52 Arduino board.
So I'd love to see examples for bonding and sending simple commands for REC/STOP and manual focus. That would be great!
If you need a beta tester, I'm happy to help :)
Thanks for the awesome work in advance!
Offline
User avatar

insorior

  • Posts: 8
  • Joined: Thu Sep 05, 2019 7:30 am
  • Location: Europe
  • Real Name: Vincent Monteil

Re: BlackMagic Bluetooth Arduino Library | Early look

PostThu Jan 09, 2020 12:53 pm

Csaba Nagy wrote:Since I’ve learned about the Bluetooth functionality of the Blackmagic Cameras earlier this year, I’ve sought to bring functional and interesting hardware/software implementations to these great cameras.

To help aid in the pursuit, I’ve been developing an easy-to-use Arduino library, to enable anyone to build their own Bluetooth controllers. From experienced programmers to newcomers, should be very flexible to use.

The library is still in development and will soon be available and I highly encourage people to extend/improve this library as they see fit when it becomes available. ( likely could use some under the hood improvements as It’s my first time developing C++ Library )

Here’s an early look at a really simple piece of demo code that can create a remote trigger with live timecode ( using a $15 development device ) and an example of an integration with a Samsung Gear VR Remote to control the camera. ( really cool possibilities with this as it has lots of buttons, a touchpad, gyroscope/accelerometer and is widely available and cost effective.)

Still working on adding an example or two, would love to hear what kind of examples you’d like to see included with the library and I’ll see If I can make those happen.

Offline
User avatar

Csaba Nagy

  • Posts: 276
  • Joined: Sat Jul 13, 2013 7:01 pm
  • Location: AB, Canada

Re: BlackMagic Bluetooth Arduino Library | Early look

PostWed Jan 22, 2020 1:10 am

Pleased to announce to release of the BlueMagic32 Library! BlueMagic32 is an Arduino Library for controlling Blackmagic Cameras over Bluetooth Low Energy using an ESP32 device.

Link to library: https://github.com/schoolpost/BlueMagic32

Create your own Bluetooth control hardware that can control parameters such as:
-Recording
-Focus
-Frame Rate
-ISO
-Shutter
-Whitebalance/Tint

Use the provided examples and create a basic remote trigger in under 10 minutes! Watch the video guide and see for yourself.



As with any version 1.0; bugs and other quirks to be expected also some features are not yet fully implemented so be patient as they will be added soon. Please track bugs/problems with the github issues tool.

Can’t wait to see what everyone makes! ;)
Csaba Nagy
Filmmaker
BMPCC4K
Offline
User avatar

Xtreemtec

  • Posts: 4486
  • Joined: Wed Jan 02, 2013 11:48 am
  • Location: The Netherlands

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostWed Jan 22, 2020 10:15 am

Great Work !! :D
Daniel Wittenaar .:: Xtreemtec Media Productions ::. -= www.xtreemtec.nl =-
4K OBV Trailer, ATEM TVS HD, 4M/E Broadcast Studio 4K, Constelation 8K, Hyperdeck Studio 12G, Ursa Broadcast 4K, 4K fiber converters with Sony Control
Offline

Chris Maier

  • Posts: 37
  • Joined: Fri Sep 22, 2017 3:04 pm
  • Location: Germany

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostWed Jan 22, 2020 2:57 pm

Thank you very much for sharing this with the community!
I will definitely try and compare this with my previous solution.

Chris
BMPCC 6K | BMD eGPU | Davinci Resolve Studio
Offline
User avatar

kalinska

  • Posts: 21
  • Joined: Sun Feb 03, 2019 8:49 pm
  • Location: France
  • Real Name: Pascal Deveaux

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostSat Jan 25, 2020 8:29 pm

Very good work. Correct operation with the examples provided and ease of implementation for a low cost.
Ryzen 7-3800 - 48 Go - Win10 Pro X64 1809 - x BMPCC 4k /ATEM - Resolve Studio 16.2.3 - Decklink / Intensity Pro 4K - Nvidia 1080ti 451.48
Offline
User avatar

narimangafurov

  • Posts: 17
  • Joined: Fri Apr 19, 2019 7:17 pm
  • Location: russia
  • Real Name: Nariman Gafurov

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostMon Feb 03, 2020 2:54 am

Thank you friend! great work...already ordered M5StickC ESP32 and can't wait to try...
macbookpro 16, imacpro, macos 10.15.3, bmpcc4k, davinci resolve, finalcutprox
Offline

Chris Maier

  • Posts: 37
  • Joined: Fri Sep 22, 2017 3:04 pm
  • Location: Germany

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostSun Feb 16, 2020 6:15 pm

Hi all,

just a quick hit, which would have saved me two hours...

If you follow all the instructions on OSX Catalina you will probably run into this error while uploading a Sketch to the M5StickC board.

A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header

I found the solution with a lot of searching the web (on a different computer, so I can not post the link).

The solution was fairly simple:
Just connect the port "G0" with ground "GND" using e.g. a paper clip.


BTW: Has anyone enhanced the capabilities of the sample code to controlling the aperture using rotary encoder?
This will be my next step.

Chris
BMPCC 6K | BMD eGPU | Davinci Resolve Studio
Offline
User avatar

narimangafurov

  • Posts: 17
  • Joined: Fri Apr 19, 2019 7:17 pm
  • Location: russia
  • Real Name: Nariman Gafurov

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostMon Mar 09, 2020 7:22 pm

Chris Maier wrote:Hi all,

just a quick hit, which would have saved me two hours...

If you follow all the instructions on OSX Catalina you will probably run into this error while uploading a Sketch to the M5StickC board.

A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header

I found the solution with a lot of searching the web (on a different computer, so I can not post the link).

The solution was fairly simple:
Just connect the port "G0" with ground "GND" using e.g. a paper clip.


BTW: Has anyone enhanced the capabilities of the sample code to controlling the aperture using rotary encoder?
This will be my next step.

Chris


Could you briefly describe the procedure for setting up the M5StickC? I get an error ((
Arduino: 1.8.12 (Mac OS X), Board: "ESP32 Pico Kit, Default, 921600, None"

Sketch uses 967843 bytes (73%) of program storage space. Maximum is 1310720 bytes.
Global variables use 36064 bytes (11%) of dynamic memory, leaving 291616 bytes for local variables. Maximum is 327680 bytes.
esptool.py v2.6
Serial port /dev/cu.usbserial-79525604B4
Connecting......
Chip is ESP32-PICO-D4 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, Embedded Flash, VRef calibration in efuse, Coding Scheme None
MAC: d8:a0:1d:54:fe:00
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...

A fatal error occurred: Timed out waiting for packet header
A fatal error occurred: Timed out waiting for packet header

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
macbookpro 16, imacpro, macos 10.15.3, bmpcc4k, davinci resolve, finalcutprox
Offline

Chris Maier

  • Posts: 37
  • Joined: Fri Sep 22, 2017 3:04 pm
  • Location: Germany

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostTue Mar 10, 2020 5:04 pm

Hi,

it seem that you are trying to flash the wrong board.
My Arduino IDE says "Board: M5Stick-C".

Try to follow the instructions step by step:
https://github.com/schoolpost/BlueMagic32

On OSX 10.14 it worked instantly (while the M5StickC was running).
For OSX 10.15 feel free to try my advice above.

I used this sketch:
https://github.com/schoolpost/BlueMagic ... a_Settings

Good luck - or send me a message.

Chris
BMPCC 6K | BMD eGPU | Davinci Resolve Studio
Offline
User avatar

narimangafurov

  • Posts: 17
  • Joined: Fri Apr 19, 2019 7:17 pm
  • Location: russia
  • Real Name: Nariman Gafurov

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostTue Mar 10, 2020 6:05 pm

Chris Maier wrote:Hi,

it seem that you are trying to flash the wrong board.
My Arduino IDE says "Board: M5Stick-C".

Try to follow the instructions step by step:
https://github.com/schoolpost/BlueMagic32

On OSX 10.14 it worked instantly (while the M5StickC was running).
For OSX 10.15 feel free to try my advice above.

I used this sketch:
https://github.com/schoolpost/BlueMagic ... a_Settings

Good luck - or send me a message.

Chris

everything worked out! thanks a lot!
Attachments
Без_названия (5).gif
Без_названия (5).gif (909.6 KiB) Viewed 1932 times
IMG_8422.jpg
IMG_8422.jpg (284.36 KiB) Viewed 1932 times
macbookpro 16, imacpro, macos 10.15.3, bmpcc4k, davinci resolve, finalcutprox
Offline
User avatar

Csaba Nagy

  • Posts: 276
  • Joined: Sat Jul 13, 2013 7:01 pm
  • Location: AB, Canada

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostSat Mar 21, 2020 2:34 am

Here's an example of a Long Range Remote Trigger you can build using this library:

Csaba Nagy
Filmmaker
BMPCC4K
Offline

Max Roesch

  • Posts: 15
  • Joined: Sat Jan 13, 2018 1:16 pm

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostWed May 27, 2020 6:30 am

Hello,

has anybody tried to connect it to BMPCC6K? I tried it without any succsess :(

Max
Offline

Chris Maier

  • Posts: 37
  • Joined: Fri Sep 22, 2017 3:04 pm
  • Location: Germany

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostWed May 27, 2020 3:42 pm

Max Roesch wrote:Hello,

has anybody tried to connect it to BMPCC6K? I tried it without any succsess :(

Max
Hi Max,

yes, I build a prototype remote aperture controller for a BMPCC 6K.

Meanwhile I am working on a Multicam Remote Aperture Controller using BLE, Wifi and LoRa to control cameras of multiple manufacturers like Blackmagic, Sony, Panasonic and ZCam.

M5_tiny_Remote.jpg
the tiny one
M5_tiny_Remote.jpg (355.26 KiB) Viewed 1026 times

M5_BMPCC_6K_Controller.jpg
controller with external dial
M5_BMPCC_6K_Controller.jpg (387.52 KiB) Viewed 1026 times

LoRa_Modules.jpg
latest Long Range version - successfully tested up to 1100m
LoRa_Modules.jpg (302.61 KiB) Viewed 1026 times


Good luck!
Chris
BMPCC 6K | BMD eGPU | Davinci Resolve Studio
Offline

Max Roesch

  • Posts: 15
  • Joined: Sat Jan 13, 2018 1:16 pm

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostWed May 27, 2020 5:58 pm

Hello Chris,

could you share your porject? Which IDE do you use ? Which SW Version is ob your CAM?

Greetings
Max
Offline

Chris Maier

  • Posts: 37
  • Joined: Fri Sep 22, 2017 3:04 pm
  • Location: Germany

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostWed May 27, 2020 6:14 pm

Hi Max,

I can try to guide you to a first connection with your camera.
The rest will be up to you ;-)

Chris Maier wrote:Try to follow the instructions step by step:
https://github.com/schoolpost/BlueMagic32

(...)

I used this sketch:
https://github.com/schoolpost/BlueMagic ... a_Settings

As I advised before: Try to follow all the steps exactly.

I am using the Arduino IDE 1.8.1 on OSX.

Give me some details:
- IDE
- Board
- Sketch
- Error Messages etc.

Good luck!
Chris
BMPCC 6K | BMD eGPU | Davinci Resolve Studio
Offline

Max Roesch

  • Posts: 15
  • Joined: Sat Jan 13, 2018 1:16 pm

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostThu May 28, 2020 7:55 am

Hi Chris,

of course, connection will be the only thing which I'm interested in.

First/initial Setup:

Visiual Studio Code with PlatformIO
ESP32 Dev Module
Example sketch from BlueMagic32 library
No errors

First episode:
Uploading sketch-->serial monitor is asking for pin-->camera is showing pin-->entering in serial monitor-->ESP does not connecting an repead the pairing process several times (~5)-->ESP stops asking for pin code and camera do not has no bluetooth connection at all. There were a short message on camera screen (bluetooth connection error).

Second episode:
trying same with new uploaded sketch ( platformIO and Arduino IDE )-->esp does not start to connect to camera ( no pin an camera shown/serial monitor is not asking for input pin )-->erasing complete esp flash over power shell command ...esptool_py\2.6.1>esptool --chip esp32 --port com3 erase_flash--> after uploading sketch, same procedure as descripted in "first episode".



Greetings
Max
Offline

Chris Maier

  • Posts: 37
  • Joined: Fri Sep 22, 2017 3:04 pm
  • Location: Germany

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostThu May 28, 2020 5:26 pm

Hi Max,

after watching your short video, I guess you made only a minor error.
Please change the setting of your Serial Monitor from "New Line" (Neue Zeile) to "NL + CR" (Sowohl NL als auch CR).

NL+CR.png
New Line plus Carriage Return
NL+CR.png (16.7 KiB) Viewed 949 times


Wit this fix the BLE pairing should work fine.
Without this small fix the code was never sent to the camera, that why you received the timeout message.

Good luck!
Chris
BMPCC 6K | BMD eGPU | Davinci Resolve Studio
Offline

Max Roesch

  • Posts: 15
  • Joined: Sat Jan 13, 2018 1:16 pm

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostThu May 28, 2020 6:01 pm

Hello Chris,

thanks for your replay. Have the same issue as before. If you like in to github repository. --> New Line is written for Serial Monitor. Deeper look into programm code shows:

ch = Serial.read();
if (ch >= '0' && ch <= '9')
{
pinCode = pinCode * 10 + (ch - '0');
Serial.print(ch);
}
} while ((ch != '\n'));


--> char will be read up to \n

Which camera SW version do you use? It is a little bit strange, because I can not connect with any bluetooth app to my camera.

Greetings

Max
Offline

Chris Maier

  • Posts: 37
  • Joined: Fri Sep 22, 2017 3:04 pm
  • Location: Germany

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostThu May 28, 2020 6:24 pm

Hello Max,

you may contact me via private message in German or English.

Chris
BMPCC 6K | BMD eGPU | Davinci Resolve Studio
Offline

IllimarR

  • Posts: 1
  • Joined: Sun Jun 21, 2020 12:18 pm
  • Real Name: Illimar Reinbusch

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostSun Jun 21, 2020 12:27 pm

Hi

Few days ago started to write my own Bt library and by surprise found yours - great work!
I did find some issues there, will report them later, also added some additional functionality.

Image

Image

Thanks again for the library and will try to commit my changes (no experience using GitHub) when verified.

IllimarR
Offline
User avatar

Csaba Nagy

  • Posts: 276
  • Joined: Sat Jul 13, 2013 7:01 pm
  • Location: AB, Canada

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostTue Jun 23, 2020 9:10 pm

IllimarR wrote:Hi

Few days ago started to write my own Bt library and by surprise found yours - great work!
I did find some issues there, will report them later, also added some additional functionality.

Image

Image

Thanks again for the library and will try to commit my changes (no experience using GitHub) when verified.

IllimarR


Great project! glad to see you were able to get it up and running on an M5Stack, Very efficient use of the limited screen real estate.

For submitting library modification you should do it via a Pull-request :) ( http://archaeogeek.github.io/foss4gukdo ... quest.html )
Csaba Nagy
Filmmaker
BMPCC4K

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 4 guests