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.
Info regarding BT and BLE
Re: Info regarding BT and BLE
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
-
- Posts: 14
- Joined: Mon Jan 09, 2017 12:13 pm
Re: Info regarding BT and BLE
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
Re: Info regarding BT and BLE
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!
Thanks!
Re: Info regarding BT and BLE
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
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
Re: Info regarding BT and BLE
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 146 guests