Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Excessive Library installs
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

Excessive Library installs

by JackTheSE on Sat Jul 11, 2020 9:45 am

I have noticed that when I request installation of certain Adafruit libraries, I get a suite of libraries installed, with many of them unneeded for my use. This causes an irritating clutter of installed libraries on the Arduino IDE, but is much more problematic when using PlatformIO. There, these unneeded libraries are always compiled (used or not) and display many compiler warnings for non-standard C++ code. Some have outright errors for missing links, and PlatformIO will not continue at all. I have to laboriously identify and delete these libraries. And guess what: If a library update is needed, all the unneeded libraries come back!

JackTheSE
 
Posts: 30
Joined: Wed Jan 02, 2019 8:34 pm

Re: Excessive Library installs

by electricphred on Mon Jul 13, 2020 12:59 pm

JackTheSE:

I couldn't agree more! I'm a new PlatformIO convert and a new AdafruitIO user so this is doubly unfamiliar. I've spent HOURS sorting thru library issues to get my ESP32 (Thing Plus) working on PlatformIO where the examples compiled relatively easily under the Arduino IDE. So far as I can tell 100% of my problems are your excessive library install issues.

Why is Sleepy Dog Library downloaded? Can't see where its called or think when it might be used in my apps. Since it throws errors I've variously deleted it directly under file manager (I'm on a MAC) or under .VSCODES lib src. or I have put a lib_ignore in my platform.ini. Similar is WIFI101 which seems to throw errors and doesn't appear to be needed.

Now I am chasing down multiple errors from WiFiclient.cpp:

~WiFiClientSocketHandle()
{
close(sockfd);
}
Where identifier 'close' is undefined. WiFiclient seems to depend on WiFi and I'm not certain that I've got an ESP32 variant

All very frustrating for us newbies.

electricphred
 
Posts: 15
Joined: Wed Jul 01, 2020 10:40 am

Re: Excessive Library installs

by JackTheSE on Tue Jul 14, 2020 10:15 am

I'm a new PlatformIO convert and a new AdafruitIO user

I'm new to PIO too, and I'm making that transition precisely to better control library installs. I have purged all global libraries in PIO, and install only the libraries I need for a given sketch as Project Libraries (incredibly, PIO installs a library as a global library as a default, after saying to never do this!). So I currently have over a dozen ESP32 sketches that each use the AdafruitIO library, so this creates a mess twelve times over for me.

Some kind of a policy change at Adafruit must have driven this mess, because a year ago or so I never encountered these library pile-ons as I call them. I now avoid using any Adafruit library where I have a choice, but I have no alternative for AdafruitIO. And I'm surprised and disappointed at the sloppy coding I see in the Adafruit libraries. The Arduino IDE lets you get away with that, but PIO is rigorous about C++, for better or worse. PIO assumes that, if you have installed a library, you're going to use it, so it always gets compiled. The Arduino IDE ignores a library if it is not used, and does not compile it, as I understand. Well, at least I'm getting a lot of practice purging Sleepy Dog and the other bad actors that are sneaking into my projects...

JackTheSE
 
Posts: 30
Joined: Wed Jan 02, 2019 8:34 pm

Re: Excessive Library installs

by brubell on Wed Jul 15, 2020 11:52 am

SleepyDog is used by the Adafruit FONA, but I don't see it in the Adafruit IO Arduino's library dependencies:

https://github.com/adafruit/Adafruit_IO ... erties#L10

It's within Adafruit MQTT's dependencies: https://github.com/adafruit/Adafruit_MQ ... erties#L10 but not compiled with Adafruit MQTT, it's included in an example: https://github.com/adafruit/Adafruit_MQ ... na.ino#L20

These dependencies are listed within library.properties to run the Arduino-CI script which tests example sketches against the compiler for the respective hardware.

brubell
 
Posts: 988
Joined: Fri Jul 17, 2015 10:33 pm

Re: Excessive Library installs

by electricphred on Wed Jul 15, 2020 7:11 pm

brubell:
But I'm not using FONA so why is the Sleepy Dog Library called for compilation and throw its errors? Had to learn about Sleepy Dog enough to know how to delete it or exclude it. Ridiculous for this newbie.

Jack:
Could you tell us what board your are using and post your platform.ini and the libraries that have worked the wonders for you. Thanks in advance

electricphred
 
Posts: 15
Joined: Wed Jul 01, 2020 10:40 am

Re: Excessive Library installs

by JackTheSE on Sat Jul 18, 2020 4:49 pm

Could you tell us what board your are using and post your platform.ini and the libraries that have worked the wonders for you.


Be glad to. Took a while because I wanted to skinny down to the fewest installed libraries that allowed a small working sketch to connect to WiFi and then connect to AdafruitIO. Board is a NodeMCU-32S. Here's the platformio.ini:

[env:nodemcu-32s]
platform = espressif32
board = nodemcu-32s
framework = arduino
upload_speed=921600
monitor_speed=115200

And here the list of just three installed Project Libraries that were needed (I have no Global Libraries):

Adafruit IO Arduino
Adafruit MQTT Library
ArduinoHttpClient

The program that connects to AdafruitIO has the following includes:

#include <AdafruitIO.h>
#include <AdafruitIO_WiFi.h>

Hope that helps. Note that when I installed the AdafruitIO library for instance, I got 21 additional installed libraries, which I had to delete, one by one. Adafruit MQTT had a similar, smaller number of pile-ons.Apparently they may be needed for the examples that come along, so I see why Adafruit includes them, but there is no way to turn that off as far as I know.

JackTheSE
 
Posts: 30
Joined: Wed Jan 02, 2019 8:34 pm

Please be positive and constructive with your questions and comments.