would replacing ide 1.8.2 by 1.8.9 change the libraries?

Well, its all in the subject. Thanks

The answer is "it depends". Some libraries come bundled with the Arduino IDE:

  • Adafruit_Circuit_Playground/
  • Bridge/
  • Esplora/
  • Ethernet/
  • Firmata/
  • GSM/
  • Keyboard/
  • LiquidCrystal/
  • Mouse/
  • Robot_Control/
  • Robot_Motor/
  • RobotIRremote/
  • SD/
  • Servo/
  • SpacebrewYun/
  • Stepper/
  • Temboo/
  • TFT/
  • WiFi/

However, those libraries are also in the Library Manager index so you can use Library Manager to update to a different version. Libraries installed via Library Manager are saved to the libraries subfolder of your sketchbook folder, where they override the libraries bundled with the Arduino IDE. So the question of whether updating the IDE will cause a different version of any of those libraries to be used depends on two things:

  • Is a different version of the library bundled with each IDE version?
  • Have you installed a different version of the library above via Library Manager (or manual installation to the libraries subfolder of your sketchbook)?

The Arduino AVR Boards hardware core is also bundled with the Arduino IDE. Some architecture specific libraries are bundled with Arduino AVR Boards:

  • EEPROM/
  • HID/
  • SoftwareSerial/
  • SPI/
  • Wire/

Those libraries are not in the Library Manager index. However, Boards Manager allows you to update to a different version of Arduino AVR Boards. Boards Manager saves the updated version of Arduino AVR Boards to a special location on your computer, where it overrides the version bundled with the Arduino IDE. So the question of whether updating to a new version of the Arduino IDE will cause a different version of any of those libraries to be used depends on two things:

  • Is a different version of the library bundled with each Arduino AVR Boards version?
  • Have you installed a different version of Arduino AVR Boards via Boards Manager?

Note that the libraries bundled with Arduino AVR Boards are only used when you have one of the Arduino AVR Boards selected from the Tools > Board menu.

Library authors strive for backwards compatibility. Most often, you will find that updating to a new version of a library only brings improvements and bug fixes. It's much more rare that updating to a new version of a library will break something. Although it's good to have an understanding of how the Arduino IDE handles libraries, I think you shouldn't get too worried about updating libraries in advance. If you update and then find there is a problem, then it's time to investigate. Otherwise, don't worry about it.

Thanks Pert for your detailed answer.

I am concerned about the ethernet library. I am using version 1.1.2 of my ide (1.8.2) I guess from your reply that the one that will be installed by ide 1.8.9 (should I install it) is a new one.

Now what I’ll be happy about is to have access to remote ip: If I compile the reference example I get “EthernetClient’ has no member named ‘remoteIP’” and hopefully this would be resolved with the ethernet library of ide 1.8.9 (??)

BUT I also need icmpPing to compile ok as it does now on ethernet 1.1.2 which is why I am somewhat reluctant

guy_c:
I am concerned about the ethernet library. I am using version 1.1.2 of my ide (1.8.2) I guess from your reply that the one that will be installed by ide 1.8.9 (should I install it) is a new one.

Arduino IDE 1.8.9 comes with Ethernet library 2.0.0 bundled. If you wanted to go back to using version 1.1.2 of the Ethernet library, you only need to do this:

  • Sketch > Include Library > Manage Libraries
  • Wait for the download to finish
  • In the "Filter your search..." box, type "ethernet"
  • Press Enter.
  • In the search results, click on "Ethernet built-in by various".
  • From the "Select version" dropdown menu, select 1.1.2.
  • Click the "Install" button.
  • Wait for the installation to finish.
  • Click the "Close" button.

You can use the same steps to install any version of the library you want at any time.

Thank you!

and where will the lib manager install it? in my libraries or in ide's?

Library Manager installs to the libraries subfolder of your sketchbook folder. You can find the location of the sketchbook folder at File > Preferences > Sketchbook location. When multiple copies of a library are installed, the Arduino IDE uses the copy in the libraries subfolder of the sketchbook folder (actually the IDE has more "smarts" about picking the correct library than that, but in this particular case it's how it will work).

your patient help is a rare gift

bottom line: enet 2.0.0 gives client remote IP and refuses ping.

I must be asking too much :confused:

What do you mean by "refuses ping"? Does the sketch not compile, or does it compile, but not work as expected?

pert:
What do you mean by "refuses ping"? Does the sketch not compile, or does it compile, but not work as expected?

pert:
What do you mean by “refuses ping”? Does the sketch not compile, or does it compile, but not work as expected?

does not compile, same as thread pointed at by Juraj

C:\Users\Guy\Google Drive\sync\arduino sw\libraries\icmp_ping\ICMPPing.cpp:219:9: error: ‘class W5100Class’ has no member named ‘read_data’

W5100.read_data(_socket, (uint16_t) buffer, ipHeader, sizeof(ipHeader));[quote author=pert

That's unfortunate.

If you don't want to switch back and forth between the two versions of the Ethernet library all the time, there is the option of bundling a specific version of the Ethernet library with the sketch that requires it. In the case when you have a library like icmp_ping that has a dependency on the Ethernet library, you'd need to bundle that library with the sketch as well and update the #include directives in the library accordingly. It's inconvenient to do this but I don't have another good solution. If that's something you'd be interested in, I can provide more instructions. Of course, that won't solve your problem if you need remoteIP() and the icmp_ping library in the same sketch. It is fairly easy to add the remoteIP() function to the Ethernet 1.1.2 library, but the Ethernet 2.0.0 library has other improvements which would be much more difficult to backport.

I need mostly ping but since some time ago I have strong suspision that a port scanner knocks on my router rj45 plug and sneaks to my arduino server. I believe that client ip could help me make up my mind about this and then take tbd measures.

So, yes, I'd be grateful, again, should you explain how to implement client ip in enet 1.1.2. and ideally on ethernet2 too (my 'field' card uses w5500. We discussed this sometime ago) Hopefully, someone will port Blake's work to new enet libs soon enough

Here's how to add the remoteIP() function to Ethernet library 1.1.2:

Open {sketchbook folder}/libraries/Ethernet/src/EthernetClient.h in a text editor.

Add the following line at line 32:

IPAddress remoteIP();

Save the file.

Open {sketchbook folder}/libraries/Ethernet/src/EthernetClient.cpp in a text editor.

Add the following line at line 178:

IPAddress EthernetClient::remoteIP()
{
  byte remoteIParray[4];
  W5100.readSnDIPR(_sock, remoteIParray);
  return IPAddress(remoteIParray);  return IPAddress(remoteIParray);
}

Save the file.

I followed your instructions and managed to have both ping and rip on both ethernet 1.1.2 and ethernet2 (!)

Thank you Pert, it's very kind of you to devote time helping and sharing your knowledge

I'm glad to hear it worked! I'm always happy to help and share knowledge as I'm able.