Skip to content

Library won't compile due to breaking change in Ethernet library API #49

Closed
@per1234

Description

@per1234

Describe the problem

This library calls the no parameters overload of the "Arduino Mbed OS Portenta Boards" platform's bundled "Ethernet" library's arduino::EthernetClass constructor:

arduino::EthernetClass Ethernet;

That overload was removed in the 4.1.5 release of the "Arduino Mbed OS Portenta Boards" platform (arduino/ArduinoCore-mbed#901).

🐛 Compilation of the library fails:

https://github.com/arduino-libraries/Arduino_PortentaBreakout/actions/runs/9914256837/job/27392985691#step:3:171

  /home/runner/Arduino/libraries/Arduino_PortentaBreakout/src/Arduino_PortentaBreakout.h: In constructor 'BreakoutCarrierClass::BreakoutCarrierClass()':
  /home/runner/Arduino/libraries/Arduino_PortentaBreakout/src/Arduino_PortentaBreakout.h:266:38: error: no matching function for call to 'arduino::EthernetClass::EthernetClass()'
                                RTClock()
                                        ^
  In file included from /home/runner/Arduino/libraries/Arduino_PortentaBreakout/src/Arduino_PortentaBreakout.h:36:0,
                   from /home/runner/work/Arduino_PortentaBreakout/Arduino_PortentaBreakout/examples/BreakoutRTCGet/BreakoutRTCGet.ino:13:
  /home/runner/.arduino15/packages/arduino/hardware/mbed_portenta/4.1.5/libraries/Ethernet/src/Ethernet.h:56:3: note: candidate: arduino::EthernetClass::EthernetClass(EthernetInterface*)
     EthernetClass(EthernetInterface *_if)
     ^~~~~~~~~~~~~
  /home/runner/.arduino15/packages/arduino/hardware/mbed_portenta/4.1.5/libraries/Ethernet/src/Ethernet.h:56:3: note:   candidate expects 1 argument, 0 provided
  /home/runner/.arduino15/packages/arduino/hardware/mbed_portenta/4.1.5/libraries/Ethernet/src/Ethernet.h:53:7: note: candidate: arduino::EthernetClass::EthernetClass(const arduino::EthernetClass&)
   class EthernetClass : public MbedSocketClass {
         ^~~~~~~~~~~~~
  /home/runner/.arduino15/packages/arduino/hardware/mbed_portenta/4.1.5/libraries/Ethernet/src/Ethernet.h:53:7: note:   candidate expects 1 argument, 0 provided
  /home/runner/.arduino15/packages/arduino/hardware/mbed_portenta/4.1.5/libraries/Ethernet/src/Ethernet.h:53:7: note: candidate: arduino::EthernetClass::EthernetClass(arduino::EthernetClass&&)
  /home/runner/.arduino15/packages/arduino/hardware/mbed_portenta/4.1.5/libraries/Ethernet/src/Ethernet.h:53:7: note:   candidate expects 1 argument, 0 provided

To reproduce

  1. Install version 4.1.5 of the "Arduino Mbed OS Portenta Boards" platform.
  2. Compile any sketch that uses the library for the Portenta H7 board:
    #include <Arduino_PortentaBreakout.h>
    void setup() {}
    void loop() {}

🐛 Compilation fails with a "no matching function for call to 'arduino::EthernetClass::EthernetClass()'" error.

Expected behavior

Library is compatible with the latest version of the "Arduino Mbed OS Portenta Boards" platform.

Library version

80389c0

Additional context

Originally reported at https://forum.arduino.cc/t/portenta-h7-compilling-error/1280883

Workaround

Use the last compatible version (4.1.3) of the "Arduino Mbed OS Portenta Boards" platform:

  1. Select Tools > Board > Boards Manager... from the Arduino IDE menus to open the "Boards Manager" view in the left side panel.
  2. Scroll down through the list of boards platforms until you see the "Arduino Mbed OS Portenta Boards" entry.
  3. Select "4.1.3" from the drop-down menu in the "Arduino Mbed OS Portenta Boards" entry.
  4. Click the "INSTALL" button at the bottom of the entry.
  5. Wait for the installation process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:

    Successfully installed platform ...

Arduino IDE will occasionally notify you that a new version of the boards platform is available, you'll need to refrain from accepting the offer that will cause an update back to the problematic version of the platform. If you find these notifications annoying, you can disable them via the advanced settings.

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

  1. Press the Ctrl+Shift+P keyboard shortcut (Command+Shift+P for macOS users) to open the "Command Palette".
    A menu will appear on the editor toolbar:
    Image
  2. Select the "Preferences: Open Settings (UI)" command from the menu.
    You can scroll down through the list of commands to find it or type the name in the field.
    A "Preferences" tab will open in the Arduino IDE main panel.
  3. Type arduino.checkForUpdates in the "Search Settings" field of the "Preferences" tab.
  4. Uncheck the box under the "Arduino: Check For Updates" setting.
  5. Close the Preferences tab by clicking its X icon.

If you disable the automatic update check, make sure to periodically do a manual check for newer versions of Arduino IDE and your installed boards platforms and libraries. You can check for new versions of Arduino IDE by selecting Help > Check for Arduino IDE Updates from the Arduino IDE menus. You can check for new versions of boards platforms and libraries by selecting "Updatable" from the "Type" menu in the Boards Manager and Library Manager views.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions