Readback of Ethernet.localIP() is not the assigned address which the board is using

////////////////// USER CONFIGURATION /////////////////////////////
#define USE_DHCP 0                              // set to 1 for DHCP
IPAddress industruino_ip (192, 168, 0, 177);    // example
//#define TCP_SERVER ""
#define TCP_SERVER ""
#define TCP_SERVER_PORT 80                     // for http


  } else {        // static IP
    SerialUSB.print("My IP: ");
    Ethernet.begin(mac, industruino_ip);
  SerialUSB.print("Ethernet started with above MAC and IP: ");
  lcd.setCursor(0, 3);
  lcd.print("IP ");


7:33:22.710 -> [2.13] Reading MAC from RTC EEPROM: 0:4:A3:B:0:4D:91:E8
17:33:22.710 -> Extracted 6-byte MAC address: 0:4:A3:4D:91:E8
17:33:22.747 -> [2.15] Ethernet module found
17:33:24.744 -> My IP:
17:33:25.753 -> [5.16] Ethernet started with above MAC and IP:
17:33:25.753 -> [5.17] END OF SETUP
17:33:25.753 ->
17:33:25.753 -> [5.17] connecting to server on port 80... [5.19] failed to connect, restarting Ethernet
17:33:26.792 ->

Examination on the server side with wireshark shows that it is trying to connect from the correct IP

Why is it returning that multicast address as its local IP address, and how to fix?





| 0 0 0
Asked on 11/25/19, 11:05 PM

hi, i can't think of a specific reason why you are seeing that, but just to double check: are you using the Industruino version of the Ethernet2 library as in and do you see any reason why the connection is eventually failing? i mean, you have an http server running on that ip?

on 11/25/19, 11:40 PM

are you using the Industruino version of the Ethernet2 library as in

Tom's tip solved my problems, though never figured out what the issue was.  It was not the SPI speed, I fixed that by hand according to the instructions and so initializing the Ethernet had already been working (I could ping the unit from a laptop).  It was something more mysterious/subtle preventing connections from working. 

Nevertheless, junking Ethernet2 in favor of Industruino's Ethernet2-master fixed everything.  Both IndustruinoEthernetClient and WebServer example sketches compile and run using the correct library.  Neither was working with merely the Ethernet2 library having SPI set correctly.



| 0 0 0
Answered on 11/26/19, 3:29 PM

Your answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Ask a Question

Keep Informed

About This Forum

This community is for professionals and enthusiasts of our products and services.

Read Guidelines

Question tools

58 follower(s)


Asked: 11/25/19, 11:05 PM
Seen: 44 times
Last updated: 11/26/19, 3:29 PM