Libraries - Where would I find a description of library calls

Where do I find a descriptions of library calls? I have a sketch with…
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiClient.h>
The sketch I modified activates various relays via wifi using simple html addressing. Occasionally the sketch goes to sleep and is unresponsive to wifi calls. I am not asking for help to diagnose my wifi issue. I just need to know where to find the plain English description of each library function call within each of the above xxxx.h #include libraries. I need a description of what is sent and what is returned (or void) with every function in these libraries. I can decipher the library function calls in the sketch, but need to know what other functions are available in these libraries, so that I might make my sketch more fault tolerant. What (and where) file extension do I look for… possibly a .txt file?? Even more confusing is that I can’t fine either of the ESP8266 librareies on my hard drive, yet the sketch works.

I purchased one of the large Arduino kits and worked all lessons as well as several books, but nowhere are function calls described, I accept them on blind faith, add libraries with the IDE and everything works flawlessly, but NOWHERE can I find library function calls described.

The files are on your hard drive. I don't know what you did or what went wrong.

The location of documentation depends upon the library, but a good place to start is the comments in the .h and the .cpp files. These files will also help with deciphering how the functions work and what functions are available.

For libraries that are installed in C:\Users\yourusername\Documents\Arduino\libraries, you can open the .h and .C/.CPP files. The .h files contain the information that your looking for; although often poorly documented in my opinion. If it's a class based library, you can look for the public variables and methods.

To know what is exactly returned (e.g. -1 indicates error, n indicates number of bytes received) you will often have to dig through the .C/.CPP files. Sometimes the useful information is in there.

But as said, in my opinion the documentation often leaves a lot to be desired.

The libraries that come with the IDE are all pretty well documented here. The libraries like the ones you are talking about come from third parties. Some dude wrote that and was nice enough to share it. But it wasn't any of us here at this forum. If you want better documentation for those libraries then you'll have to go to where you got them and ask the people who wrote them.

Some libraries, and the ESP stuff is especially bad about this, don't have any documentation at all and the only way you are ever going to figure out what you want is to look at the source code and just figure it out.

killawatt: Where do I find a descriptions of library calls?

Look up the SOURCE CODE of the library files you are interested in!

Sometimes the code contains comments. And at least: You have the FULL SOURCE CODE AND CAN READ THE CODE.

some of the possible locations for ‘design notes’:
comments in the library .h and/or .cpp files
comments in example sketches published as part of the library
or other files included in the library
github repository if one exists
publisher’s website

The ESP8266 core and libraries are well documented. Google is your friend. A simple google search would likely lead you to the github repo: https://github.com/esp8266/Arduino

Scroll down to the documentation link and then to libraries and go from there.

Or here: http://esp8266.github.io/Arduino/versions/2.0.0/doc/reference.html

--- bill

Google for "Neil Kolban"; he wrote nice books on the esp chips; the esp32 version is a work in progress; the books are free of charge.

kind regards,

Jos

In Win7, I found stuff for add-on boards in ‘AppData’ under my user profile:
C:\Users\GFV\AppData\Local\Arduino15

gfvalvo thanks for help (and no thanks to Microsoft's stupid file search). Like you, I also found all my ESP8266 libraries in C:\Users\myname|AppData\Local\Arduino15. Microsoft has implemented the most worthless, confusing and squirrely file search in the Win 10 File Explorer..... I searched C:\ for my ESP8266 libraries and none were found.... yet they were there.... much grief and time wasted. I had no idea that Arduino put libraries in ....\Arduino15. I assume the folder name ending with 15 was created with version 1.5.x ...

Now I still have a question ----> I find a WiFiClient.h library under both Program Files(x86) and under AppData and they are different, so how does the IDE know which to use? It looks like libraries can be in 3 different file paths, under..... Programs(x86), AppData, and My Documents.

killawatt: I had no idea that Arduino put libraries in ....\Arduino15. I assume the folder name ending with 15 was created with version 1.5.x ...

Yes and all the "packages" like add on cores are installed down there. I'm not a fan of the way they did this. It has many issues and is bad practice since it is installing executable binaries in a users home directory. It means that each user on a system ends up effectively installing the same stuff. It also falls flat on its face when home directories are shared across machines that may not be running the same operating system.

Now I still have a question ----> I find a WiFiClient.h library under both Program Files(x86) and under AppData and they are different, so how does the IDE know which to use? It looks like libraries can be in 3 different file paths, under..... Programs(x86), AppData, and My Documents.

There are actually more than 3. different versions of a library can be in several different places and there is well defined hierarchy as to which version of the library gets picked. The general idea is that it allows things like having a bundled library that may work for all cores that can be overridden by a core version of the library which can be overridden by a version in the users sketchbook.

For the most part it works ok, other than the IDE uses the users sketchbook/libraries area to do its updates for the bundled libraries. THAT is totally messed up and causes LOTS of issues. i.e. an update of a bundled library like say LiquidCrystal will stomp on any locally modified version you might have installed/created in your sketchbook/libraries area. And even if you didn't have your own version, a 3rd party core might have come with its own and a bundled library update will override the core version since the user/sketchbook libraries have higher priority.

I have unsuccessfully tried to get the arduino developers to change this to no avail. It is a bit complicated due to some other desires like not wanting to update IDE installations in place which is directly tied to why the arduino15 directory was used for installing 3rd party cores and program executables - which also has issues.

Basically the way the IDE uses the library manager to update its bundled libraries is totally broken and doesn't really work. It can clobber your own versions of the library and if you are using more than a single core since it can clobber the core specific versions of the library. Some kludges were added to the IDE to try to work around this that help in some cases, but there are still some issues that are simply not solvable until the methodology is changed.

--- bill

Agent Ransak is an excellent search tool to replace windoz search.

https://www.mythicsoft.com/agentransack/download