Hello!!
Today i created a new template, i copied the firmware setting that the console displays right after the template is created.
Pasted it on to my code.
Compiled. And i got an error saying TEMPLATE _NAME not defined!!!
It seems that, on the console they have made an update - DEVICE_NAME to TEMPLATE _NAME
.
But on our code/examples it is still DEVICE _NAME.
So once pasting the template name and device name aka template name, change it back to device name to compile the code successfully.
John93
February 8, 2023, 2:27pm
2
Do you have the most recent library files installed?
Hello, it is new change with deploy. It is correct.
Yes.
But the thing is, we all save the firmware that is stable. So even if we update the lib, that doesn’t fix the problem.
Only if we start with an example, only then the issue will be solved.
Yeah it’s right. But i created a topic for those who are facing this issue.
3 Likes
Hello I have an error that saying this while trying to verify the code how do I fix this?
In file included from c:\Users\BRADLEY\Documents\Arduino\libraries\Blynk\src/BlynkApiArduino.h:14,
from c:\Users\BRADLEY\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp32_SSL.h:21,
from C:\Users\BRADLEY\Desktop\TDS_ESP32_New_Blynk2\BlynkEdgent.h:8,
from C:\Users\BRADLEY\Desktop\TDS_ESP32_New_Blynk2\TDS_ESP32_New_Blynk2.ino:12:
c:\Users\BRADLEY\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkApi.h:39:6: error: #error “Please specify your BLYNK_TEMPLATE_ID and BLYNK_TEMPLATE_NAME”
#error “Please specify your BLYNK_TEMPLATE_ID and BLYNK_TEMPLATE_NAME”
^~~~~
exit status 1
Compilation error: exit status 1
You have to put BLYNK_TEMPLATE_ID and BLYNK_TEMPLATE_NAME at the very top of your code.
Already, but the problem seems to occur because I used BLYNK_TEMPLATE_NAME instead of BLYNK_DEVICE_NAME which I copy from Blynk console
Tell me if the bare example sketch compiles ok?
Did you update to the last Blynk library?
@Brad201 I’d suggest that you post your full sketch, and the resulting compilation error, so we can better understand the issue.
When you post your sketchy it needs to have triple backticks at the beginning and end so that it displays correctly. Triple backticks look like this:
```
Copy and paste these if you can’t find the correct symbol on your keyboard
When you post your compiler error text it also needs triple backticks at the beginning and end.
Pete.
Brad201
October 15, 2023, 10:38am
12
Yes I did update Blynk library to version 1.3.2 . Here is my sketch:
#define BLYNK_TEMPLATE_ID "TMPL6PAWDnTxt"
#define BLYNK_TEMPLATE_NAME "Aquarium water quality monitoring system"
#define BLYNK_FIRMWARE_VERSION "0.1.0"
#define BLYNK_PRINT Serial
#define USE_WROVER_BOARD
//#define BLYNK_DEBUG
//#define APP_DEBUG
#include "BlynkEdgent.h"
int DSPIN = 13; // connect Dallas Temperature Sensor to 13 no pin of ESP32 board
int TDS_Sensor = 34; // connect TDS Sensor to 34 no pin of ESP32 board
float Aref = 3.3;
float ec_Val = 0;
unsigned int tds_value = 0;
float ecCal = 1;
BlynkTimer timer;
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width in pixels
#define SCREEN_HEIGHT 64 // OLED display height in pixels
// Define the I2C address of the OLED display module
#define OLED_DISPLAY_ADDRESS 0x3C
// Create an instance of the Adafruit_SSD1306 library
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_DISPLAY_ADDRESS);
void sendSensor()
{
// Clear the display
display.clearDisplay();
// Display the TDS value
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0, 0);
display.print("TDS: ");
display.print(tds_value);
// Display the EC value
display.setCursor(0, 10);
display.print("EC: ");
display.print(ec_Val, 2);
// Update the display
display.display();
double wTemp = TempRead()* 0.0625; // conversion accuracy is 0.0625 / LSB
float V_level= Aref / 1024.0;
float rawEc = analogRead(TDS_Sensor) * V_level; // Raw data of EC
float T_Cof = 1.0 + 0.02 * (wTemp - 25.0); // Temperature Coefficient
ec_Val = (rawEc / T_Cof) * ecCal;// temperature and calibration compensation
tds_value = (133.42 * pow(ec_Val, 3) - 255.86 * ec_Val * ec_Val + 857.39 * ec_Val) * 0.5;
double Far= (((wTemp *9)/5) + 32); // Temp in Far*
Serial.print("TDS:"); Serial.println(tds_value);
Serial.print("EC:"); Serial.println(ec_Val, 2);
Serial.print("Temperature (oC):"); Serial.println(wTemp,2);
Serial.print("Temperature (oF):"); Serial.println(Far,2);
Serial.print("");
Blynk.virtualWrite(V0, wTemp);
Blynk.virtualWrite(V1, Far);
Blynk.virtualWrite(V2, tds_value);
Blynk.virtualWrite(V3, ec_Val);
}
void setup()
{
Serial.begin(9600);
delay(100);
BlynkEdgent.begin();
delay(2000);
timer.setInterval(1000L, sendSensor);
}
void loop() {
BlynkEdgent.run();
timer.run();
}
And here is the error message that I get:
```In file included from C:\Users\BRADLEY\Desktop\TDS_ESP32_New_Blynk2\TDS_ESP32_New_Blynk2.ino:11:
C:\Users\BRADLEY\Desktop\TDS_ESP32_New_Blynk2\BlynkEdgent.h:15:2: error: #error "Please specify your BLYNK_TEMPLATE_ID and BLYNK_DEVICE_NAME"
#error "Please specify your BLYNK_TEMPLATE_ID and BLYNK_DEVICE_NAME"
^~~~~
exit status 1
Compilation error: #error "Please specify your BLYNK_TEMPLATE_ID and BLYNK_DEVICE_NAME"
I assume that this is an Edgent sketch that you created some time ago, and you haven’t updated the code in any of the .h tabs since.
Take a look at the code in the latest version of BlynkEdgent.h, in particular lines 26-32 and compare them to your current sketch…
#elif defined(ESP8266)
#include <FS.h>
#endif
#define BLYNK_FS SPIFFS
#endif
#ifndef BLYNK_NEW_LIBRARY
#error "Old version of Blynk library is in use. Please replace it with the new one."
#endif
#if !defined(BLYNK_TEMPLATE_NAME) && defined(BLYNK_DEVICE_NAME)
#define BLYNK_TEMPLATE_NAME BLYNK_DEVICE_NAME
#endif
#if !defined(BLYNK_TEMPLATE_ID) || !defined(BLYNK_TEMPLATE_NAME)
#error "Please specify your BLYNK_TEMPLATE_ID and BLYNK_TEMPLATE_NAME"
#endif
#if defined(BLYNK_AUTH_TOKEN)
#error "BLYNK_AUTH_TOKEN is assigned automatically when using Blynk.Edgent, please remove it from the configuration"
#endif
Pete.
Brad201
October 16, 2023, 12:40am
15
I see you were right pete, its my old sketch that causing the problem. I haven’t update the sketch and it won’t compile on new Blynk library. I’ll try again to compile it with the updated sketch and see what happen
@Brad201 i asked you one simple question. If you had taken time to answer this question you should have saved hours of troubleshooting. You could have just added your bit of code to the example sketch and saved it…
Glad that you have got it working now… happy Blynking
Brad201
October 16, 2023, 7:37am
17
I’m sorry @Madhukesh yes I’ve been busy try to troubleshooting the error but yes the bare example sketch run just fine and thanks for helping me