Updating libraries that no longer build

These libraries no longer build with the new environment for Photon:

ADAFRUIT_TSL2591 (0.0.3)
PIETTETECH_DHT (0.0.3)
ONEWIREUNOFFICIAL (1.4.0)

I think they all have a new version except ADAFRUIT_TSL2591.
So I have two questions.
What’s the best practice to updating your library through the Web IDE?
How can I fix the ADAFRUIT_TSL2591 library?

Thanks for the help.

Here are some of the errors:

    lib/Adafruit_TSL2591/src/Adafruit_TSL2591.cpp: In member function 'uint32_t Adafruit_TSL2591::calculateLux(uint16_t, uint16_t)':
lib/Adafruit_TSL2591/src/Adafruit_TSL2591.cpp:179:12: warning: unused variable 'chan0' [-Wunused-variable]
   uint32_t chan0, chan1;
            ^
lib/Adafruit_TSL2591/src/Adafruit_TSL2591.cpp:179:19: warning: unused variable 'chan1' [-Wunused-variable]
   uint32_t chan0, chan1;
                   ^
In file included from ./inc/application.h:92:0,
                 from lib/PietteTech_DHT/src/PietteTech_DHT.cpp:46:
lib/PietteTech_DHT/src/PietteTech_DHT.cpp: In function 'uint16_t makeWord(uint8_t, uint8_t)':
../wiring/inc/spark_wiring_arduino.h:53:19: error: redefinition of 'uint16_t makeWord(uint8_t, uint8_t)'
 #define word(...) makeWord(__VA_ARGS__)
                   ^

lib/PietteTech_DHT/src/PietteTech_DHT.cpp:51:10: note: in expansion of macro 'word'
 uint16_t word(uint8_t high, uint8_t low) {
          ^
../wiring/inc/spark_wiring_arduino.h:47:17: error: 'uint16_t makeWord(uint8_t, uint8_t)' previously defined here
 inline uint16_t makeWord(uint8_t h, uint8_t l) {
                 ^

You may want to use the updated version 0.0.5 of this one then :wink:

What's the advantage of OneWireUnofficialover the official one?

What is the problem with TSL2591?
In your error report I can only see a warning refering to that lib. The error comes from the DHT lib, which should be replaced with it's successor version.

But in order to get a library updated, heading to the GitHub repo and opening an issue would be the first step.
Then you have to hope the contributor will update the lib.
Meanwhile you could just copy-past the sources into new file tabs in your project, correct the errors and include statements and you should be fine to move forward.

If a library has gone "stale" since the original contributor doesn't care to update it, you could ask if someone (from Particle or an Elite) might be willing to take ownership of that library and do the needed work (as has happened to the Piettetech_DHT library already).

1 Like