Problem with libraries when compiling with Particle Web IDE

Hi!,
when i tried to verify the following code on Particle Web IDE with a Bluz or a Red Bear Duo as a target device, an "src/blynk-test-v02.cpp:2:19: fatal error: blynk.h: No such file or directory" error appears, but, when I try to verify the same code with a Photon Device as target device, everything is OK. where is the problem?. it is related to the library managaer update? how could i solve it? thanks

     // This #include statement was automatically added by the Particle IDE.
     #include <blynk.h>

     // This #include statement was automatically added by the Particle IDE.
     #include <SparkCorePolledTimer.h>


     #define BLYNK_PRINT Serial
     #define BLYNK_DEBUG

     char auth[] = ""; // Put your token here

     SparkCorePolledTimer myTimer(100);  //Create a timer object and set it's timeout in milliseconds

     void setup()
     {
       Serial.begin(9600);
       delay(5000);
       Serial.println("Start"); 


       Blynk.begin(auth);

       myTimer.SetCallback(sendUptime);
     }

     void sendUptime()
     {
       Blynk.virtualWrite(V5, millis() / 1000);
       Serial.println(millis() / 1000);

     }

     void loop()
     {
       Blynk.run(); // all the Blynk magic happens here
       myTimer.Update();
     }

Some compound system firmware hasn’t been updated yet to support V2.0 libraries, but the respective compound creators are working hard to get that incorporated soon.
Meanwhile you’d need to use the legacy libraries.

1 Like

Hi @ScruffR … as usual, thaaaanks a lot!. yes, in case i use the blynk legacy library by compiling an old project, everything goes ok. so, what’s the difference between that Blynk legacy library and the Blynk 0.4.4 library currently available from Particle Web IDE?. thanks.

For the nitty-gritty details, I need to refer you to @suda or @mdma, but the way how 2.0 libraries are linking into the system firmware for functions therein had to been adapted for some reasons like supporting the interdependency of different 3rd party libraries. If the system firmware doesn’t provide these “interfaces” 2.0 libraries can’t “dock on” and hence won’t build.

And to know what exactly came new with Blynk 0.4.4 (if anything other than just the structure), you’d need to look in their change log.

2 Likes

I’m happy to say that Bluz has released Bluz 2.2.50-beta.3 with libraries support. Red Bear should follow soon.

3 Likes

Hi @ScruffR … how can i include a legacy library in a project?. i need to use the legacy library for Blynk, since it is still not suported for Duo, and i have an old project which includes it, and works fine. but how could i include that legacy library on another project?. as always, many thanks for your support

You’ll need to click on the (i) icon next to the library name and select a previous version.

Hi! again … after consulting with Red Bear team, they told me that the posted problem is on Particle IDE side, since it processes the external libraries to decide if a certain library is included for Duo by default. In that case, it is planned to be included soon? thaaaaaks!

@ScruffR I am working on a project where the code was written some time ago, not sure of the exact timeframe, within the last year. Anyway, cannot get a newer version of the project to compile with the Blynk library… Although in my newer version I can select which version of the library I want, I have no way to look at the other project to see which version of the legacy library it uses to compile correctly. Any clues what to try next?

Thanks

You could create a new project, import the library there and copy/paste your “old” code.

1 Like

Ok, I am confused.:confused:
Here is what I had
Old code
some version of Blynk(have no clue, cannot access the version)

What I did
pasted old code in new project of different name
added Blynk Library

Result

HUH?:astonished:

What did I miss?
Thanks!

With the new library structure you should not use #include "blynk/blynk.h" but #include "blynk.h" and when importing the library in Web IDE the correct include statement should be auto-generated.

1 Like

I went to the library and tried in include the Blynk library but I am getting the message:
blynk.h: No such file or directory.

I saw a post that older versions might work. I tried loading several different older versions of the blynk library by clicking on the “i” icon but still no joy.
The Adafruit_DHT.h library is working fine and everything is good if remove the line #include <blynk.h>.

My code samples are not showing up right. Sorry I am new here How do I add code?

// This #include statement was automatically added by the Particle IDE.
#include <blynk.h>
// This #include statement was automatically added by the Particle IDE.
#include <Adafruit_DHT.h>

Ideas?

What firmware version are you targeting with your project? It needs to be 0.5.3+

If that doesn’t help try creating a new project targeting 0.5.3+, import the needed libraries and then copy/paste your code to that new project.

I am running into the same issue in a new app I am creating. I have played around with which libraries are included along with the blynk library and it doesnt seem to matter. I have tried removing and re-adding, again to no effect. I am running 0.6.3 on a photon. On an old app with blynk and on a photon running 0.6.3, the library app/compiles no problem. It only fails when I try to create a new app.

It doesn’t really matter what version you have preinstalled and running on your Photon. The point is what version are you targeting in the IDE?

Can you post a snapshot-link to your project?

1 Like

Sorry for the delay in the response. I found a workaround. I created a new .ino on the webIDE to test the blynk lib. It compiled fine. I then added all other libraries from the original app I was writing into the this blynk test app. It again compiled fine. I then cut and pasted the code from the original app into the blynk test app. It again complied fine. The original app and the blynk test app were carbon copies of one another, so then I when and tried to compile the original app and it failed. It could not find blynk.h. I removed and readded the blynk lib and it still failed to compile, again because it could not find blynk.h. Both the blynk test app and the oringinal where both compiling to a photon running 0.6.3. It seems like if using the blynk lib it needs to be added to an app before adding any other libraries.

I guess this was what I suggested before

The reason being that in between the library and the project structure got changed. So converting an old project to use new libraries does not always work due to the incompatible structures.
That even goes for a newly created project that targets an old system at time of creation.

1 Like