One Project Two Devices

Hello, i have a Blynk Project with two devices, how can i give the second ESP the same token as the first one? I mean in the app?

Thanks

Hello. You can’t. Why would you need that?

Okay, i only have to give the second esp the token in my code and must not add a new device in my project?

How do you interface the two devices?

You can use Blynk’s Bridge widget but they require different tokens.

@Costas

I do not use bridge. I want to use same token in my code for two different ESPĹ›. I think this should be all, or? I use different GPIOs and differnet Virtual Pins.

That would only be possible if you use the Local Server. In there you can manipulate the tokens for your projects.

Is it not possible two use two devices in one Project without bridge?

1 Like

Do you mean you have a project that requires 1 ESP and you want to duplicate that project and run it on another ESP?

If this is the case you clone the project and allocate the new token to the 2nd ESP.

It’s simply not possible for different ESP’s to have the same token. It would be like you and I having the same postal address. Does the postman deliver the lottery cheque to you or me?

How does that deal with the lottery cheque?

1 Like

It doesn’t. It will probably give unexpected results, could be fun to try though :slight_smile:

@Costas

No, what i have is three garage doors. Two doors are on ESP1 and the third door is on ESP2, but both boards should be triggered with one Project/ one dashboard. is this possible?

Yes, you can setup multiple devices in your dashboard. you don’t need same auth token for it.

Multiple Device widget as pointed out by @Lichtsignaal

It can be a bit confusing at first so you need to study it over and over again.

It’s a drop down list for you to select ESP#1 or ESP#2, with the different lottery cheque addresses (tokens).

Under Project settings (the nut icon), go down to devices. Select, and add new device. It will generate a new TOKEN for that device, but both devices can be accessed from that project. When adding a widget, there should be a WIDGET SETTING labeled TARGET. That is where you select what device you want that widget to control. I also created a garage door controller/monitor, and in that same project, added two buttons to control a Wi-Fi outlet that I created. One project with two esp8266 NodeMCUs (each with its own auth. token), each performing a different type of task. Hope this helps.

2 Likes

Two doors are on ESP1 and the third door is on ESP2, but both boards should be triggered with one Project/ one dashboard. is this possible?

Yes. Still don’t see why would you need same token. Just create 2 devices with 2 tokens and that will work just fine. Detailed steps provided by @Toro_Blanco.

by the way, can someone explain me why my output is HIGH before i put the Virtual button? This is the second ESP in my Project.

BLYNK_WRITE(V0) //Garage LINKS

{
if (param.asInt() == 0)
{
digitalWrite(16, LOW); //GPIO16
}
else
{
digitalWrite(16, HIGH); // GPIO16
}
}

You mean your output is high or the led is on? it is different…

About use same token… you can use same token for both esp… but in blynk app just create one esp, not two.

You can greatly minimize your code.

the below code does the same thing as your code but in 3 lines instead of 10

BLYNK_WRITE(V0){ //Garage LINKS
   digitalWrite(16, param.asInt()); //GPIO16
}

And how is that going to control the 3 garage doors when 2 doors are wired to ESP#1 and 1 door to ESP#2?

As far as I know, and thinking he have a button to open and a button to close, the ESP that have the BLYNK_WRITE of the button pressed virtual pin reacts and open/close the door, isn’t it?