Info regarding BT and BLE

User avatar
kolban
Posts: 516
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Info regarding BT and BLE

Postby kolban » Mon Jan 09, 2017 3:59 pm

Howdy LEDOFF,
Your thinking is solid. I too had the issue of bootstrapping an ESP32 to a network and at the time was ignorant on BT and went with the ESP32 becoming an access point and a Web Server when it didn't know how to connect ... my fragments of code can be found here:

https://github.com/nkolban/esp32-snippe ... g/bootwifi

Ideally, we should be able to write a common module that we can all use that will advertize in access point and/or BT for the bootstrapping.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

tanvipatel
Posts: 13
Joined: Mon Jan 09, 2017 12:13 pm

Re: Info regarding BT and BLE

Postby tanvipatel » Fri Jan 13, 2017 5:21 am

kolban wrote:Thanks for your response. I'm going to practice my words on BLE and BLE design (I feel like a baby who is learning to speak as I study this stuff ... and if I don't practice ... I'll be forever stuttering and mispronouncing ... so if you or anyone else sees errors in my thinking ... yell out).

I'm imaging an ESP32 connected to a sensor (in your case a BME280). As such, the ESP32 can "read" data from that sensor and know its values. Great. Now I'm imagining the ESP32 being a BLE peripheral (I think that is the correct term ... our choices are peripheral or controller). The ESP32 will then start advertising itself via the GAP protocol ... it will advertise its Bluetooth Device Address (bd_address) as well as the "services" it exposes. Your Android phone will act as a BLE controller. It will locate the ESP32 because of its transmitted advertisements.

Now ... lets pause here ... because this may literally be the end of the story. Using BLE GAP, an ESP32 should be able to be a "broadcaster" meaning that it can literally publish BLE packets with a payload of up to 31 bytes of data without forming ANY network connections to anyone. In this mode, the ESP32 will be broadcasting its sensor read data ... presumably periodically (once a second, once a minute etc etc). The Android phone can passively receive these broadcasts and just "use" the data. This story would only be useful for broadcasts where there is no security involved. For example, the temperature or air pressure of data within range of your BT phone doesn't "feel" sensitive.

And ... this may be all you need.

Do you have any requirements to send instructions "to" the ESP32?






Hello ,

I read your above post ...

I have to do similar as you say it your post but in my case i have to make one of the GPIO high when any notification arrive on
mobile. So for that my mobile shall be connect with ESP32 board using Bluetooth or BLE.

Using BLE_ADV code available in esp-idf it will only advertise data not provide any connection as per my knowledge. So to connect ESP32 and mobile device so they will communicate with each other wirelessly what should do??

Please help me ..
Thank You :)

Who is online

Users browsing this forum: No registered users and 1 guest