0

Maybe a silly question, because it is a usual topic, but I have a problem with my Arduino Leonardo ETH.

I want to create a web server on the Arduino with the example sketch File > Examples > Ethernet > WebServer. I plugged in the ethernet cable directly to my laptop. So there is no router or switch between them.

I also set the configuration to my ethernet port to the following IPv4 properties: Properties of internet protocol version 4

Then in the example sketch, I changed the MAC address according to the bottom sticker of my Arduino.

byte mac[] = {0x90, 0xA2, 0xDA, 0x11, 0x33, 0xD6};
IPAddress ip(192, 168, 1, 177);

Now when I compile and upload the sketch to the Arduino, everything is working fine until it prints the IP address. According to the IP address which I have set in the code (192.186.1.177), it shows me 0.46.46.46 as you can see in the picture:

Serial Monitor output

This happens when I print that:

Serial.println("server is at ");
Serial.println(Ethernet.localIP());

Do you have any ideas how I could fix this? And why does it show me that invalid IP address?

Thank you in advance.

4
  • 1
    Are you using the correct type of cable? Might want to check that first. Commented Dec 21, 2017 at 12:57
  • @MikaelPatel I'm using a CAT. 5e S/UTP cable.
    – Julian
    Commented Dec 21, 2017 at 13:02
  • 1
    The Leonardo ETH has the W5500 Ethernet controller, which doesn't do auto-MDIX so you will need to use a crossover cable.
    – per1234
    Commented Dec 21, 2017 at 13:36
  • I am sure the Ethernet card in computer makes the auto-MDX
    – Juraj
    Commented Dec 21, 2017 at 15:01

1 Answer 1

1

use the Ethernet2 library for W5500

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.