arduino / arduino/Arduino

localIP() delivers incorrect IP address; RXIP/RXIN correctly wired ?

Open
#6,013 6 comments 0 reactions 0 assignees View on GitHub
Component: Hardware Library: Ethernet Type: Bug
Dominant language
Java
Stars
14.6k
Forks
7k
PR merge metrics
No merged PRs in 30d

Description

Hi everybody,

I face a similiar problem as @Alienwaren back in 2014 (https://github.com/arduino/Arduino/issues/2168), which I get with the code pasted below. I have a Leonardo ETH.

@PaulStoffregen who found a good solution in 2014 is kindly invited to join the discussion.

The Leonardo ETH also has a SD controller on board, but I have no SD card plugged in.

I set a static IP address on the W5500 Ethernet controller. The returned IP by localIP() is not correct (0.178.178.178), which is stable in one session. It changed a few times on new power ups. When I continue by doing a EthernetClient connect, it fails as could be expected. Setting the controller up by DHCP gives the same behaviour or causes an eternal Ethernet.begin ...

My assumption is that the problem lies in the SPI communication between the ATMega and the ETH controller or in the ETH controller itself (broken ?).

A second issue concerns the Leonardo ETH board schematics (Arduino_Leonardo_Eth_v1_sch.pdf) and the Ethernet Shield 2. Nets 'RXIP' and 'RXIN' are AC-coupled (i.e. by capacitors) to the RJ45 jack, but they seem to be absolutely DC-floating. If there is no DC path, this can affect heavily communication reliability and must be considered a bug !

Thanks for every answer,
Wolfgang - new to Arduino but not new to electronics

```
#include
#include

// MAC address
byte mac[] = { 0x90, 0xA2, 0xDA, 0x10, 0xE4, 0x55 };
// Set the static IP address to use if the DHCP fails to assign
IPAddress ip(192, 168, 0, 9);

void setup() {

pinMode(10, OUTPUT); // make sure the the ETH controller is enabled
digitalWrite(10, LOW);

pinMode(4, OUTPUT); // make sure that the SD card controller is not accidentially outputting on SPI shared with Ethernet
digitalWrite(4, HIGH);
delay(1);

// Start serial logging
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}

Ethernet.begin(mac, ip);
}

void loop()
{
Serial.println(Ethernet.localIP());
delay(1000);
}
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Leonardo ETH example with the W5500, static IP or DHCP, and the SD controller disabled as shown in the issue. Inspect the Ethernet and SPI behavior alongside Arduino_Leonardo_Eth_v1_sch.pdf, focusing on localIP() and the AC-coupled RXIP/RXIN nets; done means identifying the cause of the incorrect address or confirming the schematic concern and documenting a verified result.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
embedded-iot, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.