What component to receive bluetooth on ESP32?

For general Flowcode discussion that does not belong in the other sections.
Post Reply
MJU20
Posts: 248
http://meble-kuchenne.info.pl
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 75 times
Been thanked: 50 times

Flowcode v10 What component to receive bluetooth on ESP32?

Post by MJU20 »

At first glance I thought that the Bluetooth_SPP_ESP32 component could make a ESP32 to receive data from another device. But this appears to only be a slave component.

I've never looked into Bluetooth on FC before so my apologies for this question: how do I make an ESP32 to receive data from a (slave) device?
I only know the slave device's name and need to figure out what kind of data it sends (to later act on).

Some any suggestions or examples?

chipfryer27
Valued Contributor
Posts: 1177
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 287 times
Been thanked: 417 times

Re: What component to receive bluetooth on ESP32?

Post by chipfryer27 »

Hi

I've not looked at ESP32 BT capabilities, but if it is only a "slave" then I doubt if it will communicate with any other "slave" device. It should connect to any other device configured as "Master" though, perhaps a PC or another chip connecting via HC06 or the like?

I've posted a couple of examples of connecting Master / Slave using HC05/HC06, perhaps in the "old" forum.

When testing BT I use an android running Serial Bluetooth Terminal by Kai Morich. Very handy.

Regards

MJU20
Posts: 248
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 75 times
Been thanked: 50 times

Re: What component to receive bluetooth on ESP32?

Post by MJU20 »

And is there a way to make it read data from a slave device?
So add the name of the slave device and capture the data the slave sends?

chipfryer27
Valued Contributor
Posts: 1177
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 287 times
Been thanked: 417 times

Re: What component to receive bluetooth on ESP32?

Post by chipfryer27 »

Hi

As mentioned I haven't yet explored ESP32 BT but I used the HC05/06 here

https://www.matrixtsl.com/mmforums/view ... 06#p107295

They use the UART so things were quite simple to implement.

Looking at the FC ESP32 BT component it looks like it's a Slave, and from within you can set the device Name and Send/Receive much like other devices. Didn't see anything about PIN though.

If I get the chance I'll try and have a play over the weekend, but I'm also trying to get a Creality Ender-5+ to print, so far without much luck (detaches at about 70%).

Regards

PS
If I do play, I'll set up one of the HCxx modules as Master connected directly to a PC running "Terminal" via TTL-USB converter

MJU20
Posts: 248
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 75 times
Been thanked: 50 times

Re: What component to receive bluetooth on ESP32?

Post by MJU20 »

Thank you Chipfryer!

But I don't want to use external components for the ESP32 if this is already available on the chip.
So, all I want is to connect to a slave device from where I only know the name of, and receive data from it.

Is there a way to use the ESP32 as a Bluetooth master is more like what I want to accomplish.

chipfryer27
Valued Contributor
Posts: 1177
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 287 times
Been thanked: 417 times

Re: What component to receive bluetooth on ESP32?

Post by chipfryer27 »

Hi

From what I see in my brief look at the FC component for ESP32 BT, it only operates as a slave. That isn't to say it cannot act as a Master, just that you may need to include your own "C" or such like to do so.

What do you intend to connect to? Most phones by default operate in Master as does my Laptop. I can see it being handy though as Master. Gather info from a sensor (or whatever) and pass it on to whatever via WiFi.

Regards

MJU20
Posts: 248
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 75 times
Been thanked: 50 times

Re: What component to receive bluetooth on ESP32?

Post by MJU20 »

Thank you again Chipfryer!!!

But my question remains the same: is there a way to get a ESP32, without external components to act as a master?

All I want is to connect a device (as a slave), only by knowing it's name and pair it with an ESP32 (that acts as a master).
The device (a kind of remote control), will send commands on which the ESP should act on.

So my question is: how can I use an ESP32 in FC10 to receive data from a device that is paired by knowing it's name?

In parallel I will ask for a component that does just that.

chipfryer27
Valued Contributor
Posts: 1177
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 287 times
Been thanked: 417 times

Re: What component to receive bluetooth on ESP32?

Post by chipfryer27 »

Hi

Is there any reason the ESP cannot act as a slave to the device sending instructions to it?

Briefly and non-technically, a Slave advertises it's presence and a Master instigates a connection. Other than that, once paired comms is very straightforward. Whatever the Master or Slave sends, the other end will receive. With BLE you could potentially have a Master talking to multiple Slaves but most instances are one-on-one.

What is the other device? A uC or such like?

Regards

MJU20
Posts: 248
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 75 times
Been thanked: 50 times

Re: What component to receive bluetooth on ESP32?

Post by MJU20 »

The slave device that should connect with the ESP is a kind of remote control.

There is no way of making this device a Master...

But in Arduino there are library's to make the ESP the master so.. this must be possible in FC too?

chipfryer27
Valued Contributor
Posts: 1177
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 287 times
Been thanked: 417 times

Re: What component to receive bluetooth on ESP32?

Post by chipfryer27 »

Hi

I agree it's possible to set as Master, but at present not without your own code.

It would be a nice feature though.

Regards

Post Reply