Blynk & Mesh Networks

I’m guessing integrating Blynk into a WiFi Mesh would be difficult if not impossible, as Blynk would interfere with the mesh.
But new boards on the market now, are WiFi and Bluetooth enabled, so would it be possible to have a Bluetooth mesh leaving the WiFi for Blynk to use?

Bluetooth will be possible when the ESP32 Community / Espressif sort out the problems. As far as I know there is still work to be done and that’s why I rarely use the ESP32.

1 Like

I hope they catch up soon as I’ve just ordered four Wemos ESP32’s, this type with an 18650 battery holder attached. :stuck_out_tongue_winking_eye:

I’ve been playing with the Painless Mesh library and wondered if Blynk could be integrated into a mesh some how, maybe bluetooth?

Why do you want to set-up a Wi-Fi mesh?

Are you just trying to overcome a few Wi-Fi blackspots (if I’m allowed to use that word in today’s PC society)?
If so, then the ESP’s won’t intefere with regular Wi_Fi repeaters. Having said that, you’d be better-off running an Ethernet cable from your router to a remote wireless access point, as you’ll get better performance and reliability.


No real reason other than I’m curious and want to learn more about it. Perhaps later on create a large mesh with several sensors and view the data on my phone via the Blynk app.

I was going to say not unless its an ESP… but maybe I’ll hold fire on that.

Last time I set up a large mesh network, it was just the carrier… whatever else I wanted to use over that carrier (PC, smartTV, phone WiFi, IP camera, etc.) just saw it (the mesh) as a multi-node WiFi AP.

So instead of the hassle (if even possible) of “merging” Blynk firmware and mesh firmware into one hardware device, just setup a mesh network (with independent hardware) and use it to connect a Blynk device at one end with the internet at the other.

Think of how we have cars that use roads… instead of all driving a road paver machine to get where we want :stuck_out_tongue:

1 Like

Looking closer at this painlessMesh (ya right… my headache says different :stuck_out_tongue_winking_eye: ) It is not the same general purpose WiFi AP mesh I was referring too… doesn’t use WiFi.h but does use JSON… so it might have benefits with Blynks API method.

However since I have zero experience with the API… that is just a guess.

@Shadeyman looks like you have blinking lights on your three node mesh… so you are already an expert, compared to me :stuck_out_tongue: … so in this case, just disregard my prior post… it was in reference to a different mesh environment :slight_smile:

1 Like

I’m actually quite impressed that I managed to do it. I took one with me to the shop, it obviously lost connection to the mesh as I drove off, but quickly reconnected when I returned.

I was wondering if I could add Blynk to this Mesh code so an LED in the app on my phone blinked in sync with the LED’s on the three Wemos. Managed to get the code to compile, it even connects to the app, but not for long.

Reading through the site, it has some of the same “all your timing are belong to us” requirements of Blynk… so no doubt they are fighting it out inside :stuck_out_tongue:

- Try to avoid using delay() in your code. To maintain the mesh we need to perform some tasks in the background. Using delay() will stop these tasks from happening and can cause the mesh to lose stability/fall apart. Instead we recommend using the scheduler included in painlessMesh. That scheduler is a slightly modified version of the TaskScheduler library. Documentation can be found here. For other examples on how to use the scheduler see the example folder.

1 Like

The Painless startHere example has delay in it?

void delayReceivedCallback(uint32_t from, int32_t delay) {
  Serial.printf("Delay to node %u is %d us\n", from, delay);

I’m guessing this is a different type/use of delay?

Probably :stuck_out_tongue_winking_eye: In their documentation they, like we do with Blynk, meant the Arduino delay() command which actually blocks all processing while it “runs”

1 Like

@Gunner Have you used the TaskScheduler library ?

No… haven’t even heard of it before… one of these days I will try to look and see if it is usable like the Blynktimer we currently use.

1 Like

This is way above my pay grade … :disappointed:

We get paid?? :open_mouth:


Managed to create a 4 x ESP32 Mesh but finding it impossible to incorporate Blynk.

So my next step was to play with the ESP32’s Bluetooth leaving its WiFi for Blynk.

But my phone can’t find it so I can’t connect to it. It seems to be running but I’m no expert.

#define BLYNK_PRINT Serial

#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>

#include <BLEDevice.h>
#include <BLEServer.h>
#include <BLEUtils.h>
#include <BLE2902.h>

char auth[] = "";
char ssid[] = "";
char pass[] = "";

BLECharacteristic *pCharacteristic;
bool deviceConnected = false;
uint8_t value = 0;

// See the following for generating UUIDs:

#define SERVICE_UUID        "4fafc201-1fb5-459e-8fcc-c5c9c331914b"
#define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8"

class MyServerCallbacks: public BLEServerCallbacks {
    void onConnect(BLEServer* pServer) {
      deviceConnected = true;

    void onDisconnect(BLEServer* pServer) {
      deviceConnected = false;

BlynkTimer timer;

void setup() {

  Blynk.begin(auth, ssid, pass);

  timer.setInterval(2000L, myTimerEvent);

  // Create the BLE Device
  BLEDevice::init("Shadey's ESP32");

  // Create the BLE Server
  BLEServer *pServer = BLEDevice::createServer();
  pServer->setCallbacks(new MyServerCallbacks());

  // Create the BLE Service
  BLEService *pService = pServer->createService(SERVICE_UUID);

  // Create a BLE Characteristic
  pCharacteristic = pService->createCharacteristic(
                      BLECharacteristic::PROPERTY_READ   |
                      BLECharacteristic::PROPERTY_WRITE  |
                      BLECharacteristic::PROPERTY_NOTIFY |

  // Create a BLE Descriptor
  pCharacteristic->addDescriptor(new BLE2902());

  // Start the service

  // Start advertising
  Serial.println("Waiting for a client connection to notify...");
  Blynk.virtualWrite(V5, "Waiting for a client connection to notify...");

void myTimerEvent() {

  if (deviceConnected) {
    Serial.printf("*** NOTIFY: %d ***\n", value);
    Blynk.virtualWrite(V5, "NOTIFY: ", value);
    pCharacteristic->setValue(&value, 1);

void loop()

My Samsung Tablet found it … :grinning:


Thos ESP32’s with built in battery holders are handy… I wonder if one can get both battery on back and OLED on front… Googling now :slight_smile:

Yep… but miniscule OLED and rather high price :open_mouth: at least from my point of view

I plan to take them onsite with me. I’m learning to use the “ArduinoDroid” app( on my phone to program them(once it supports the ESP32). Because they, and my Blynk Local Server(Setup PI ZERO W as ultra portable server and AP (tutorial)) are completely portable, I can take them with me from building site to building site then sneak off to my car for some for some Blynking fun. Well, once I’ve learned how to make the ESP32’s not need a router and talk directly to the server that is …

I love what this guy did with them.

I’ve got “ESPNow” running on all 4 of mine right now, Master/Multiple Slaves Mesh …
Why does it only count up to 255 then start from zero again?