I have a couple questions about BLE.
First, is it possible to setup the ability to have multiple BLE client connections to the same server? For example, for the BLE client/server project. Can (or how do) I set it up to respond to two clients instead of one?
Second, what is the distance that can be achieved with BLE between client and server?
Third, how do you setup communications between an ESP32 client and an Raspberry Pi 3 or do BLE using a RPI? This might be off topic but I’m think about a bigger project I have of using my RPI, which already produces a display for my calendar and the weather for the next week, along with some news headlines, but having it recieve info about the actual current temperature outside would be really nice. The closest current “local” weather condition reading is from a station three cities and several miles away from me. Not really local.
- Unfortunately when a BLE client establishes a connection with a BLE server, the BLE client stops the advertising… With the current BLE implementation it’s a 1 to 1 communication. They are working on implementing more BLE features including BLE Mesh: https://github.com/espressif/esp-idf/issues/819
- BLE and Bluetooth classic are meant for short range communication. I’ve found it very reliable for 5 to 10 meteres distance. After that, you’ll get it disconnected and inaccurate results. I always recommend testing, because it depends in your area/workspace (walls, wireless noise, etc)
- Why do you plan to use BLE for that? For the low power consumption?
I really didn’t know how else to do it. It seems kind of a waste to use LoRa for a 2-3 meter distance. With ESP32 I could put into deep sleep for 5 minutes, wake up, get readings and send them to the client (then to the RPI to update the display), then put it back to sleep. With the low power consumption I could use the solar panels to charge the battery, and even with a couple weeks of rain and overcast skies (I live pretty far north of the equator so it’s cloudy and overcast several weeks at a time), I think it will work well. But I have that gap to jump between the sensors (server) and the receiver (client -> RPI -> display). Even with the LoRa, I’d still have to figure out how to get the data into the RPI. I’m open to suggestions.
If your ESP32 is mostly in deep sleep, you could use MQTT with Wi-Fi. I think it’s a very reliable method to publish data to your Pi. Wi-Fi will use more battery, but if it’s only a couple of requests per hour and you use a solar panel to charge the batteries, it should still last for months or years.
Note: for lower power applications, you should always use a bare ESP32 chip with a custom PCB. The LoRa project that I show in the course lasts indefinitely, because it’s more than enough to re-charge the battery. But if I used Wi-Fi and made requests every 10 minutes, it would have a similar performance.
To ensure your battery never runs out of energy, you can use a battery with more capacity and a solar panel that provides more current to re-charge the battery faster.