warning category '' in library ethernet2

I get this error warning whenever I compile a sketch. I have no includes in the sketch so not sure why the Ethernet2 library is even being added. Any advice appreciated.
Vinny

It means you're using a very outdated version of the the library. I added a category value to that library's metadata 2 years ago. You can update to the latest version of the Ethernet2 library like this:

  • Sketch > Include Library > Manage Libraries...
  • Wait for download to finish
  • In the "Filter your search..." box, type "ethernet2"
  • Click on the Ethernet2 entry
  • Click the "Update" button
  • Wait for update to finish
  • Click "Close"

VinnyThingy:
I have no includes in the sketch so not sure why the Ethernet2 library is even being added.

It's just an annoying thing the Arduino IDE does for no good reason. Every time it scans the libraries it will display warnings for any harmless issue with any of them, regardless of whether your current code actually uses that library. You can ignore it or you can fix it. The only thing the category is used for is to help you search through libraries in Library Manager. It has no effect on your code.

Hi Pert,
Thanks for the reply. I'd assumed that and updated the library - also checked in the library properties file category=Communication
Also made sure no other Ethernet2 libraries anywhere.
I'm really puzzled as sketch just use I/O ports and makes no ref to Ethernet and certainly has no includes.
Any ideas why Ethernet2 Lib is being added and why it seems to think category is equal to "" ?

VinnyThingy:
I'm really puzzled as sketch just use I/O ports and makes no ref to Ethernet and certainly has no includes.
Any ideas why Ethernet2 Lib is being added

I already explained that. It's not being included. That's not a compiler warning. It's from the Arduino IDE. Every time you compile the Arduino IDE scans all your library folders and then prints warnings for any that have problems. It doesn't matter if they're included in your code or not. It just does it for every library.

Unfortunately it doesn't provide a path to the library in the warning so it's really difficult to find where the problem library is located. The only thing we know for sure is that somewhere on your computer there is a library that contains a file named library.properties that has the line:

name=Ethernet2

There is a possibility that if something is wrong with the formatting of that file that the invalid category error could be produced even though it does appear to have a valid category value. I don't know what else I can tell you. You could always just ignore the warning but I know it's very annoying. You could try this:

  • File > Examples > Ethernet2 > AdvancedChatServer
  • Sketch > Show sketch folder
  • Navigate up two folder levels to the root of the library folder.
  • Open the file library.properties and check if the category value is set correctly

Chances are the above will just turn up the same library you already checked but it's also possible it could find the problematic library so worth a try.

Thanks for taking the time and sorry for misunderstanding your first explanation.

Used DOS search for Ethernet2 and found the culprit in
AppData\Local\VirtualStore\Program Files (x86)\Arduino\libraries\Ethernet2\

Now added the necessary line and the annoying message has gone !

I'm quite new to Arduino and it seems a little strange you update libraries but old ones hang around and still get examined !

Again, thanks for taking the time to assist.

Glad to hear you found the culprit!
it seems a little strange you update libraries but old ones hang around and still get examined !
[/quote]
That is the case with the libraries that come bundled with the Arduino IDE but the Ethernet2 library is not one of those (unless you're using the old 1.7.x arduino.org IDE, which I don't think had the invalid library warning). So I'm not sure how Ethernet2 ended up in AppData\Local\VirtualStore\Program Files (x86)\Arduino\libraries\Ethernet2. You should always install libraries to the libraries subfolder of your sketchbook folder (location shown/set at File > Preferences > Sketchbook location). If you install the library there it should be replaced when you update to a different version. It's also a bad idea to install things to the Arduino IDE installation folder (I'm assuming that's what AppData\Local\VirtualStore\Program Files (x86)\Arduino\libraries is) because everything in that folder will be lost when you update to a new version of the Arduino IDE.