Blynk and NodeMCU ESP8622 error

• NodeMCU through micro usb (Arduino ISP)

• IOS

Hi,

Im trying to set up my NodeMCU esp8622 through the blynk quickstart however keep getting the same issue. I’ve downloaded the Blynk Libary and the ESP8622 board and still have the issues.

When I run the code that has been emailed to me (see below) I get this error message…

29 | #include <LwipDhcpServer-NonOS.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Multiple libraries were found for "ESP8266WiFi.h

This is driving me absolutely crazy! Any help would be greatly appreciated!
Here is my code:

/*************************************************************

  This is a simple demo of sending and receiving some data.

  Be sure to check out other examples!

 *************************************************************/

// Template ID, Device Name and Auth Token are provided by the Blynk.Cloud

// See the Device Info tab, or Template settings

#define BLYNK_TEMPLATE_ID           "TMPLNuK20qwy"

#define BLYNK_DEVICE_NAME           "Quickstart Device"

#define BLYNK_AUTH_TOKEN            "l5o2eHNWfjKdqsI6_OJXZY8YQj8SlyDf"

// Comment this out to disable prints and save space

#define BLYNK_PRINT Serial

#include <ESP8266WiFi.h>

#include <BlynkSimpleEsp8266.h>

char auth[] = BLYNK_AUTH_TOKEN;

// Your WiFi credentials.

// Set password to "" for open networks.

char ssid[] = "name";

char pass[] = "pass";

BlynkTimer timer;

// This function is called every time the Virtual Pin 0 state changes

BLYNK_WRITE(V0)

{

  // Set incoming value from pin V0 to a variable

  int value = param.asInt();

  // Update state

  Blynk.virtualWrite(V1, value);

}

// This function is called every time the device is connected to the Blynk.Cloud

BLYNK_CONNECTED()

{

  // Change Web Link Button message to "Congratulations!"

  Blynk.setProperty(V3, "offImageUrl", "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations.png");

  Blynk.setProperty(V3, "onImageUrl",  "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations_pressed.png");

  Blynk.setProperty(V3, "url", "https://docs.blynk.io/en/getting-started/what-do-i-need-to-blynk/how-quickstart-device-was-made");

}

// This function sends Arduino's uptime every second to Virtual Pin 2.

void myTimerEvent()

{

  // You can send any value at any time.

  // Please don't send more that 10 values per second.

  Blynk.virtualWrite(V2, millis() / 1000);

}

void setup()

{

  // Debug console

  Serial.begin(115200);

  Blynk.begin(auth, ssid, pass);

  // You can also specify server:

  //Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);

  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);

  // Setup a function to be called every second

  timer.setInterval(1000L, myTimerEvent);

}

void loop()

{

  Blynk.run();

  timer.run();

  // You can inject your own code or combine it with other sketches.

  // Check other examples on how to communicate with Blynk. Remember

  // to avoid delay() function!

}

Can you post more of the compilation error message please?

What version of the ESP8266 core do you have installed? (Tools, Board, Boards Manager, search for ESP8266).

Pete.

I have the newest ESP8266 which is version 3.0.2

Here is the extended error message

c:\Users\a-nor\Documents\Arduino\libraries\ESP8266WiFi\src\ESP8266WiFiAP.cpp:29:10: fatal error: LwipDhcpServer-NonOS.h: No such file or directory
29 | #include <LwipDhcpServer-NonOS.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Multiple libraries were found for “ESP8266WiFi.h”
Used: C:\Users\a-nor\Documents\Arduino\libraries\ESP8266WiFi
Not used: C:\Users\a-nor\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WiFi
exit status 1

Compilation error: exit status 1

Okay, that’s answered both questions.

You need to delete this library…

and allow the compiler to use the version of the file that is part of the ESP8266 2.0.2 core, which is that file that wasn’t used.

Pete.

hi - I have just joined this forum ans just started using Blynk and rleatively new to Arduino C++

I have used the Blynk Quickstart and managed to connect to my NodeMCU ESP8266 board via Wifi - at least thats what the Blynk App says

I wanted to actually control an output LED as detailed in their example notes and added the correct code from their example

Unfortunately Im getting the folllowing compilation error

Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "LOLIN(WEMOS) D1 R2 & mini, 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:2MB OTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 921600"

F:\UNO Elegoo files\My Program files\Toms_Blynk_code\Toms_Blynk_code.ino: In function 'void loop()':

Toms_Blynk_code:84:1: error: a function-definition is not allowed here before '{' token

   84 | {

      | ^

Toms_Blynk_code:95:1: error: expected '}' at end of input

   95 | }

      | ^

F:\UNO Elegoo files\My Program files\Toms_Blynk_code\Toms_Blynk_code.ino:74:1: note: to match this '{'

   74 | {

      | ^

exit status 1

a function-definition is not allowed here before '{' token

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Here is the full Sketch

/*************************************************************

  This is a simple demo of sending and receiving some data.
  Be sure to check out other examples!
 *************************************************************/

/* Fill-in information from Blynk Device Info here */
#define BLYNK_TEMPLATE_ID           "TMPL52MhxHFWM"
#define BLYNK_TEMPLATE_NAME         "Quickstart Device"
#define BLYNK_AUTH_TOKEN            "b1DltRuuF0zKBl-77Mw22Qp_LXYV_Ekh"

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// Your WiFi credentials.
// Set password to "" for open networks.

char ssid[] = "xxxxxx";
char pass[] = "yyyyyyy";

BlynkTimer timer;

// This function is called every time the Virtual Pin 0 state changes
BLYNK_WRITE(V0)
{
  // Set incoming value from pin V0 to a variable
  int value = param.asInt();

  // Update state
  Blynk.virtualWrite(V1, value);
}

// This function is called every time the device is connected to the Blynk.Cloud
BLYNK_CONNECTED()
{
  // Change Web Link Button message to "Congratulations!"
  Blynk.setProperty(V3, "offImageUrl", "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations.png");
  Blynk.setProperty(V3, "onImageUrl",  "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations_pressed.png");
  Blynk.setProperty(V3, "url", "https://docs.blynk.io/en/getting-started/what-do-i-need-to-blynk/how-quickstart-device-was-made");
}

// This function sends Arduino's uptime every second to Virtual Pin 2.
void myTimerEvent()
{
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V2, millis() / 1000);
}

void setup()
{
  // Debug console
  Serial.begin(115200);

  Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
  // You can also specify server:
  //Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass, "blynk.cloud", 80);
  //Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass, IPAddress(192,168,1,100), 8080);

  // Setup a function to be called every second
  timer.setInterval(1000L, myTimerEvent);

// This is where I add Ardunio Hardware specific commands to tet ouytpuy pin

 pinMode(2, OUTPUT); // Initialise digital pin 2 as an output pin
  
}

void loop()
{
  Blynk.run();
  timer.run();
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
  // to avoid delay() function!

  // This is where I add LED control button

   BLYNK_WRITE(V0) // Executes when the value of virtual pin 0 changes
{
  if(param.asInt() == 1)
  {
    // execute this code if the switch widget is now ON
    digitalWrite(2,HIGH);  // Set digital pin 2 HIGH
  }
  else
  {
    // execute this code if the switch widget is now OFF
    digitalWrite(2,LOW);  // Set digital pin 2 LOW    
  }
}

Hope this is now the correct format

Regards

Tom

@Tomreef Please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your compiler error message and your code so that they display correctly.
Triple backticks look like this:
```

Copy and paste these if you can’t find the correct symbol on your keyboard.

Pete.

@Tomreef I’ve deleted your same post in another topic for two reasons…

  1. you only need to post your question once. Having the same question in two places gets very messy when people start responding to both.

  2. you other post was also incorrectly formatted. The characters you used weren’t triple backticks.

When you’ve edited the post above and fixed the formatting I’ll explain what you’ve done incorrectly.
If the formatting hasn’t been fixed after 24 hours this post will also be deleted.

Pete.

This is a function….

Note that I’ve added a closing bracket that was missing.

This is also a function…

void loop()
{
  Blynk.run();
  timer.run();
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
  // to avoid delay() function!
}

C++ does not allow you to place one function inside another.

Pete.

firstly, thankyou the missing } helped me get through to the end of the sketch.

Unfortunately, I am now geting a “Error compiling for board LOLIN(WEMOS) D1 R2 & mini” message at the end of the compilation.

On examining the code I notice that the

if(param.asInt() == 1)

line in the code does not seem to be recognised as varaibles as the if, param, and asInt are not coloured on the Sketch

As these variables are called from the Blynk library, have I missed a programming or definition step in the Setup ?

Here is the full error message

Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "LOLIN(WEMOS) D1 R2 & mini, 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:2MB OTA:~1019KB), v2 Lower Memory, Disabled, TLS_MEM, Only Sketch, 921600"





















In file included from C:\Users\Home\OneDrive\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkApi.h:46,

                 from C:\Users\Home\OneDrive\Documents\Arduino\libraries\Blynk\src/BlynkApiArduino.h:14,

                 from C:\Users\Home\OneDrive\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp8266.h:24,

                 from F:\UNO Elegoo files\My Program files\Toms_Blynk_code\Toms_Blynk_code.ino:17:

C:\Users\Home\OneDrive\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkHandlers.h:152:10: error: redefinition of 'void BlynkWidgetWrite0(BlynkReq&, const BlynkParam&)'

  152 |     void BlynkWidgetWrite ## pin (BlynkReq BLYNK_UNUSED &request, const BlynkParam BLYNK_UNUSED &param)

      |          ^~~~~~~~~~~~~~~~

C:\Users\Home\OneDrive\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkHandlers.h:160:31: note: in expansion of macro 'BLYNK_WRITE_2'

  160 | #define BLYNK_WRITE(pin)      BLYNK_WRITE_2(pin)

      |                               ^~~~~~~~~~~~~

F:\UNO Elegoo files\My Program files\Toms_Blynk_code\Toms_Blynk_code.ino:79:1: note: in expansion of macro 'BLYNK_WRITE'

   79 | BLYNK_WRITE(V0) // Executes when the value of virtual pin 0 changes

      | ^~~~~~~~~~~

C:\Users\Home\OneDrive\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkHandlers.h:152:10: note: 'void BlynkWidgetWrite0(BlynkReq&, const BlynkParam&)' previously defined here

  152 |     void BlynkWidgetWrite ## pin (BlynkReq BLYNK_UNUSED &request, const BlynkParam BLYNK_UNUSED &param)

      |          ^~~~~~~~~~~~~~~~

C:\Users\Home\OneDrive\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkHandlers.h:160:31: note: in expansion of macro 'BLYNK_WRITE_2'

  160 | #define BLYNK_WRITE(pin)      BLYNK_WRITE_2(pin)

      |                               ^~~~~~~~~~~~~

F:\UNO Elegoo files\My Program files\Toms_Blynk_code\Toms_Blynk_code.ino:28:1: note: in expansion of macro 'BLYNK_WRITE'

   28 | BLYNK_WRITE(V0)

      | ^~~~~~~~~~~

exit status 1

Error compiling for board LOLIN(WEMOS) D1 R2 & mini.



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

You should post your full sketch.

Pete.

here is full sketch

/*************************************************************

  This is a simple demo of sending and receiving some data.
  Be sure to check out other examples!
 *************************************************************/

/* Fill-in information from Blynk Device Info here */
#define BLYNK_TEMPLATE_ID           "TMPL52MhxHFWM"
#define BLYNK_TEMPLATE_NAME         "Quickstart Device"
#define BLYNK_AUTH_TOKEN            "b1DltRuuF0zKBl-77Mw22Qp_LXYV_Ekh"

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// Your WiFi credentials.
// Set password to "" for open networks.

char ssid[] = "Hopeful";
char pass[] = "Hopeful10";

BlynkTimer timer;

// This function is called every time the Virtual Pin 0 state changes
BLYNK_WRITE(V0)
{
  // Set incoming value from pin V0 to a variable
  int value = param.asInt();

  // Update state
  Blynk.virtualWrite(V1, value);
}

// This function is called every time the device is connected to the Blynk.Cloud
BLYNK_CONNECTED()
{
  // Change Web Link Button message to "Congratulations!"
  Blynk.setProperty(V3, "offImageUrl", "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations.png");
  Blynk.setProperty(V3, "onImageUrl",  "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations_pressed.png");
  Blynk.setProperty(V3, "url", "https://docs.blynk.io/en/getting-started/what-do-i-need-to-blynk/how-quickstart-device-was-made");
}

// This function sends Arduino's uptime every second to Virtual Pin 2.
void myTimerEvent()
{
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V2, millis() / 1000);
}

void setup()
{
  // Debug console
  Serial.begin(115200);

  Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
  // You can also specify server:
  //Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass, "blynk.cloud", 80);
  //Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass, IPAddress(192,168,1,100), 8080);

  // Setup a function to be called every second
  timer.setInterval(1000L, myTimerEvent);

// This is where I add Ardunio Hardware specific commands to for output pin
 pinMode(2,OUTPUT); // Initialise digital pin 2 as an output
}

void loop()
{
  Blynk.run();
  timer.run();
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
  // to avoid delay() function!
}
BLYNK_WRITE(V0) // Executes when the value of virtual pin 0 changes
{
  if(param.asInt() == 1)
  {
    // execute this code if the switch widget is now ON
    digitalWrite(2,HIGH);  // Set digital pin 2 HIGH
  }
  else
  {
    // execute this code if the switch widget is now OFF
    digitalWrite(2,LOW);  // Set digital pin 2 LOW    
  }
} // missing closing curly bracket added by Pete Knight

For some reason the Blynk library throws this error when you use BLYNK_WRITE(V0)
if you use `BLYNL_WRITE(V1) then it compiles fine.

@vshymanskyy any idea why this is happening?
I tested this with v1.3.2 of the Blynk C++ library (the bundled version installed via the Arduino IDE, dated 4th September 2023).

Pete.

Thanks Pete - compiles OK now as you say

Will try it out on my board tomorrow

Hi - tried out on board - needed to change pin 2 to pin D2 for board to recognise it - but then signal actually appeared on D4

However, a success, my iPhone controls a real LED on and off

will now explore multiple outputs and then inputs to Blynk

thanks for your help

Tom

You need to understand the mapping between the screen printed “D” numbers on the board and GPIO numbers…

Pete.

Hi - I have continued with controlling 3 LEDs and using GPIO mapping to Arduino Dx pins ok

However, I have tried to explore expanding the QuickStart dashboard to enable more control buttons and virtual pin inputs outputs as suggested in the brief section in the starter notes

I am trying to explore the Blynk system to understand what i can do with Blynk before committing to purchasing but unfortunately the basic starter QuickStart only demos minimal (3) functions

So far, am I correct in the following

  • The QuickStart only is able to support 3 virtual pins V0, V1 and V2
  • The maximum data streams for QuickStart is 5, but not fully available
    If you want more you need to sign up to package
  • You can only have 1 x V0 (switch control) on QuickStart

Also, I have found the documentation to be very limited (example - no real explanation of Virtual pins, examples, linked to data streams.

Is there any better sources of information to enable me to do more research on how it all works with examples that work
I am happy to do the research but am finding it difficult to find the correct information

The free subscription supports 5 datastreams per template. I don’t understand what you mean by “fully accessible. Just add some more datastreams attached to the virtual pins you want.

I don’t understand the question. What exactly are you trying to achieve?

Personally, I don’t like the QuickStart example, but it does serve a purpose.

Pete.

Firstly, I would like to thank Pete Knight for his help on helping me move forward with this issue. After a lot of reading and tinkering I think I have come to grips with what you are able to do/not do with the Free Investigating facility on Blynk . So here are some of the things I have found, which I hope will help others if they land on this post looking for answers

  1. The Quickstart Device is very limited, but it does show you how to connect to wi-fi
  2. Don’t bother trying to modify your Quickstart device template as it is very limited
  3. DO create a NEW template and tryout the different Virtual Datastreams (max of 5 i.e V0 to V4)
  4. You can create 2 new devices so try out different configurations
  5. If you have tried one out, delete it and try another one to explore the widgets etc.
  6. There is a limit to what Widgets are available, but still enough to get a feel of whats going on
  7. I have created 2 new devices (deleted the Quickstart device to make room)
  8. First device has 3 leds which and be switched on individually, or all at one. Also I have an Ultrasound distance sensor which brings in the distance as a string and displays it. I will attach the code etc below for information
  9. Second device has the Ultrasound Distance plus two Temperature probes on a serial polling line and display the values in a Temp gauge and also on a graph showing historical data. Happy to post code if someone is interested.
  10. The Graphs however are configured by the Web Dashboard, which I found a bit messy, as the screen for Web display is limited due to multiple command boxes - would benefit from being able to address the Wed View independently so this can be made mode presentable

ok - here is the code fro first device - may not be pretty but it works

This code sets up NodeMCU ESP8266 bard for wi-fi using Blynk library
Comminicates over wi-fi to Phone - on Blynk app
Controls 3 LEDs connected to GPIO2 (RED),GPIO4 (YELLOW), GPIO5 (GREEN)
These map to actual pins GPIO2=D9,GPIO4=D14,GPIO5=D15 0n AZ D1 board

Also takes a Distance value from WiFi board provided by Ultrasound
These inputs are on GPIO13 (Trigger) and GPIO12 (Echo)
These map to actual pins GPIO13=D11 and GPIO14=D12

Uses 5 virtual pins from Blynk Library
V0 = Control Switch RED LED on/off
V1 = Control Switch YELLOW LED on/off
V2 = Control Switch GREEN LED on/off
V3 = Control Switch ALL THREE LED on/off
V4 = String, Distance value

*************************************************************/

/* Fill-in information from Blynk Device Info here */

#define BLYNK_TEMPLATE_ID           "TMPL5t8WOh8wn"
#define BLYNK_TEMPLATE_NAME         "Tom new template"
#define BLYNK_AUTH_TOKEN            "i9rGJqEJgN5EtPgnaZfGe5U1QqvwGC7m"

// ultrasound distance definitions
#include "SR04.h"   // Ultrasonic library
#define TRIG_PIN 13 // Ultrasonic pin definintion pins changed so can run LCD screen as well
#define ECHO_PIN 12 // note GPIO13 = D11 and GPIO12 = D12 on Arduino WiFi Board

// Ultasonic setup and definition
int calibration = 1; //calibration value if needed
SR04 sr04 = SR04(ECHO_PIN,TRIG_PIN);
long a;

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// Wifi Setup parameters
char ssid[] = "xxxxxxxx";  //My WiFi Network and Password
char pass[] = "yyyyyyyy";


BlynkTimer timer;

// *********************************************************************************


// This function is called every time the device is connected to the Blynk.Cloud
BLYNK_CONNECTED()
{
  // Change Web Link Button message to "Congratulations!"
  Blynk.setProperty(V3, "offImageUrl", "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations.png");
  Blynk.setProperty(V3, "onImageUrl",  "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations_pressed.png");
  Blynk.setProperty(V3, "url", "https://docs.blynk.io/en/getting-started/what-do-i-need-to-blynk/how-quickstart-device-was-made");
}

// This function sends Arduino's uptime every second to Virtual Pin 2.
void myTimerEvent()
{
   Blynk.virtualWrite(V4, a," cm"); // Writing distance (a cm) to app
}

//*****************************

void setup()
{
  Serial.begin(9600);   //Initialization of Serial Port for Ultrasonic reporting on Serial Monitor in ICE
  Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
  timer.setInterval(1000L, myTimerEvent); // Setup a function to be called every second

  pinMode(2,OUTPUT);// Initialise digital pin GPIO02 as an output RED LED
 pinMode(4,OUTPUT); // Initialise digital pin GPIO04 as an output YELLOW LED
 pinMode(5,OUTPUT); // Initialise digital pin GPIO05 as an output GREEN LED
}

// ****************************************************************

void loop()
{
  Blynk.run();
  timer.run();

  // this is code to get didtance reading and then print with CR to Serial Monitor for checking
  a=sr04.Distance(); // reading the distance from Ultrasonic
  a = a + calibration;  //calibration if needed
  Serial.print(a); // printing to Serial Monitor
  Serial.println("cm");//The difference between "Serial.print" and "Serial.println" 
                        //is that "Serial.println" can change lines.
  delay(250); // delay set to 250 ms to speed reading
}

// here is code to switch RED 0n ***************************************************
BLYNK_WRITE(V0) // Executes when the value of virtual pin 0 changes
 {
  if(param.asInt() == 1)
    {     
    digitalWrite(2,HIGH);  // Set digital pin 2 HIGH // execute this code if the switch widget is now ON
    }
  else
    {      
    digitalWrite(2,LOW);  // Set digital pin 2 LOW - note this physically appears on D4 
    }
 }


// here is code to switch Yellow 0n **************************************************************88

BLYNK_WRITE(V1) // Executes when the value of virtual pin 1 changes
 {
  if(param.asInt() == 1)
    {     
    digitalWrite(4,HIGH);  // Set digital pin red_led_pin (D4)HIGH // execute this code if the switch widget is now ON
    }
  else
    {      
    digitalWrite(4,LOW);  // Set digital pin red_led_pin LOW - note this physically appears on D4 
    }
 }
 
// here is code to switch GREEN 0n *****************************

BLYNK_WRITE(V2) // Executes when the value of virtual pin 2 changes
 {
  if(param.asInt() == 1){
    digitalWrite(5,HIGH); } // Set digital pin 5 (D1)HIGH // execute this code if the switch widget is now ON
  else {     
    digitalWrite(5,LOW); } // Set digital pin 5 LOW - note this physically appears on D1
 }
 
// here is code to switch all 3 LEDs on *******************************

BLYNK_WRITE(V3) { // Executes when the value of virtual pin 3 changes
  if(param.asInt() == 1) { 
    digitalWrite(2,HIGH);  // Set digital pin 2 (D4)HIGH // execute this code if the switch widget is now ON
    digitalWrite(4,HIGH);  // Set digital pin 4 (D2)HIGH // execute this code if the switch widget is now ON
    digitalWrite(5,HIGH);} // Set digital pin 5 (D1)HIGH // execute this code if the switch widget is now ON
  else {     
    digitalWrite(2,LOW);  // Set digital pin 2 LOW - note this physically appears on D4 
    digitalWrite(4,LOW);  // Set digital pin 4 (D2)LOW // execute this code if the switch widget is now OFF
    digitalWrite(5,LOW);}  // Set digital pin 5 (D1)LOW // execute this code if the switch widget is now OFF
} // missing closing curly bracket added by Pete Knight```

Here is the Blynk Mobile Screenshot