Led and Arduino Via Serial USB

I am a beginner and I get this error when I connect Arduino mega, LED via serial USB cable when I run the Arduino usb-serial sketch:

 In file included from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkApi.h:16,
             from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/BlynkApiArduino.h:14,
             from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Adapters/BlynkSerial.h:18,
             from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/BlynkSimpleStream.h:18,
             from Arduino_Serial_USB.ino:30:

C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkParam.h:106: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkParam.h:111: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkParam.h:112: error: ISO C++ does not include variadic templates
In file included from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/BlynkApiArduino.h:14,
from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Adapters/BlynkSerial.h:18,
from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/BlynkSimpleStream.h:18,
from Arduino_Serial_USB.ino:30:
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkApi.h:71: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkApi.h:72: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkApi.h:120: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkApi.h:121: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkApi.h:134: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkApi.h:135: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkApi.h:223: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkApi.h:224: error: ISO C++ does not include variadic templates
In file included from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/WidgetLED.h:13,
from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/BlynkWidgets.h:10,
from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/BlynkSimpleStream.h:23,
from Arduino_Serial_USB.ino:30:
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkWidgetBase.h:25: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkWidgetBase.h:26: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkWidgetBase.h:30: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkWidgetBase.h:31: error: ISO C++ does not include variadic templates
In file included from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/BlynkWidgets.h:13,
from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/BlynkSimpleStream.h:23,
from Arduino_Serial_USB.ino:30:
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/WidgetBridge.h:55: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/WidgetBridge.h:56: error: ISO C++ does not include variadic templates

10 posts were split to a new topic: Can u solve this error

A post was merged into an existing topic: Can u solve this error

I am a beginner and I get this error when I connect Arduino mega, LED via serial USB cable when I run the Arduino usb-serial sketch:

     In file included from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkApi.h:16,
                 from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/BlynkApiArduino.h:14,
                 from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Adapters/BlynkSerial.h:18,
                 from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/BlynkSimpleStream.h:18,
                 from Arduino_Serial_USB.ino:30:
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkParam.h:106: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkParam.h:111: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkParam.h:112: error: ISO C++ does not include variadic templates
In file included from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/BlynkApiArduino.h:14,
                 from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Adapters/BlynkSerial.h:18,
                 from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/BlynkSimpleStream.h:18,
                 from Arduino_Serial_USB.ino:30:
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkApi.h:71: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkApi.h:72: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkApi.h:120: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkApi.h:121: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkApi.h:134: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkApi.h:135: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkApi.h:223: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkApi.h:224: error: ISO C++ does not include variadic templates
In file included from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/WidgetLED.h:13,
                 from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/BlynkWidgets.h:10,
                 from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/BlynkSimpleStream.h:23,
                 from Arduino_Serial_USB.ino:30:
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkWidgetBase.h:25: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkWidgetBase.h:26: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkWidgetBase.h:30: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/Blynk/BlynkWidgetBase.h:31: error: ISO C++ does not include variadic templates
In file included from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/BlynkWidgets.h:13,
                 from C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/BlynkSimpleStream.h:23,
                 from Arduino_Serial_USB.ino:30:
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/WidgetBridge.h:55: error: ISO C++ does not include variadic templates
C:\Program Files (x86)\Arduino\libraries\blynk_library_master\src/WidgetBridge.h:56: error: ISO C++ does not include variadic templates

@Jamin Thank you for the helpful link. After following all the instruction, I am not able to connect through usb serial com4. I am getting the error showing in the image when I change it to com4.
Please note this is the only way of connection I have right now.

Sometimes when that repetitive loop happens, you have to close that window and restart the BAT file.

Also make sure you comment out (or remove) BLYNK_PRINT Serial and any other Serial prints happening over the same port as your USB-Link

@Gunner I tried multiple times but it didn’t work.

Ah, sorry, I didn’t take a close look at your error message… you might not have the needed files installed properly?

I would recommend manually reinstalling the Blynk libraries; Download the Zip file, unzip and copy/paste these folders directly into your Arduino libraries folder.

Once that is done, try running the USB-link from the IDE to get the correct COM port and baud rate for your device.

The USB-Serial has worked, I am trying to do the email, but the serial mointer show timeout and it didn’t send me any email as showing.

This is the code I used. Also i have tried to comment out the blynk.email from the emailbuttonpress to avoid it from going through the loop a cause a login timeout problem.

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
/* Set this to a bigger number, to enable sending longer messages */
//#define BLYNK_MAX_SENDBYTES 128

#include <BlynkSimpleStream.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "e77ddca4ba5f45f388a1d44f59cdb89f";

void emailOnButtonPress()
{
   //Blynk.run();
// *** WARNING: You are limited to send ONLY ONE E-MAIL PER 15 SECONDS! ***

// Let's send an e-mail when you press the button
// connected to digital pin 2 on your Arduino

 int isButtonPressed = !digitalRead(2); // Invert state, since button is "Active LOW"

 if (isButtonPressed) // You can write any condition to trigger e-mail sending
{
Serial.println("Button is pressed."); // This can be seen in the Serial Monitor
Blynk.email("dinakadhim@gmail.com", "Subject: Button Logger", "You just pushed the button...");

// Or, if you want to use the email specified in the App (like for App Export):
//Blynk.email("Subject: Button Logger", "You just pushed the button...");
    }
   }

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

    // Blynk will work through Serial
   // Do not read or write this serial manually in your sketch
   Serial.begin(9600);
   Blynk.begin(Serial, auth);

   // Send e-mail when your hardware gets connected to Blynk Server
  // Just put the recepient's "e-mail address", "Subject" and the "message body"
    Blynk.email("dinakadhim@gmail.com", "Subject", "My Blynk project is online.");

 // Setting the button
 pinMode(2, INPUT_PULLUP);
// Attach pin 2 interrupt to our handler
attachInterrupt(digitalPinToInterrupt(2), emailOnButtonPress, CHANGE);
 }

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

Two things… how are you seeing anything on the serial monitor?? your primary Serial link can only do one thing at a time, load the sketch, then after running the USB-link, connect the device to the internet via the Serial link. Any attempt to tap into that COM port (from the PC side) or use BLYNK_PRINT Serial or any other Serial print will interfere with that connection. Eventually you can use softserial and a USB-TTL adapter , but that is another issue for another day :wink:

And as far as the email… start small and set up a single email that happens right after Blynk.begin(Serial, auth); but is not called in a loop. Once that works then you can work toward a control method that will send additional emails on command without flooding.

Also, you must have the email widget in your App project… nothing to set up in it, but it needs to be there.

@Gunner
I will be using the blutooth type of connection to avoid the interputtion in the serial mointor with the USB serial link. The bluetooth kind of connection is only supported for Android, Right?
For the email, Do you mean just comment out the Blynk.email in the void loop? Will I be able to get the email since its included in the void emailOnButtonPress()?
I will make sure to include the email widget when I try it tonight.

Thanks,

I am getting a bit confused, sorry :slight_smile: but I will try to summarize what I think is going on here.

I see your screenshot of the IDE monitor… however, if you have the USB-link running, you cannot also have the monitor! You must use the main USB Serial on Mega for Blynk’s connection to the server via the USB-Link. And you must delete or comment out #define BLYNK_PRINT Serial and avoid any other Serial.print() statements on that port.

On the Mega, if you want to use any extra hardware serial ports for monitoring, then use Serial1, Serial2 or Serial3 (PINs 14-19), and utilising either a TTL-USB adapter or possibly Bluetooth, to another terminal program on your PC (I use termite).

In your shown example sketch, be sure to change all Serial references for the email portion to one of the above optional hardware serial ports on the Mega.

I wouldn’t try to mix the Bluetooth App link into the mix until you have gotten everything else working… besides the Blynk Bluetooth connection (and yes, currently only on Android) is really a point to point control link between App and hardware (instead of going through a server), not used as a serial data conduit.

I guess you could try to use BT it as the primary link to the App, if connecting the module to one of the extra serial ports, leaving the primary one for the IDE monitor, but I have not been able to get that to work on my end, either with TTL-USB or BT.