Connecting Arduino w/ HM-10 and ESP32

First of all, I'm having a very hard time understanding Bluetooth because all Arduino oriented guides and tutorial are pretty basic.

I have a clone HM-10 board wired to an Arduino. I've read it's "backwards compatible", but maybe I got it wrong, because I want to connect it to an ESP32 which works under Bluetooth Serial. I have a program coded in the ESP32 that received serial commands from an Android App and controlled some motors and lights. And now I want to send the commands from the Arduino.

I can use my phone to scan and pair with my ESP32, but I have no clue on how to code the Arduino to do exactly that switch.

Do I need a different module? Is it only possible through BLE? If so, the ESP should be a master, a server? Can anyone point me in the right direction?

Your post was MOVED to its current location as it is more suitable.

Could you also take a few moments to Learn How To Use The Forum.

Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

The HM 10 board is a BLE module and it won't communicate with the ESP32 using BluetoothSerial.h like you do with the phone.

To continue with classic bluetooth like you are using with the phone, you would do better to switch to an HC05.
I would not recommend switching to BLE just in order to use the module you have in hand. The HM10 is not a fully configured BLE module and many have had difficulty using it to connect to something other than an iphone.

Either the ESP32 or the HC05 will need to be the master to make the connection. The ESP32 BluetoothSerial example SerialToSerialBTM shows how to make the esp into a master.

This tutorial shows how to configure the HC05 as a master

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.