Info regarding BT and BLE

User avatar
kolban
Posts: 1683
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: 14
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 :)

whiskreal
Posts: 1
Joined: Thu Jun 01, 2017 11:42 am

Re: Info regarding BT and BLE

Postby whiskreal » Thu Jun 01, 2017 11:44 am

Is there any example code for using BLE on ESP32 Arduino? At the moment, I can only find the example code which changes the advertising ID. Is is possible to have code which will open a serial link between the Arduino and a phone for example? E.g. so the phone can receive data (e.g. voltage etc) from the ESP, and can also send commands back (e.g. turn a GPIO on or off?)

Thanks!

shadow
Posts: 23
Joined: Fri Dec 02, 2016 4:56 pm

Re: Info regarding BT and BLE

Postby shadow » Fri Jun 02, 2017 10:33 am

I don't think there is yet, you can search the Arduino repo for the tickets where a lot of people request this.
The situation seems to be that the underlying lib, IDF, does not yet have a stable API for it so the Arduino dev does not want to implement the lib until it stabilizes, but he's willing to accept PRs :)

Louisca
Posts: 3
Joined: Wed Jun 07, 2017 5:15 pm

Re: Info regarding BT and BLE

Postby Louisca » Sun Jun 11, 2017 3:01 pm

And if we're using a GATT protocol instead of a GAP protocol, the esp 32 chip will be connected to only one central device and will stop advertising itself, could this ensure data securily?

Who is online

Users browsing this forum: No registered users and 140 guests