Hi,
I am new to this community and I hope my post is in the right space of discussion.
I am trying to control a Blackmagic 6k camera with an M5stack (esp32) board. I followed this GitHub tutorial: GitHub - schoolpost/BlueMagic32: Arduino ESP32 Library for connecting to Blackmagic Cameras using Bluetooth Low Energy.
my setup:
MAC: M2 ventura 13
Arduino IDE: 2.1.0
Esp32 board manager version 1.0.4
Library: GitHub - schoolpost/BlueMagic32: Arduino ESP32 Library for connecting to Blackmagic Cameras using Bluetooth Low Energy.
Example used:
#include <BlueMagic32.h>
#define BUTTON_PIN 0
int buttonState; // the current reading from the input pin
int lastButtonState = LOW; // the previous reading from the input pin
unsigned long lastDebounceTime = 0; // the last time the output pin was toggled
unsigned long debounceDelay = 50; // the debounce time; increase if the output flickers
void setup()
{
Serial.begin(115200);
BMDConnection.begin("BlueMagic32");
BMDControl = BMDConnection.connect();
pinMode(BUTTON_PIN, INPUT);
}
void loop()
{
int reading = digitalRead(BUTTON_PIN);
// If the switch changed, due to noise or pressing:
if (reading != lastButtonState)
{
lastDebounceTime = millis();
}
if ((millis() - lastDebounceTime) > debounceDelay)
{
if (reading != buttonState)
{
buttonState = reading;
// only toggle the LED if the new button state is HIGH
if (buttonState == HIGH)
{
if (BMDConnection.available())
{
BMDControl->toggleRecording();
}
}
}
}
lastButtonState = reading;
}
But when I enter the password given by the camera, the M5stack reboot. I get this message in the monitor:
BLE Advertised Device found:
---> PLEASE ENTER 6 DIGIT PIN (end with ENTER) :
517380
Stack smashing protect failure!
abort() was called at PC 0x400df9bc on core 1
Backtrace: 0x40092a2c:0x3ffc9610 0x40092c5d:0x3ffc9630 0x400df9bc:0x3ffc9650 0x400d93ff:0x3ffc9670 0x400d9426:0x3ffc9730 0x400d577d:0xa0b063cc
Rebooting...
BLE Advertised Device found:
Do you have any idea how could I settle this problem?
Thank you for your help.
Nelson