Currently trying to program my ESP32 so that it can receive information from BLE via my phone and perform an action while also being able to perform an action on my ESP32 that then via BLE performs an action on my phone.
I am new to the BLE scene and am unsure if I want to base my code off the BLE_Notify, BLE_Write or any of the other examples. Any advice where to start?
Robin2:
In what way do the example programs not meet your need?
...R
I'm unsure what example to start with and unsure which type of BLE to make my device. If I'm understanding BLE correctly I could make my ESP32 a Server, Client, Scan, Notify etc. I understand that If I want to relay information from my phone to my ESP32 (and have an LED turn on/off) then I could use the Write example. That solves half my problem as I also want to relay information from the arduino (i.e button press) that then sends information to my phone.
guanciale:
I'm unsure what example to start with and unsure which type of BLE to make my device.
That sounds as if you need to find a website that explains the different ways in which BLE works. I have a vague interest in this but I have done very little research so far. I have not come across the subject in other Forum Threads and I am watching this Thread in the hope of learning something.
Most of the use of Bluetooth with Arduinos seems to be with traditional Bluetooth using simple serial communication with HC05 modules.
Robin2:
That sounds as if you need to find a website that explains the different ways in which BLE works. I have a vague interest in this but I have done very little research so far. I have not come across the subject in other Forum Threads and I am watching this Thread in the hope of learning something....
I have stumbled upon what I think needs to be done. Sorry if this is old info for you, writing it out helps me also understand it more.
When having BLE operate you can have a Master/Central/Client that can Read/Write. You can also have a Slave/Peripheral/Server that can Notify/Indicate. In my case my phone being the Client makes the most sense and ESP32 being the Server makes the most sense.
Read is when the Client requests information from the Server. This can happen in intervals. The server then acknowledges the request
Write sends a task to the server. The server performs and acknowledges the task
Notify is when the server pushes information to the Client, the client doesn't acknowledge.
Indicate is when the server pushes information to the Client, the client does acknowledge.
I could be wrong on some points. It seems I will need to make my ESP32 a Server that Notifies. But also create a phone app that is a Client that Writes.
srnet:
And you also need to reasearch whether the application you want to use on your phone supports BLE.
There are Android applications that support standard Bluetooth, but that does not mean they support the use of BLE.
I plan to make my own phone app so this shouldn't be an issue (or will be a big issue if you consider more work an issue).