BlueMagic32 | Blackmagic Bluetooth Arduino Library

The place for questions about shooting with Blackmagic Cameras.
  • Author
  • Message
Offline
User avatar

Csaba Nagy

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

BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostWed Jan 22, 2020 4:07 pm

Bit of a duplicate post, but for those who wouldn't usually find themselves in the software developer side of the forum thought I would be nice to share here as this is a project I think can be used by not only experienced developers but those who aren't too.

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

robedge

  • Posts: 2000
  • Joined: Tue Dec 24, 2019 1:24 am
  • Location: U.S.
  • Real Name: Rob Edge

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostWed Jan 22, 2020 5:17 pm

Interesting.

For anyone interested in this, the Github Library page is very helpful.
Image: Fujinon MK 18-55mm, Leica M primes, Pocket 4K

Sound: DPA & Schoeps mikes, Sound Devices recorder

Post Monitors: Eizo 27" UHD, Focal Solo6 Be
Offline

Jean-Claude

  • Posts: 19
  • Joined: Thu Jan 03, 2019 9:33 am
  • Location: France
  • Real Name: Jean-Claude Arzur

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostFri Jan 31, 2020 9:12 am

I just receive the M5stack-C and I will let you know when I get it implemented
System Mac Pro 5,1- macOS Mojave ver 10.14.1 - Ram 64 Gb
Davinci resolve Studio ver 16.0.0.044
Offline

Jean-Claude

  • Posts: 19
  • Joined: Thu Jan 03, 2019 9:33 am
  • Location: France
  • Real Name: Jean-Claude Arzur

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostFri Jan 31, 2020 10:25 am

I just get it to run, Great thanks for the library


Jean-Claude
System Mac Pro 5,1- macOS Mojave ver 10.14.1 - Ram 64 Gb
Davinci resolve Studio ver 16.0.0.044
Offline

tonybeccar

  • Posts: 10
  • Joined: Mon Feb 01, 2021 4:14 pm
  • Real Name: Juan Beccaglia

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostFri Mar 05, 2021 6:01 pm

Hello!

Thanks for creating BlueMagic32!!

I just bought an ESP32 board and followed your steps exactly in the video. Sketch uploaded succesfully. However I cannot connect, I get this error:

BLE Advertised Device found:
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x400d4fdf PS : 0x00060a30 A0 : 0x800d5155 A1 : 0x3ffcd0c0
A2 : 0x00000087 A3 : 0x00000000 A4 : 0x3ffdbe6d A5 : 0x0000ff00
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x8017b010 A9 : 0x3ffcd0a0
A10 : 0x3ffdbe80 A11 : 0x4008bdfc A12 : 0x00000011 A13 : 0x3f40015b
A14 : 0x00000002 A15 : 0x00000006 SAR : 0x00000018 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000087 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0x00000000

ELF file SHA256: 0000000000000000

Backtrace: 0x400d4fdf:0x3ffcd0c0 0x400d5152:0x3ffcd0e0 0x400d53a4:0x3ffcd100 0x400d6f4a:0x3ffcd160 0x400d5b31:0x3ffcd1a0 0x400d34f6:0x3ffcd280 0x400e2975:0x3ffcd2d0 0x400dc38e:0x3ffcd2f0 0x4008ff8a:0x3ffcd320

Rebooting...

Do you have any idea what could it be? Maybe BM updated something in their protocol? I have the nodeMCU ESP32S 30 pin board. Drivers are ok. Installed the libraries as you did in the video.

Thank you!!
Offline

tonybeccar

  • Posts: 10
  • Joined: Mon Feb 01, 2021 4:14 pm
  • Real Name: Juan Beccaglia

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostFri Mar 05, 2021 6:22 pm

tonybeccar wrote:Hello!

Thanks for creating BlueMagic32!!

I just bought an ESP32 board and followed your steps exactly in the video. Sketch uploaded succesfully. However I cannot connect, I get this error:

BLE Advertised Device found:
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x400d4fdf PS : 0x00060a30 A0 : 0x800d5155 A1 : 0x3ffcd0c0
A2 : 0x00000087 A3 : 0x00000000 A4 : 0x3ffdbe6d A5 : 0x0000ff00
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x8017b010 A9 : 0x3ffcd0a0
A10 : 0x3ffdbe80 A11 : 0x4008bdfc A12 : 0x00000011 A13 : 0x3f40015b
A14 : 0x00000002 A15 : 0x00000006 SAR : 0x00000018 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000087 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0x00000000

ELF file SHA256: 0000000000000000

Backtrace: 0x400d4fdf:0x3ffcd0c0 0x400d5152:0x3ffcd0e0 0x400d53a4:0x3ffcd100 0x400d6f4a:0x3ffcd160 0x400d5b31:0x3ffcd1a0 0x400d34f6:0x3ffcd280 0x400e2975:0x3ffcd2d0 0x400dc38e:0x3ffcd2f0 0x4008ff8a:0x3ffcd320

Rebooting...

Do you have any idea what could it be? Maybe BM updated something in their protocol? I have the nodeMCU ESP32S 30 pin board. Drivers are ok. Installed the libraries as you did in the video.

Thank you!!


I just solved it myself, for anyone who wants to try it: you gotta install the previous version of the esp32 board, the 1.0.4.

Cheers!
Offline
User avatar

Csaba Nagy

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

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostFri Mar 05, 2021 10:19 pm

tonybeccar wrote:
tonybeccar wrote:Hello!

Thanks for creating BlueMagic32!!

I just bought an ESP32 board and followed your steps exactly in the video. Sketch uploaded succesfully. However I cannot connect, I get this error:

BLE Advertised Device found:
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x400d4fdf PS : 0x00060a30 A0 : 0x800d5155 A1 : 0x3ffcd0c0
A2 : 0x00000087 A3 : 0x00000000 A4 : 0x3ffdbe6d A5 : 0x0000ff00
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x8017b010 A9 : 0x3ffcd0a0
A10 : 0x3ffdbe80 A11 : 0x4008bdfc A12 : 0x00000011 A13 : 0x3f40015b
A14 : 0x00000002 A15 : 0x00000006 SAR : 0x00000018 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000087 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0x00000000

ELF file SHA256: 0000000000000000

Backtrace: 0x400d4fdf:0x3ffcd0c0 0x400d5152:0x3ffcd0e0 0x400d53a4:0x3ffcd100 0x400d6f4a:0x3ffcd160 0x400d5b31:0x3ffcd1a0 0x400d34f6:0x3ffcd280 0x400e2975:0x3ffcd2d0 0x400dc38e:0x3ffcd2f0 0x4008ff8a:0x3ffcd320

Rebooting...

Do you have any idea what could it be? Maybe BM updated something in their protocol? I have the nodeMCU ESP32S 30 pin board. Drivers are ok. Installed the libraries as you did in the video.

Thank you!!


I just solved it myself, for anyone who wants to try it: you gotta install the previous version of the esp32 board, the 1.0.4.

Cheers!


Yep good catch, working on a fix to the library so it can be compatible with version 1.0.5

Basically the issue stems from a change that was made to the scanning portion of the code, where in the previous version as the BLE devices were scanned the code kept track of all the devices its scanned and stored it in a list, this no longer happens in the latest version so the list is never populated.
Csaba Nagy
Filmmaker
BMPCC4K
Offline

tonybeccar

  • Posts: 10
  • Joined: Mon Feb 01, 2021 4:14 pm
  • Real Name: Juan Beccaglia

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostSat Mar 06, 2021 7:11 am

Csaba Nagy wrote:Yep good catch, working on a fix to the library so it can be compatible with version 1.0.5

Basically the issue stems from a change that was made to the scanning portion of the code, where in the previous version as the BLE devices were scanned the code kept track of all the devices its scanned and stored it in a list, this no longer happens in the latest version so the list is never populated.


Hey!! Thanks for replying so fast. Good to know you still keep an eye on the project! Everything is so well laid out for us.

I am in the process of building a simple companion that will be almost integrated onto the cage and will provide some ergonomical functions. Will be willing to share the process of course.

I've been at it some long hours today and I managed to build the remote trigger in 5 minutes BUT: as soon as I turn of the camera and turn it back on, the board does not reconnect itself to the camera. I have to reset it and then it will find it.

I've been trying to detect when it disconnects so I can launch the code to connect again but no luck. From what I've found it seems that if the board is connected to the camera and then the camera looses connection, the code "freezes".

Would be awesome for it to start looking for the camera again (like when at first boot).

By no means I am an expert!!
Thanks again very much!!
Offline

DanielMahlknecht

  • Posts: 15
  • Joined: Mon Feb 18, 2019 3:45 pm
  • Real Name: Daniel Mahlknecht

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostSat Mar 06, 2021 10:30 am

Hi,

would it be possible to implement a Photo button on the remote control?
This would be really useful, photos are not so bad on the BMPCC4k but the button on the camera works really bad...

thanks
Daniel
Offline

tonybeccar

  • Posts: 10
  • Joined: Mon Feb 01, 2021 4:14 pm
  • Real Name: Juan Beccaglia

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostSat Mar 06, 2021 2:58 pm

DanielMahlknecht wrote:Hi,

would it be possible to implement a Photo button on the remote control?
This would be really useful, photos are not so bad on the BMPCC4k but the button on the camera works really bad...

thanks
Daniel


Yes you are right. The other day had to do both things (photo and video) and photos looked amazing. If I had a button I would dare go with my shoulder rig on. I cannot find the photo function on the bluetooth protocol on the manual (but steangely neither the record one). Will keep digging.
Offline

tonybeccar

  • Posts: 10
  • Joined: Mon Feb 01, 2021 4:14 pm
  • Real Name: Juan Beccaglia

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostSun Mar 07, 2021 12:50 am

Update!

I managed to do what I wanted in a very dirty dirty way.

Basically when the camera disconnected frrom the board I read the following message in the serial monitor:

[I][BLEDevice.cpp:625] removePeerDevice(): remove: 0, GATT role client

So I went to the BLEDevice.cpp and found that line and added an ESP.restart(); at the end of that function, it ended up looking like this:

void BLEDevice::removePeerDevice(uint16_t conn_id, bool _client) {
log_i("remove: %d, GATT role %s", conn_id, _client?"client":"server");
if(m_connectedClientsMap.find(conn_id) != m_connectedClientsMap.end())
m_connectedClientsMap.erase(conn_id);
ESP.restart();
}

I know it's very dirty but it's working for now. Maybe if I can output a result that I can pass into a variable it would be cleaner.

I also included Esp.h inside the .cpp file

Cheers!
Offline

DanielMahlknecht

  • Posts: 15
  • Joined: Mon Feb 18, 2019 3:45 pm
  • Real Name: Daniel Mahlknecht

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostTue Mar 16, 2021 3:45 pm

Hi,

my M5StickC PLUS yust arrived.
Everything seems to work, but at a certain point during uploading the uploade stops and I get this error message:

Arduino: 1.8.13 (Mac OS X), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"

Sketch uses 967475 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-4D52F73CACA
Connecting....
Chip is ESP32-PICO-D4 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, Embedded Flash, VRef calibration in efuse, Coding Scheme None
MAC: 94:b9:7e:8c:7e:1c
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.


what could be the problem?

thanks
Daniel
Offline

DanielMahlknecht

  • Posts: 15
  • Joined: Mon Feb 18, 2019 3:45 pm
  • Real Name: Daniel Mahlknecht

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostTue Mar 16, 2021 9:29 pm

Hi,

solved :)

had to change upload speed (under tools) from 921600 to 115200, then the upload worked.

Tomorrow I will try the rest :)

thanks
Daniel
Offline

DanielMahlknecht

  • Posts: 15
  • Joined: Mon Feb 18, 2019 3:45 pm
  • Real Name: Daniel Mahlknecht

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostWed Mar 17, 2021 9:57 am

Hi,

unfortunately me again...

I managed to install the Basic_Remote_Trigger, but then the M5StickC-PLUS yust turns black, no Led blinking or what so ever. When I open Serial Monitor and turn on BlueThoot on the BMPCC4K nothing happenes and the Serial Monitor stays blank...
Still the M5StickC-Plus is still recognized, as Serial Monitor will gray out if I disconnect it.

I reinstalled the FActoryTest and The M5StickC-plus turned alive, so it does not seem to be broken...

Tried also adding #include <M5StickCPlus.h> to the Basic_Remote_Trigger but does not change anything, same when I tried to change Board to M5Stick-C instead of ESP2 Dev Module...

Am I missing something, or is the code not compatible with the PLUS version of the M5Stick-C?

thanks
Daniel
Offline

Chris Maier

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

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostWed Mar 17, 2021 2:47 pm

Hi Daniel,

I have not yet used a M5StickC Plus but I managed to use the regular M5StickC and the M5Stack Core basics.

Image

Image

Pay attention:
There is another topic in the developer forum:
viewtopic.php?f=12&t=103495#p740174

You may contact me via PM.

Regards,
Chris
| BMPCC 6K | BMD eGPU | Davinci Resolve Studio | Davinci Resolve Speed Editor |
Offline

tonybeccar

  • Posts: 10
  • Joined: Mon Feb 01, 2021 4:14 pm
  • Real Name: Juan Beccaglia

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostSun Mar 21, 2021 9:20 pm

Hi!

I am trying to build a Web UI to control the camera for an extended reach.

I can use the command getStatus() to get raw data straight out from the camera, from where I get a large group of numbers. Can anyone give me an aproximation on how to read those bytes?

I don't know if that command is reading the "hidden" status category of the camera control. If it is, is there any documentation on it?

Thanks!!
Offline

RyLo2797

  • Posts: 25
  • Joined: Fri Nov 16, 2018 9:31 pm
  • Real Name: Ryan Lorg

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostMon Apr 12, 2021 3:51 pm

DanielMahlknecht wrote:Hi,

unfortunately me again...

I managed to install the Basic_Remote_Trigger, but then the M5StickC-PLUS yust turns black, no Led blinking or what so ever. When I open Serial Monitor and turn on BlueThoot on the BMPCC4K nothing happenes and the Serial Monitor stays blank...
Still the M5StickC-Plus is still recognized, as Serial Monitor will gray out if I disconnect it.

I reinstalled the FActoryTest and The M5StickC-plus turned alive, so it does not seem to be broken...

Tried also adding #include <M5StickCPlus.h> to the Basic_Remote_Trigger but does not change anything, same when I tried to change Board to M5Stick-C instead of ESP2 Dev Module...

Am I missing something, or is the code not compatible with the PLUS version of the M5Stick-C?

thanks
Daniel


Just wanted to chime in here and say I'm having the same problem with my new M5Stick-C (not Plus), too.

At least, I think it's the same. My serial monitor just reports a backwards question mark after the stick initializes. I've loaded other programs via Arduino and M5Burner without problem, but the example for the M5Stick-C doesn't seem to work. Google suggests a baudrate issue, but I've changed my upload speed and the serial monitor to 115200 and I still get the question mark.

The question mark also appears in M5Burner's Serial Monitor. It never finds the camera and asks for the code.

Any suggestions?
Offline

RyLo2797

  • Posts: 25
  • Joined: Fri Nov 16, 2018 9:31 pm
  • Real Name: Ryan Lorg

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostMon Apr 12, 2021 4:18 pm

DanielMahlknecht wrote:Hi,

unfortunately me again...

I managed to install the Basic_Remote_Trigger, but then the M5StickC-PLUS yust turns black, no Led blinking or what so ever. When I open Serial Monitor and turn on BlueThoot on the BMPCC4K nothing happenes and the Serial Monitor stays blank...
Still the M5StickC-Plus is still recognized, as Serial Monitor will gray out if I disconnect it.

I reinstalled the FActoryTest and The M5StickC-plus turned alive, so it does not seem to be broken...

Tried also adding #include <M5StickCPlus.h> to the Basic_Remote_Trigger but does not change anything, same when I tried to change Board to M5Stick-C instead of ESP2 Dev Module...

Am I missing something, or is the code not compatible with the PLUS version of the M5Stick-C?

thanks
Daniel


To actually be helpful to you, Daniel, make sure to setup Arduino IDE for the M5Stick-C Plus as described at the bottom of the page here:
https://docs.m5stack.com/#/en/arduino/a ... evelopment

You'll have to make sure you actually have the M5 Stick C Plus library before #include <M5StickCPlus.h> will work.

And I would adapt one of the m5 examples to the Plus rather than the Basic one.
Last edited by RyLo2797 on Tue Apr 13, 2021 3:07 pm, edited 1 time in total.
Offline

RyLo2797

  • Posts: 25
  • Joined: Fri Nov 16, 2018 9:31 pm
  • Real Name: Ryan Lorg

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostTue Apr 13, 2021 3:07 pm

Okay, I was able to get it working. First, there appears to be an issue with ESP32 1.0.6 and BlueMagic32. 1.0.4 or 1.0.5 should work for now.

Next, and I admit I haven't fully tested that there's a difference, I tried the Windows Store version of Arduino IDE and it finally worked. Probably a coincidence, but if you're pulling your hair out trying to figure out what's wrong, it's worth a shot.

Now, I have to figure out how to connect a button to this thing. :D
Offline

Albiback

  • Posts: 27
  • Joined: Mon Aug 19, 2019 9:03 pm
  • Real Name: Albrecht Bloße

Re: BlueMagic32 | Blackmagic Bluetooth Arduino Library

PostSun May 02, 2021 9:24 am

Hello Thank you a lot for the library.
I just get the problem, that no bluetooth devices will be found.
The bluetooth seem to work.

Does anyone have a solution for this?

p.s. ESP32 ver. 1.05 win
baudrate: 15200
Newline
Processor
AMD Ryzen 9 3950X
GPU
AMD Radeon VII (Driver 10.20.45004.0
OpenGL® 26.20.11000.14757
Vulkan™ Driver 2.0.159)
Memory
64GB (4x16GB) 3600MHz
Motherboard
MSI MEG X570 ACE (MS-7C35) (1.80)
Operating System
Windows 10 Pro (20257)

Return to Cinematography

Who is online

Users browsing this forum: No registered users and 26 guests