Library include error in Web IDE

What’s the issue @Herner, i can help to test it out. :wink:

Quite simply I pull up a sample library ( thermistor ) add it to my project and it acts like I have not and will not compile, firing errors.

I am using Chrome for those curious

I tested a library earlier on and was able to compile.

Which library are you using? Is it your private library?

As noted thermistor library was the one i tried. tried it a dozen different times all failed to compile

Could you paste the error code here? I will try it out now :wink:

I cant I am not at my pc right now but it is 100% a library issue as my last attempt was literally cloning the example

@Herner, indeed is a library issue due to the changes in the relative url for the libraries. Let me see if i can push some updates to the Thermistor library and have it fixed.

Thanks for letting us know and sorry about that!


Update

@Herner, there’s some complicating issues that needs to be resolved on the backend but the fix for now is:

1.) Do not use the example app in the Thermistor library

2.) Include it in your app and change the #include statements to become


#include "application.h"

// This #include statement was automatically added by the Spark IDE.
#include "Thermistor/Thermistor.h"

This should compile fine. If you need the elapsedMillis library, simply add to your code again via the libraries tab.

Let me know if you are stuck and i’ll see what can be done.

Cheers! :wink:

Hey @Herner , thanks for reporting the issue, and @kennethlimcp , for jumping in to help out!

When we launched the library system, we deliberately made it a community managed thing that anyone could contribute to rather than a Spark managed approach. As a result of this decision, the quality of some libraries is not where we’d like it to be, and folks stumble on libraries whose examples that don’t work as expected, or don’t even compile.

Both @kennethlimcp and @peekay123 have proposed solutions to this that I’m hoping we can work on in the coming weeks. Given the current confusion, it seems like we need to find a way to have more control over publicly available libraries in the IDE. We’ll keep you posted.

Thanks,

-joe

1 Like

Thanks for the update. MY impression was libraries were just that. I tweaked and was able to get libraries working and will write my own thermistor library since the one on spark is not accurate enough for me. I am going to use Bcoefficient and steinhart and port over my arduino code.

Tks guys for helping

I was able to get it to work I am not entirely sure how accurate it is. I did end up using the Thermistor inclusion. I will start a new thread on thermistor.h as it could help others.

Im reviving this topic as I appeared to have walked smack back into a similar issue;

In using the WebIDE I wanted to include the ADAFruit_PN532 LIbrary and use the example readMifareClassic.cpp code.

In verifying the code it reports that the .h file for the AdaFruit Library cannot be found.

readmifareclassic.cpp:34:27: fatal error: dafruit_PN532.h: No such file or directory

The Library is in use across 14 other projects, and it just occurs to me to see if I can get those projects to verify; so I will come back to that but for now I have tried refreshing the browser; and recreating the project and adding the library.

I may either be missing a trick or the Web IDE is unable to find the .h despite finding the library.

I shall keep on tweaking this forward; if I solve it before any suggestions I’ll come back; possibly my next step is to look at seeing how another library works and then track back along this Community Library if they work.

Thank you in advance to those who took time to read/reply

Check your include statement.
It needs to look like this

#include "Adafruit_PN532/Adafruit_PN532.h"

Your error message is indicating you’re missing the sub directory and a leading ‘A’

Excellent news; I thought I might be heading in the right direction so thank you for picking that up for me. At least now Verify points to a new error.

Which leads me to ask if I should go through that library and tidy it up so that it works for other new users like me .. again thanks for the input . Im off to resolve this one next

../wiring/inc/spark_disable_wlan.h:30:2: error: #error This header (spark_disable_wlan.h) has been deprecated. Please use SYSTEM_MODE instead "http://docs.spark.io/firmware/#advanced-system-modes".
#error This header (spark_disable_wlan.h) has been deprecated. \

Seems I can find that in the docs so I'll crack on

As it seems this library is ancient and hasn’t been updated for ages since SYSTEM_MODE() has been there for quite a while now.
Could you ping the owner of the library on his GitHub and/or file a PR there, since only the owner of the contributed library can update it in the public repo.
If he doesn’t respond let us know, Particle is still in need of a process to take over ownership for orphaned/abanoned libraries but also needs to know which are.

I will do , ( whats a PR ? ) cheers

I’m over here working on PN532 for a local community project; originally I was going down the Arduino route but when I saw the CEO answer a question on Quora pointing to the Photon I grabbed a dev board to experiment with and Frankly I think this will, If I can crack getting PN532 updated, be a better presentation in which to show a local STEM event how to build some IOT devices. top marks therefore in responding to questions. Cheers ScruffR

1 Like

Sorry - it's a Pull Request.
When you fork a library and make changes that might be useful for the original too, you file a PR and the owner might pull in your changes into his code.

2 Likes

@loudmouthman, if that’s the library from my repo then it IS old. I would gladly update it if you let me know what changes you want. :smile:

2 Likes

It might be ; the LIbrary says “ADAFRUIT_PN532 0.0.1” and when I view on Github I see https://github.com/rahatmaini/Adafruit_PN532 .

So far in debugging I have been tweaking readMifareClassic with help from walking around the this communit comments; Im not sure how to share my current code here but from my own comments in my code I can tell you that I have

Added AdaFruit_PN532/ to the Include for Adafruit_PN52.h ( ScruffR )
Commented out spark_disable_wlan as its deprecated;
Added particle.process within the core While loops as it was causing the breathing green error.
Added SYSTEM_THREAD(ENABLED) to help ensure photon processes are not blocked;
Commented out checking for Serial.Available it was just looping there forever.

Now im down to getting it to see the PN532 board; im using the Big Red Square Shield which probably has a proper name somewhere but I can link to it if you’re unsure.

Currently Its not seeing the board so my next step was to walk back through the code for spotting a PN532 board running as i2c and ensuring that its evening listening/talking.

I have the PN532 Libraries working in the arduino so I was using that as a reference point; getting these to work in Photon would be a bonus.

Specifically I have a local community/STEM project I am building towards and getting this to work will mean we can use a collection of Photons at a local event and get kids to build and play with NFC and Photons.

Count me in as saying yes please to any help and to offering my own code/time to improve this library and maybe keep it upto date and using some of the Photons features;

thank you in advance.

When @peekay123 offers to brush up his library found here

I’d definetly pick up on his offer - you’d hardly find better support than his.

hopefully I have . Though thats not the Library I can see when searching for Libraries in use so if it can be brushed up or accessible that would be great; currently searching on Pn532 brings up the other developers library ; thanks again for the help.