I am using the MKR 1010 to make a system which will connect to some BNO055 sensors, a gopro and a computer. The idea is that the MKR1010 is connected through bluetooth to a serial terminal (coolterm) and the operator can send a command to start a test, when the test starts a command URL is sent by MKR1010 through wifi to the gopro to start filming, then readings from the BNO055 will be taken and sent through bluetooth to the serial on the computer, and when the the operator sends a command the end the test the MKR1010 will send the command URL to stop filming.
I have made a program using a Bluetooth Mate Gold with arduino uno and the bno055 sensors which runs everything without the gopro no problem, and I have made a program using the MKR1010 which can start and stop filming from the gopro. I am now having some problems trying to get bluetooth serial communication with the MKR1010. When I made the program using the bluetooth mate gold and Uno i was using the software serial library to communicate between arduino and computer, I was looking at some other projects using an esp32 for bluetooth and most used the bluetoothserial.h library. here is where my problems start, the bluetoothserial.h library is included in the esp32 board package, but apparently not in the MKR1010 board package so I downloaded the esp32 board package and tried to move the libraries manually so I could still use the MKR1010 board in the IDE, but doing this gives me the following error
In file included from /Users/chris/Documents/Arduino/MKR1010bluetooth/MKR1010bluetooth.ino:12:0:
/Users/chris/Documents/Arduino/libraries/BluetoothSerial/src/BluetoothSerial.h:18:23: fatal error: sdkconfig.h: No such file or directory #include "sdkconfig.h"
^
compilation terminated.
exit status 1
Error compiling for board Arduino MKR WiFi 1010.
I then found the sdkconfig.h in the esp32 board package and also tried to move it over manually also but still got the same error. Has anyone had similar problems or been able to use serial bluetooth communication with the MKR1010? if so how?
You need to understand that, although the MKR 1010 does have an ESP32, the microcontroller you're programming is the SAMD chip, not the ESP32. The ESP32 is running its own firmware, which I believe only allows the ESP32 to be used for its WiFi functionality, not Bluetooth. The BluetoothSerial library is written specifically for the ESP32 architecture. It's not just a matter of grabbing files out of the ESP32 package. They're in that package for a reason, because they're written to only work for ESP32. You'll never be able to use that library on the SAMD microcontroller of the MKR 1010. It should be possible to replace the stock ESP32 firmware on the MKR 1010 with your own custom firmware, and in that case you could use the ESP32 hardware package and its BluetoothSerial library but that's an advanced project.
Right, that makes sense, thanks Pert. Am I correct in understanding your comment that without writing a custom firmware (too advanced for me) I can not use bluetooth from the esp32? If not how? Or if so I find it super frusterating that they advertise in the MKR1010 product video that the esp32 adds bluetooth to the range of protocalls supported by the board.
ccomparey:
Am I correct in understanding your comment that without writing a custom firmware (too advanced for me) I can not use bluetooth from the esp32?
This should be possible, however you would need to develop your own firmware for the ESP32.
However, I believe that at least the part of that thread where they say the official ESP32 firmware is not available is outdated. I think the firmware is now available here:
So it's possible that the statement about Bluetooth requiring you to write your own firmware is also outdated. I don't have any experience with the MKR 1010 so I certainly could be wrong.
ccomparey:
I find it super frusterating that they advertise in the MKR1010 product video that the esp32 adds bluetooth to the range of protocalls supported by the board.
Well, it's certainly not a lie. But we tend to expect things to be more beginner friendly in the Arduino world so it could be seen as a misleading statement.
It looks like there's good news today for people wanting to use the BLE functionality of the ESP32. The latest release of the Arduino NINA-W102 firmware has BLE support and there is a beta version of a library for it: http://forum.arduino.cc/index.php?topic=579306