OK totally lost here with Blynk2.0 example!

It seems that it’s very unclear to old-school-blynkers that the dashboard is just a template before it’s applied to actual devices. Thanks for this feedback!

This will be solved in 3 stages:

  1. We already added a note to the docs in the hope that someone will read it
  2. We will add a note to the dashboard explaining that it’s a template
  3. UX will be improved by allowing to choose (or create) a “Preview Device” in the dashboard constructor + a couple of other improvements.

Hope it will solve this confusion.

3 Likes

Looks like I am going to expire before I figure it out myself. Is there anyway to do static provisioning at the moment? I think the Blynk Twitter feed promised an example video? Has that happened and where can I find it please? I only have a Wemos D1 mini to test with WiFi and am not able to connect via the app. Wifi is enabled and my phone is connected via that to the Wemos D1 mini. Sorry if I am missing something obvious.
Thank you

Yes, it’s all in the docs, and very simple…

Just add the:

#define BLYNK_TEMPLATE_ID             ""
#define BLYNK_DEVICE_NAME             ""

lines to your old sketch and populate your template ID/Name information, and add your device auth token, and compile with Blynk library 1.0.0 or later (not one of the beta versions).

Pete.

1 Like

@PeteKnight
Thanks for the reply. I am working my way through the docs and was actually following this
https://docs.blynk.io/en/getting-started/template-quick-setup
when I ran into the issue. Either I am following things out of order or the steps are. I’d be willing to bet its me :grinning:

So what exactly is your issue?
How far have you got with the process?
Have you created your device yet?

Pete.

I have made it to step 5.

I then clicked on the link for Dynamic provisioning template for ESP8266 and was led to the Github page.
Clicked on the Edgent_ESP8266.ino and pasted it in Arduino and get the following errors.

Arduino: 1.8.13 (Windows 10), Board: “LOLIN(WEMOS) D1 mini (clone), 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, DOUT (compatible), 40MHz, 4MB (FS:2MB OTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 921600”

sketch_jun23a:18:10: fatal error: BlynkEdgent.h: No such file or directory

18 | #include “BlynkEdgent.h”

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

compilation terminated.

exit status 1

BlynkEdgent.h: No such file or directory

I have the latest Blynk library installed

I tried adding new tabs with all the .h files and it still gives errors and will not compile
image

:confused:

Okay, your question was about static provisioning, so I assume you have a working Blynk 0.1 sketch, which has SSID, pass and auth token defined in it.

Don’t touch your phone at all, do this from your web dashboard…

Create a template. You can add some datastreams if you wish, but that’s not necessary at this stage.
Copy the template I’d and name code snippet from the template and paste it into your old sketch near the top.

Ckick the magnifying glass on the left hand side to show devices. Click add and create a device from your template,
Locate the auth code on the device info tab and copy it, and paste it into your sketch.

Compile the sketch and upload it to your board, then reboot. It should connect to Blynk and tour device will show as online in the web dashboard.

You can then go back to your template and add-in datastreams and deploy them to your device.

Pete.

Yes, I asked about static because dynamic has proven to be beyond my grasp. I didn’t want to completely give up on it though so I continued to try. Anyway, Ill give the suggestion a go and let you know the results.
Thank you as always for your time and patience

@PeteKnight,getting closer! Using the ESP8266 Standalone example. Entered template ID, auth token (man I had a hard time locating that!) and my wifi credentials. Flashed the firmware and am connected to my wifi but not blynk cloud? Missed something???

image

blynk-cloud.com is the wrong server for Blynk 2.0 it should be blynk.cloud

Are you specifying the server in your sketch?

Pete.

I did not specify the server. The firmware comes from Files/Examples/Blynk/Boards WiFi/ESP8266_Standalone. I did enter both Template ID and then tried adding Template ID and Blynk Device Name without success

/*************************************************************
  Download latest Blynk library here:
    https://github.com/blynkkk/blynk-library/releases/latest

  Blynk is a platform with iOS and Android apps to control
  Arduino, Raspberry Pi and the likes over the Internet.
  You can easily build graphic interfaces for all your
  projects by simply dragging and dropping widgets.

    Downloads, docs, tutorials: http://www.blynk.cc
    Sketch generator:           http://examples.blynk.cc
    Blynk community:            http://community.blynk.cc
    Follow us:                  http://www.fb.com/blynkapp
                                http://twitter.com/blynk_app

  Blynk library is licensed under MIT license
  This example code is in public domain.

 *************************************************************
  This example runs directly on ESP8266 chip.

  Note: This requires ESP8266 support package:
    https://github.com/esp8266/Arduino

  Please be sure to select the right ESP8266 module
  in the Tools -> Board menu!

  Change WiFi ssid, pass, and Blynk auth token to run :)
  Feel free to apply it to any other example. It's simple!
 *************************************************************/

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

/* Fill-in your Template ID (only if using Blynk.Cloud) */
//#define BLYNK_TEMPLATE_ID   "YourTemplateID"


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

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

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";

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

  Blynk.begin(auth, ssid, pass);
}

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

Strange, I flashed the firmware again and now even though I still cannot connect to the cloud, it is no longer trying to connect to blynk.cloud.com but rather blynk.cloud.

image

I assume you have got the right auth from the device auth section ?

Have you commented out device ID and template is?

ok so found this and still nothing is happening anywhere!!

Your sketch from post #18 doesn’t have any virtual pin handlers (BLYNK_WRITE(vPin)) or Blynk.virtualWrite() commands, so not sure what you expect to happen?

I assume that if you have widgets in the app connected to the same virtual pin numbers then the app and the dashboard mirror each other?

Pete.

@Blynk_Coeur yes, I have double and triple checked the auth token

@VIGHNESHNS2008 I have checked this also, thanks

UPDATE

@PeteKnight I have done nothing more except leave things be for hours, checked back after some time and now it is connected. Strange

image

1 Like

I did think that pete but of course no mention of doing that in the getting started docs. I assume it was fudging the data somehow.

Its probs the worst example I have seen so I may just start from scratch and done my own simple one.

which i guess i will have to do as pro demo all expires tomorrow!!

god knows how i am going to convert 1300 lines of code to work with the new blynk 2.0!!!

Cheers

kev

Wow, my mind is blown. The documents are all over the board. There is no flow to anything and it is very frustrating.

agree totally!

1 Like