Page 1 of 1

Bluetooth control via Matlab

PostPosted: Wed Dec 18, 2019 1:23 am
by scdakin
Hi
I am working on controlling a BMPP4K from Matlab (a scientific programming environment) which support low energy bluetooth devices. All I want to do is trigger "record" and "stop-record" in software.

I first pair the device from Windows. My camera later shows up when I list devices in Matlab and I can connect to it and see a nice list of characteristics:


"Generic Access" "1800" "Device Name" "2A00" {["Read" ]}
"Generic Access" "1800" "Appearance" "2A01" {["Read" ]}
"Device Information" "180A" "Manufacturer Name String" "2A29" {["Read" ]}
"Device Information" "180A" "Model Number String" "2A24" {["Read" ]}
"Custom" "291D567A-6D75-11E6-8B77-86F30CA893D3" "Custom" "5DD3465F-1AEE-4299-8493-D2ECA2F8E1BB" {["Write" ]}
"Custom" "291D567A-6D75-11E6-8B77-86F30CA893D3" "Custom" "B864E140-76A0-416A-BF30-5876504537D9" {["Indicate"]}
"Custom" "291D567A-6D75-11E6-8B77-86F30CA893D3" "Custom" "6D8F2110-86F1-41BF-9AFB-451D87E976C8" {["Notify" ]}
"Custom" "291D567A-6D75-11E6-8B77-86F30CA893D3" "Custom" "7FE8691D-95DC-4FC5-8ABD-CA74339B51B9" {1×3 string }
"Custom" "291D567A-6D75-11E6-8B77-86F30CA893D3" "Custom" "FFAC0C52-C9FB-41A0-B063-CC76282EB89C" {["Write" ]}
"Custom" "291D567A-6D75-11E6-8B77-86F30CA893D3" "Custom" "8F1FD018-B508-456F-8F82-3D392BEE2706" {["Read" ]}


I think my woes are very similar to others who have posted to this forum: I can connect, read attributes like device name etc, but I cannot control the device by writing to UUID: 5DD3465F-1AEE-4299-8493-D2ECA2F8E1BB

Changing the name by writing to UUID: FFAC0C52-C9FB-41A0-B063-CC76282EB89C doesn;t work either (does the changed name show up in the Bluetooth menu for ANYONE?)

Either
(a) i'm missing something about what codes I should be sending or the device or
(b) my camera doesn't consider itself paired when accessed from Matlab (it lists its status as 0x03 i.e. powered and connected right? should be 0x07 if paired as well?)

Any advice (from developers on other platforms too!) would be greatly appreciated.

Re: Bluetooth control via Matlab

PostPosted: Thu Dec 19, 2019 12:50 am
by Csaba Nagy
How to use the protocol is found here:
https://documents.blackmagicdesign.com/ ... 9929000000

Re: Bluetooth control via Matlab

PostPosted: Thu Dec 19, 2019 10:26 pm
by scdakin
Yep Csaba I've read the documentation (which is basically reproduced in the BMPP4K manual)

I think I share an issue with a few people which is knowing when the camera is ready to receive instructions... The documentation is a bit vague here.

I get a status for the camera (which has been paired) of 0x03 which is assume is "powered" (0x01) & "connected" (0x02) but I cannot get a status of 0x07 which I assume would indicate it is also "paired" (0x04) from the point of view of the software. Sending a value of 0x01 through 7FE8691D-95DC-4FC5-8ABD-CA74339B51B9 does not trigger pairing as the manual says it should.

My question is: what state is required for the camera to be controllable?
Also, how did you trigger bonding of the camera? Did the status-change route work for you?

Thanks!

Re: Bluetooth control via Matlab

PostPosted: Mon Dec 30, 2019 11:13 pm
by Brendan Dower
Hi Steven,

We have some sample applications, which may be of use for you to determine how to bond to the camera. The sample code is written in XCode using swift, but you may be able to take the concepts and apply them to Matlab.

You can find the sample code on our developer website: https://www.blackmagicdesign.com/au/dev ... uct/camera

Kind regards,
Brendan