Blynk Library for Arduino v0.4.1 is released

As i can see BLYNK_APP_CONNECTED() is also included in this update. I should use it like other blynk functions right? (like BLYNK_WRITE(Vpin))

Where did you see it? ) it’s not included

Well, i just added that to my code and it compiled without any errors, so I was thinking that it is included :smiley:

Hi what is exactly meant by “Blynk.begin() now blocks until server is connected” do you mean it will wait forever until its connected ?

@mars blocking is needed for many users as pretty much all the sample sketches simply had Blynk.begin() and when you start adding Widgets like RTC they are quite often skipped without blocking.

Search GitHub, docs and this site for Blynk.config() which doesn’t block.

so given the changes in 0.4.1 does that mean the Blynk.begin will wait forever until it connects to a Blynk server (or is there a configurable time-out parameter, either in Blynkconfig.h or local blynkserver) ?

Hi.
I have a problem with the 0.4.1 library version. I copied manually libraries into my Arduino Library folder, but now (even in basic ESP8266_standalone sketch from example) I’ve got various errors:
In file included from C:\Program Files (x86)\Arduino\libraries\Blynk\src/WidgetRTC.h:14:0,

             from C:\Program Files (x86)\Arduino\libraries\Blynk\src\WidgetRTC.cpp:13:

C:\Program Files (x86)\Arduino\libraries\Blynk\src/Blynk/BlynkWidgetBase.h: In member function ‘void BlynkWidgetBase::setLabel(Args …)’:

C:\Program Files (x86)\Arduino\libraries\Blynk\src/Blynk/BlynkWidgetBase.h:27:9: error: ‘Blynk’ was not declared in this scope

     Blynk.setProperty(mPin, "label", args...);

     ^

C:\Program Files (x86)\Arduino\libraries\Blynk\src/Blynk/BlynkWidgetBase.h: In member function ‘void BlynkWidgetBase::setColor(Args …)’:

C:\Program Files (x86)\Arduino\libraries\Blynk\src/Blynk/BlynkWidgetBase.h:32:9: error: ‘Blynk’ was not declared in this scope

     Blynk.setProperty(mPin, "color", args...);

     ^

In file included from C:\Program Files (x86)\Arduino\libraries\Blynk\src\WidgetRTC.cpp:13:0:

C:\Program Files (x86)\Arduino\libraries\Blynk\src/WidgetRTC.h: In static member function ‘static time_t WidgetRTC::requestTimeSync()’:

C:\Program Files (x86)\Arduino\libraries\Blynk\src/WidgetRTC.h:37:5: error: ‘Blynk’ was not declared in this scope

 Blynk.syncVirtual(instance()->mPin);

 ^

C:\Program Files (x86)\Arduino\libraries\Blynk\src\WidgetRTC.cpp: At global scope:

C:\Program Files (x86)\Arduino\libraries\Blynk\src\WidgetRTC.cpp:15:20: error: ‘uint8_t WidgetRTC::mPin’ is not a static member of ‘class WidgetRTC’

uint8_t WidgetRTC::mPin;
How can I fix this? Thanks!

Which Arduino ide version are you using??

@saurabh47 1.6.11

I had same RTC issue on ide 1.6.5
Now i have 1.6.12 no RTC issue.
I haven’t tried blynk library 0.4.1
But I advise you to try 1.6.12

Delete all old libraries and then install new. I just fixed it in that way

1 Like

… so now the “non blocking way” is this?

  Blynk.config(wifi, auth, myBlynkServer, 8442);
  Blynk.connectWiFi(ssid, pass);

This is correct?

Just move <Time.h> inclusion before <WidgetRTC.h>

@naamah75 the way we use Blynk.config () is as follows:

  1. ssid and pass are stored in ESP’s after the first connection so don’t specifically need to be included in a Blynk sketch i.e. you can store the ssid and pwd with a basic Arduino sketch, WiFi Manager (if you wish to change the WiFi credentials) and other tools etc.

  2. Then simply:

  Blynk.config(auth, server, port);
  unsigned long maxMillis=millis() + 8000;
  while ((Blynk.connect() == false) && ( millis() <= maxMillis)) {
  }

If you actually want to use ssid and pwd in your Blynk sketch then use regular WiFi commands BEFORE the Blynk.config() command.

Edited to show usual variable names in Blynk.config() function.

Ok… thanks for the optimization advices, the most important thing, now for me, is that using Blynk.config and Blynk.connect my sketch continue to the next line even isn’t connected to the server (non blocking).

The first time I must specify all data (user, pass, and so on) to be used the next times or also I can store parameters in the ESP using AT command in a seperate way.

You can’t use wifi in Blynk.confg() as the function is defined as:

void config(const char* auth,
            IPAddress   ip,
            uint16_t    port = BLYNK_DEFAULT_PORT)

So just Blynk token, IP address and port number. For your variable names, and before I upgrade to the v0.4.1, the following compiles and the ESP connects.

  Blynk.connectWiFi(ssid, pass);
  Blynk.config(auth, myBlynkServer, 8442);
2 Likes

@saurabh47 I fixed it! I’ve installed Arduino Ide 1.6.13 and now works! Thanks

2 Likes

where is the new local server?

EDIT: obviously, it is where it ALWAYS is, my bad :frowning:

1 Like

oh well, i broke my Pi upgrading the local server, i am assuming an issue my end, but wondering if anyone else got local server glitch?

and no, i did not have my Blynk projects backed up. :frowning:

EDIT: fixed now.

hello!

after upgrading to new app, how can i pair/connect bluetooth modules in the app?
the bluetooth widget is greyed out, it says already installed, but it is not :slight_smile: