OneWire Library + ESP32

Hi @pistache351.

Explanation

Some significant changes were made in the recently released version 3.0.0 of the "esp32" boards platform that adds support to Arduino IDE for your ESP32 Dev Module board.

One of those changes caused the new version of the "esp32" platform to be incompatible with the "OneWire" library.

The bug in the "OneWire" library has already been fixed:

However, there hasn't been a release of the "OneWire" library since the time of that fix, so the release version of the library you get from the Arduino IDE Library Manager still contains the bug.

Resolution

For now, the most simple solution will be to use the development version of the "OneWire" library that contains the bug fix.

I'll provide instructions you can follow to do that:

A. Uninstall the release version of the "OneWire" library

  1. Select Sketch > Include Library > Manage Libraries... from the Arduino IDE menus to open the "Library Manager" view in the left side panel.
  2. Type OneWire in the "Filter your search..." field.
  3. Scroll down through the list of libraries until you see the "OneWire" entry.
  4. Hover the mouse pointer over the "OneWire" entry.
  5. You will see a ●●● icon appear near the top right corner of the library entry. Click on that icon.
    A context menu will open.
  6. Select "Remove" from the context menu.
    An "Uninstall" dialog will open.
  7. Click the "YES" button in the "Uninstall" dialog to confirm that you want to uninstall the library.
    The dialog will close.
  8. Wait for the uninstall process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:

    ⓘ Successfully uninstalled library ...

B. Install development version of "OneWire" library

  1. Click the following link to open the library's GitHub repository homepage in your web browser:
    https://github.com/PaulStoffregen/OneWire
  2. Click the "Code ▾" button you see on that page.
  3. Select Download ZIP from the menu.
    A download of the ZIP file of the library will start.
  4. Wait for the download to finish.
  5. Select Sketch > Include library > Add .ZIP Library from the Arduino IDE menus.
    The "Select the zip file containing the library you'd like to add" dialog will open.
  6. Select the downloaded file from the dialog.
  7. Click the "Open" button.
    The dialog will close.
  8. Wait for the installation process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:

    ⓘ Successfully installed library from ...

Now try compiling or uploading your sketch again. Hopefully this time you won't encounter any errors and everything will work as expected.