Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arduino Ethernet library not working with arduino-esp32:3.0.0-rc2 #9630

Closed
1 task done
kkrygiel opened this issue May 14, 2024 · 7 comments · Fixed by #9635
Closed
1 task done

Arduino Ethernet library not working with arduino-esp32:3.0.0-rc2 #9630

kkrygiel opened this issue May 14, 2024 · 7 comments · Fixed by #9635
Labels
Status: Review needed Issue or PR is awaiting review Type: Bug 🐛 All bugs
Milestone

Comments

@kkrygiel
Copy link

Board

ESP32

Device Description

esp32 devkit v1

Hardware Configuration

Custom pcb with ESP32 and ethernet module (wiznet w5500 spi to Ethernet chip).

Version

latest development Release Candidate (RC-X)

IDE Name

Arduino IDE

Operating System

Ubuntu

Flash frequency

80MHz

PSRAM enabled

yes

Upload speed

921600

Description

I have custom pcb with esp32 and ethernet module connected with SPI interface. I use Arduino IDE and Arduino Ethernet library. It is working with esp32:3.0.0-alpha3 but it is not compatible with esp32:3.0.0-rc2. Etherent library uses IPAddress::raw_address function which is private. In previous versions IPAddress defined EthernetClass, DhcpClass and DNSClient as friend. In recent update onlu classes UDP, Client and Server are declared as friends. Because of that change I can't use Arduino Ethernet library. Can You change it back?

Sketch

#include <Ethernet.h>

String x = Ethernet.localIP().toString();

Debug Message

/home/ABC/Arduino/libraries/Ethernet/src/Dns.cpp: In member function 'uint16_t DNSClient::ProcessResponse(uint16_t, IPAddress&)':
/home/ABC/Arduino/libraries/Ethernet/src/Dns.cpp:340:55: error: 'uint8_t* IPAddress::raw_address()' is private within this context
  340 |                         iUdp.read(aAddress.raw_address(), 4);
      |                                   ~~~~~~~~~~~~~~~~~~~~^~
In file included from /home/ABC/.arduino15/packages/esp32/hardware/esp32/3.0.0-rc2/cores/esp32/Arduino.h:196

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@kkrygiel kkrygiel added the Status: Awaiting triage Issue is waiting for triage label May 14, 2024
@me-no-dev
Copy link
Member

What is Ethernet.h? It doers not seem to be from our repository. We have ETH.h

@JAndrassy
Copy link
Contributor

JAndrassy commented May 14, 2024

@me-no-dev "Ethernet library" is always the Arduino Ethernet library for W5500. The 16 years old and still used first Arduino networking library which established the Arduino networking API.
https://www.arduino.cc/reference/en/libraries/ethernet/

My PR #9522 offered a compatibility of ESP32 Ethernet library with the Arduino library API

@me-no-dev
Copy link
Member

If this is not a project that will run on non-ESP MCUs, then using our ETH library is much better offering than any other Ethernet lib. API is not all that different and is tightly integrated into ESPs network stack

@kkrygiel
Copy link
Author

Maybe You can leave those 3 lines with friends declaration so We can use old Ethernet library in case we need support for many MCUs?

@me-no-dev
Copy link
Member

@kkrygiel will add those, but I still recommend you to look into our ethernet implementation for best experience.
@JAndrassy maybe you can think of a header-only wrapper that can be included instead of Ethernet.h for people that would want that backward compatibility (not included by default and not using memory when not included)

@JAndrassy
Copy link
Contributor

JAndrassy commented May 15, 2024

@JAndrassy maybe you can think of a header-only wrapper that can be included instead of Ethernet.h for people that would want that backward compatibility (not included by default and not using memory when not included)

@me-no-dev that was my plan but it required just a little more code than I would put into a header. but the cpp in https://github.com/espressif/arduino-esp32/pull/9522/files is simple

@JAndrassy
Copy link
Contributor

and the main reason for the cpp is the instance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Review needed Issue or PR is awaiting review Type: Bug 🐛 All bugs
Projects
Development

Successfully merging a pull request may close this issue.

4 participants