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.

  • 1
    Are you using the correct type of cable? Might want to check that first. – Mikael Patel Dec 21 '17 at 12:57
  • @MikaelPatel I'm using a CAT. 5e S/UTP cable. – Julian Schmuckli Dec 21 '17 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 Dec 21 '17 at 13:36
  • I am sure the Ethernet card in computer makes the auto-MDX – Juraj Dec 21 '17 at 15:01
1

use the Ethernet2 library for W5500

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

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