Warning message about IDE V4.0.0

I'm using IDE 2.3.8 at the moment.
I get a warning message when compiling a progam which uses BT classic.

"
warning: 'BluetoothSerial' is deprecated: BluetoothSerial won't be supported in version 4.0.0 by default [-Wdeprecated-declarations]
48 | BluetoothSerial SerialBT;
"

Googling it, says, the BluetoothSerial.h library is marked as deprecated and won't be included by default in version 4.0.0
Does this warning just mean, when IDE 4.0.0 is released and I try to use it, I'll just have to use library manager and download BluetoothSerial for this program?

Or something more complicated?
When is IDE 4.0.0 due?

Nothing to do with the IDE. Post the Auto Formatted code in a code block and the verbose compile log also in a code block.
Once you do that we can work with it.

What board are you compiling for?

FireBeetle 2 ESP32-E

C:\JRsPrograms\ARD\Sketchbook\ESP32\DogCollar2\FireBeetle_HC12_Rx03\FireBeetle_HC12_Rx03.ino:48:17: warning: 'BluetoothSerial' is deprecated: BluetoothSerial won't be supported in version 4.0.0 by default [-Wdeprecated-declarations]
   48 | BluetoothSerial SerialBT; // Name our instance
      |                 ^~~~~~~~
In file included from C:\JRsPrograms\ARD\Sketchbook\ESP32\DogCollar2\FireBeetle_HC12_Rx03\FireBeetle_HC12_Rx03.ino:33:
C:\Users\jlram\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.8\libraries\BluetoothSerial\src/BluetoothSerial.h:38:88: note: declared here
   38 | class [[deprecated("BluetoothSerial won't be supported in version 4.0.0 by default")]] BluetoothSerial : public Stream {
      |                                                                                        ^~~~~~~~~~~~~~~
Sketch uses 1103724 bytes (84%) of program storage space. Maximum is 1310720 bytes.
Global variables use 42056 bytes (12%) of dynamic memory, leaving 285624 bytes for local variables. Maximum is 327680 bytes.

Is this what was requested?

No, I said all the source code, and all the compile log. What you are showing appears to have worked so what is the problem?

I don't have a problem.

I would just like to know, that when the library is deprecated, what should I do, in order to keep using it?

Or how do I continue to use BT classic?

As long as you don't update your ESP32 core to version 4, all will keep working as before. If you do want to start using core version 4 when it arrives, there is also the option of installing different core versions for your board side by side, but that does require a manual install of both core versions normally. Since IDE 2 tends to pester you to update everything with pop-ups all the time, and if you are really happy with what you have, you could disable the update checker in your preferences.

Thanks for the info.

I agree that IDE 2 pesters you with popups to update too frequently.
I didn't find anything in preferences to adjust it.
I guess it's a new feature in V4 then?

Will there be a V3 ?

I think that you're confusing the IDE version and the version of the (in this case ESP32) board package.

See e.g. IDE 2.0.3 popups - #2 by ptillisch.

To elaborate on what @sterretje wrote, this message is about the decision of the maintainers of the 3rd party "esp32" boards platform to drop support for the "BluetoothSerial" library bundled with that platform in a future release of the "esp32" platform:

This has absolutely nothing to do with Arduino IDE. Arduino IDE just displays whatever messages are produced by compiling the code of the sketch program. The developers of the "esp32" platform chose to configure their code to produce this deprecation message, so Arduino IDE displays that message.

Breaking Changes in Arduino IDE

Arduino IDE development is done with a strong focus on backwards compatibility for user projects. You can load up a sketch project from a decade ago in Arduino IDE 2.x, install the decade old platform and library dependencies that sketch was developed with, and you will be able to compile and upload that sketch without any problems, even though the Arduino IDE 2.x project didn't even exist at that time. I specified "decade ago" because there was a breaking change in the boards platform structure in 2014:

so it is true that you won't be able to use a boards platform from prior to 2014 with the modern Arduino IDE, unless you made some fairly minor modifications to the structure of that platform. However, when it comes to sketches and libraries, the backwards compatibility is much deeper.

There was some breakage of compatibility in the Arduino IDE 1.0.0 release in 2011 (note that Arduino IDE was technically considered to be in a beta development phase before that time). As far as I recall, there wasn't actually any breakage in the Arduino IDE application itself. The breakage was instead the renaming of a file named WProgram.h in the "Arduino AVR Boards" platform. Even though the platform is a distinct component from the Arduino IDE application, it was distributed with the Arduino IDE installation at that time, as this was prior to the decoupling of platform distribution that came with the introduction of the Boards Manager feature. The renamed file was referenced by many libraries, so this did cause breakage. Fortunately the fix was trivial: simply updating the filename in the #include directive of the affected libraries from WProgram.h to the new name Arduino.h.

So you don't need to be concerned that updating the version of Arduino IDE you have installed on your computer is going to break your projects. Any such breakage that did occur would likely be caused by an accidental bug rather than an intentional change. However, the development of individual boards platforms and libraries may be conducted in a manner that is much less conservative in regards to backwards compatibility. I do recommend trying to always keep your platforms and libraries up to date, so that you can benefit from the enhancements and fixes that are introduced through the ongoing development of those projects. However, it is worth checking to see what changes might be introduced by installing an update.

Getting Information About an Update From the Version Number

When a developer follows best practices, you can get an idea of the nature of an update by looking at the change to the version number that would result from performing the update. There is a formal specification for the meaning of version numbers, called SemVer. A SemVer-compliant version number will always have the following essential components:

<major>.<minor>.<patch>

For example: 1.2.3

In the case of a pre-release version, the version number will have the following format:

<major>.<minor>.<patch>-<pre-release identifier>

For example, 1.2.3-rc.1

If a project is maintained in compliance with SemVer, the versioning will provide the following information that is important to a user performing an update:

  • If the update results in a change to the major component of the version number (e.g., 3.3.8 -> 4.0.0), then the update will introduce breaking changes to the API of the software. You should carefully evaluate the impact of such updates on the dependent projects.
  • If the update results in a change to the minor component of the version number (e.g., 3.3.8 -> 3.4.0), then the update will introduce new components to the API of the software, but not change the existing API components. You may want to evaluate whether the newly introduced components could be useful in your projects, but the update is not expected to cause any breakage to dependent projects.
  • If the update results in a change to the patch component of the version number (e.g., 3.3.8 -> 3.3.9), then the update does not introduce any changes to the API of the software. The update may fix bugs or introduce improvements, but is not expected to cause any breakage to dependent projects.
  • If the update introduces a pre-release component to the version number (e.g., 3.3.8 -> 3.3.9-rc.1), then you are switching to an unstable development version of the software that is only intended to be used for beta testing. The information above regarding the primary version number components will still apply regarding the expected impact of the update, but these versions may contain inadvertent changes that have impact other than what is implied by the primary components.

You will note that the "esp32" platform maintainers are planning to make the breaking change of dropping BluetoothSerial library support in the 4.0.0 release of the platform. So the change of the major component of the version number would communicate to you that updating to that version of the platform will introduce such breaking changes.

Thank you for detailed reply.

I totally was confusing the IDE version with ESP32 version.

The warning message was clearly ambiguous. :)

My knowledge on the structure and workings of an IDE are pretty limited unfortunately. Hence the odd questions.

So:-
How do I not 'update to that version of the platform'?
How do I tell what version of the platform is currently installed / being used?
How did that version get installed initially?

Sorry for the dim questions.....
(I had a lot of problems moving to IDE 2.x from 1.8.x. Ultimately, I've retained V1.8 on an earlier laptop and would like to minimise errors in further transitions).

Thanks again.

There are lots of version numbers involved. In the Preferences/Settings, with Show verbose output during compile enabled, you can see at the end all the library versions used; for example

Using library WiFi at version 3.3.4 in folder: /Users/kenb4/Library/Arduino15/packages/esp32/hardware/esp32/3.3.4/libraries/WiFi 
Using library Networking at version 3.3.4 in folder: /Users/kenb4/Library/Arduino15/packages/esp32/hardware/esp32/3.3.4/libraries/Network 
Using library NetworkClientSecure at version 3.3.4 in folder: /Users/kenb4/Library/Arduino15/packages/esp32/hardware/esp32/3.3.4/libraries/NetworkClientSecure 
Using library ArduinoMqttClient at version 0.1.8 in folder: /Users/kenb4/Arduino/libraries/ArduinoMqttClient 
Using library EEPROM at version 3.3.4 in folder: /Users/kenb4/Library/Arduino15/packages/esp32/hardware/esp32/3.3.4/libraries/EEPROM 
Using library ArduinoJson at version 7.0.4 in folder: /Users/kenb4/Arduino/libraries/ArduinoJson 
Using library Preferences at version 3.3.4 in folder: /Users/kenb4/Library/Arduino15/packages/esp32/hardware/esp32/3.3.4/libraries/Preferences 
Using library M5Unified at version 0.2.13 in folder: /Users/kenb4/Arduino/libraries/M5Unified 

A libraries directory is present in (at least) two locations:

  • individually versioned libraries installed by the Library Manager: in your sketchbook directory
  • board-level libraries, all with the same version: in this case, all under Arduino15/packages/esp32; and then a few levels down, the version number is the directory name. On this computer, a few versions back from the latest: 3.3.4

The version of each library is actually declared in a library.properties file in each specified directory, at the root of the library. The versions of the board-level libraries should match the version of the board itself. (Occasionally there's a mismatch by mistake.)

In addition the board's (in this case) 3.3.4/libraries, there's also 3.3.4/cores, which contains the board core with even more versioned code. That code is required for a sketch, while the libraries are optional. Any non-trivial sketch will have some libraries.

The core is also reported at the very beginning of the compile output:

FQBN: esp32:esp32:esp32c6
Using board 'esp32c6' from platform in folder: /Users/kenb4/Library/Arduino15/packages/esp32/hardware/esp32/3.3.4
Using core 'esp32' from platform in folder: /Users/kenb4/Library/Arduino15/packages/esp32/hardware/esp32/3.3.4

That's the Fully Qualified Board Name, here showing it is for an ESP32-C6. And the 3.3.4 version at the very end of those paths.

Hovering over the board name in board/port picker in the toolbar shows the board name and FQBN (and the port). Having the version here would be helpful.

All these versions are managed by the Board Manager and Library Manager, which are the second and third (of five) icons along the left edge of IDE 2.x. You can see the versions installed. The Type of Library can be set to Installed, but the same option is not available for Board (maybe because there aren't as many :person_shrugging: ). There's also the option to show those that are Updatable.

Periodically when the IDE starts, it will offer to update Boards and Libraries with separate notifications in the bottom right corner. Don't approve those, and do updates manually.

Thank you for the detailed info again.

Presently, I see BluetoothSerial.h is available to use without installing a specific library.
So '#include BluetoothSerial.h' works because it is included in:-

"Local\Arduino15\packages\esp32\hardware\esp32\3.3.8\libraries\BluetoothSerial\src\BluetoothSerial.h"

(This is likely also the case for other functions/features?)

When ESP32 v4.0.0 is 'released', how does this manifest itself in my envoironment. What will I be doing that will install it and will the above package not be accessible anymore?

Will the Arduino IDE handle multiple package versions?

The IDE does not support multiple versions of the same library or board. In the respective Manager, you can install another version, and that's the one that is active. Generally, older versions are available forever (presumably whoever offers it can remove any release). This does cause a problem if you want to "pin" certain versions because those are "known good" -- a common software practice. The IDE leans toward "easy to use" instead.

When you [re]start the IDE, it does a check, and you may be prompted with a popup in the lower right of the window: "Updates are available for some of your libraries" and/or "your boards" with the buttons: Later, Install Manually, or Install All. There's also an X in the corner to close the popup, which is the same as Later. Choosing Manually will open the respective Manager, showing all Updatable items.

You can see what's in the board's libraries directory

$ ls ~/Library/Arduino15/packages/esp32/hardware/esp32/3.3.4/libraries/
ArduinoOTA		HTTPClient		SD_MMC
AsyncUDP		HTTPUpdate		SimpleBLE
BLE			HTTPUpdateServer	SPI
BluetoothSerial		Insights		SPIFFS
DNSServer		LittleFS		TFLiteMicro
EEPROM			Matter			Ticker
ESP_I2S			NetBIOS			Update
ESP_NOW			Network			USB
ESP_SR			NetworkClientSecure	WebServer
ESP32			OpenThread		WiFi
ESPmDNS			PPP			WiFiProv
Ethernet		Preferences		Wire
FFat			RainMaker		Zigbee
FS			README.md
Hash			SD

Boards not through installation from the boards manager,
but you can manually install into the sketchbook/hardware folder and versions can live side by side,

Libraries need to be saved under a different name and the files in which they are included need to be modified.

It is included in the currently installed core (the latest 3.3.8) but the developers have plans for the next major version and have decided to deprecate it and replace it with something better. That successor is already available.

It will show up as a pesky popup and you may just click install, but there is a way to disable this popup. The package won't be available anymore, but through the boards manager you can always roll-back to a version of your chosing.

Those IDEs actually work really well side by side, since they will simply share boards installations, library installations if they use the same sketchbook. I prefer 1.8.19 but i have the IDE v2 also installed on the same machine. Since i share the sketchbook location also the manually installed boards are available in both.

See the link in post #10.

This is the approach I would generally recommend. Just because you want to refrain from updating the "esp32" platform doesn't mean you should cursorily reject updates for all software components on your computer. Developers usually have good reasons for making changes to the codebase. When they make a new release, it is because they made some changes they feel are important for the users to have. It is true that sometimes they make releases that contain a bug, or that make highly disruptive changes, but these are rare. More often, a new release represents a real improvement and you will only be harming yourself by refusing it. Even in the case where a release does contain breaking changes, It is often trivial to adjust your code to accommodate it.

After you click the "INSTALL MANUALLY" button in the update notification, you can review each of the updatable items, and click the "UPDATE" button at the bottom of the specific entries you do want to keep up to date.

Even if you do decide that the update notifications are annoying and following the instructions provided earlier in this thread to disable them, I still strongly recommend periodically checking to see what updates are available.