I was working on the old Blynk version, now when I moved to new one, the web app says we must define BLYNK_TEMPLATE_ID
and BLYNK_DEVICE_NAME
in the code.
I just defined the BLYNK_AUTH_TOKEN
and it works fine
So … why should we define them ? is there any problem without these defines ?
It depends how you’re doing your Blynk connection.
If you just do Blynk.begin(auth);
then Blynk Libraries with version greater than 0.6.1 will try to connect to the Blynk Legacy servers (blynk-cloud.com).
Later versions of the Blynk library (and you should currently be using 1.0.1 with Blynk I0T) will look at the first two lines of code in the sketch. If the library sees a Template ID in there then it will know that it has to connect to the Blynk IoT cloud servers (blynk.cloud) instead.
If you manually specify the IoT cloud server in your Blynk connection code then you can work around this behaviour, and I believe that you can even force the legacy library to connect with the IoT cloud severs (but this isn’t a good idea!).
There’s also some info in this topic…
Pete.
thank you for your reply
that’s how i connect to blynk:
Blynk.config(AUTH, "blynk.cloud", 8080);
Blynk.connect();
it works fine …so why should i define them ?
It’s your choice. If you want to specify the server in your connection string then go with your approach.
Pete.