BlueMagic32 | Blackmagic Bluetooth Arduino Library

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

Csaba Nagy

  • Posts: 283
  • 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: 1930
  • 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: 6
  • 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: 6
  • 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!
Online
User avatar

Csaba Nagy

  • Posts: 283
  • 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: 6
  • 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: 8
  • 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: 6
  • 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: 6
  • 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!

Return to Cinematography

Who is online

Users browsing this forum: Csaba Nagy, KeesNL, Overlander and 33 guests