The 1.2.0 version of the library was more forgiving about this, but the rule is once again being enforced rigidly in version 1.3.0
Your code compiles fine for me when I make this change.
I’m going to ammed your earlier post, as it’s not appropriate for users to start hacking around with the libraries to remove the enforcement of these rules.
I just checked by reverting the changes i did in the library and putting the defining variables at the top, It seems to have fixed it but a note to the devs (Nobody defines their variables before including their libraries)
I think the reason why the template ID and name need to be at the top of the sketch are so that they can be parsed correctly by the Blynk.Air process and this is why the library enforces this.
Either way, that’s the rule and Blynk requires it to be followed.
Hello pete, i already put it on the first of my sketch and it still #error “Please specify your BLYNK_TEMPLATE_ID and BLYNK_DEVICE_NAME” can you help me?
Please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code 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.
Then delete the screenshot of your compiler error message and replace it with the text (copied and pasted) from your IDE, and place triple backticks at the beginning and end of that too.
And, if you want help with this, tell us which version of the Blynk library you are using.
Hi Peter
I have the same issue.
I’m using the BlynkEdgent and the 3 mentioned lines are on the top of the code.
On the first (main) page.
The error message looks like this:
In file included from C:\Users\Sandor\Documents\Arduino\KozpontiFigyeles-OTA-08_clone\KozpontiFigyeles-OTA-08_clone.ino:40:
C:\Users\Sandor\Documents\Arduino\KozpontiFigyeles-OTA-08_clone\BlynkEdgent.h:16:2: error: #error "Please specify your BLYNK_TEMPLATE_ID and BLYNK_DEVICE_NAME"
16 | #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"
Your triple backticks need to be immediately above and below your compiler error message, not at the beginning and end of your post. You can use the pencil icon at the bottom of the post to fix this.
Please post your sketch (with triple backticks, as explained above) and tell us which version of the Blynk library you have installed.