How to connect ble device to blynk server?

I use an esp32 module to develop low-power applications, ready to use BLE to send and receive sensor information, but BLE can not directly connect to blynk server, need a bridge to BLE wifi and then send to blynk server, I do not know what solution can be achieved?

My understanding is that the ESP32 has just one radio transmitter/receiver, which is shared between WiFi and BLE. As Blynk requires a constant connection if you’re using the regular library then I don’t think that attempting to switch between WiFi and BLE on the same device is going to work.
You could potentially use Ethernet and BLE on the same ESP32 device.

Alternatively, you might be able to use a BLE board that communicates via SPI or I2C and use this to talk to uopur MCU running Blynk. In that case the board could potentially be an ESP8266 based board rather than ESP32, provided memory, speed and GPIOs isn’t an issue.

Pete.

If the power consumption of the external BLE board becomes larger, the reason why wifi is not used is because the power consumption of wifi is larger than that of BLE. I initially consider using BLE for design, wake up the esp32 through a timer, collect data and send it to a bridge between BLE and wifi, and then send the data to the blynk server through wifi. This reduces the power consumption of BLE devices. But I don’t know how to implement this BLE to wifi bridge? Or is there another solution?

I understand the logic behind wanting to use BLE.

I don’t think that strategy would work with most commercial BLE sensors or triggers. Typically you would have a “master” device that is always-on, then BLE “slave” devices that wake-up either on a timed basis or when they are triggered (by a button-push for example) and send their data to the master device.
If the master device is also going to sleep then it won’t see these data transmissions from the slave devices, unless they both happen to wake-up at the same instant. For the slave devices to be woken-up by the master device then they would need to be in a standby state where they are listening for these wake-up messages, and therefore consuming more power.

Neither do I, but I’ve highlighted some possible approaches in my previous post.

There are lots of potential solutions, but without a deeper understanding of what you are trying to achieve, and what type of slave devices you plan to be using, and whether you’ll be building these yourself or using off-the-shelf devices, it’s extremely difficult to make sensible suggestions.

Pete.

Maybe I didn’t express myself clearly, I just want to know how to connect the BLE device to the blynk server?Or How BLE device send message to blynk server?

You can’t connect a BLE device directly to the Blynk server.

In the Legacy version of Blynk BT/BLE connection to a mobile device like a phone was supported, but that isn’t supported Blynk IoT.

Pete.

Since my last reply you’ve edited your question to add…

If you want to send data to/from a BLE device and the Blynk server then you’ll need a bridge device. That brings us back to your initial question about a bridge device, and my subsequent answers.

To avoid us going around in circles like this it really would be helpful if you would provide more detail about what it is that you’re trying to achieve, and the sort of BLE devices that you’re planning on using, because as I said before…

Pete.

I want to make a single firewire intelligent switch at home, with esp32 as the controller control relay, esp32 module running blynk library, in order to reduce power consumption(May be battery powered), with BLE mode to achieve. See chart below

I want to remotely control esp32 through blynk app, but BLE can not be directly connected to blynk server, the middle needs to be converted from BLE to wifi, this converter can always be powered on, do not worry about data loss, I think this converter may be composed of two esp32 modules. One of them is responsible for BLE and the other is responsible for WIFI. But I don’t know how to implement BLE to wifi function based on blynk library

Leon

“Blynk server X86 computer”
Are you running a Legacy local server? If so, don’t you think that you should have mentioned this in the first sentence of your first post?

Can you expand on this? In my book, Firewire is a type of computer interface and I don’t understand its relevance here.

I don’t understand this part either. If you were wanting to communicate via BLE to a BLE/WiFi bridge then the ESP32 that’s connected to your lamp relay/switch would be running some sort of BLE library, but it wouldn’t be directly connected to Blynk, so wouldn’t be running the Blynk library.
It would be the BLE to WiFi bridge (more accurately a BLE to Blynk bridge) that would be running the Blynk library, or using the Blynk HTTP(S) API to communicate with Blynk rather than using the Blynk library.

You seem to be making an assumption that an ESP32 running BLE continuously consumes considerably less power than an ESP32 running WiFi continuously.
Whilst there may be a slightly lower power consumption when making a BLE transmission than when making a WiFi transmission, the overall difference in power consumption will be negligible.
The ESP32 has a variety of sleep modes which can significantly reduce power consumption, but all of these turn off the wireless modems (WiFi and BLE).
This means that to reduce power consumption of the ESP 32, allowing it to be battery operated, you would need to turn off the modems, making it unable to send or receive commands from the BLE/Blynk bridge. You could program the ESP32 to wake-up on the button push, control the relay and send an outgoing BLE message to the bridge, but you can’t force the ESP32 to wake-up in response to an inbound BLE message because the ESP32 will have its modems turned off, and be unable to see this message.

The main thing I don’t understand is that you show the ESP32 being connected to a relay that controls a 220v lamp. As 220v is available in this setup, why aren’t you powering your ESP32 from this power source, and usingWiFi communication?
Devices like the Shelly 1 would be perfect for this application. It has an ESP8266 inside, along with a relay, and “dry” switch contacts. You can also get something called the Shelly Button which is a small case that houses the Shelly 1 and incorporates a a switch and can be placed inline with the power wire to the lamp.
They are easy to program with Blynk code, and I use these extensively around our houses to switch lamps etc.

Pete.

Why not to use the double cores of ESP32? Fine and Easy.
One on wifi, one on ble?
Many sites shows how.
I test it on others situations with success
Give us feed-back
Al.