Go Down

Topic: Ethernet Shield Not Printing DHCP Address (Read 2932 times) previous topic - next topic

husnalraikumar

Apr 24, 2013, 07:31 pm Last Edit: Apr 24, 2013, 07:53 pm by husnalraikumar Reason: 1
Hi,

I am trying to create a webserver using an Arduino Ethernet shield and Arduino Mega 2560. I am using the example code to print DHCP address.
I have changed the MAC address. when i run the code it doesn't provides me with any IP address in the serial monitor.
Can any please help me with this.

thank you

SurferTim

Does it timeout after 2 minutes? It should display an error message.

First thing I do is check the SPI connection. Here is a link to the sketch code.
http://arduino.cc/forum/index.php/topic,156082.msg1169948.html#msg1169948
Does it display 192.168.2.2? Or 0.0.0.0?

husnalraikumar

#2
Apr 24, 2013, 08:56 pm Last Edit: Apr 24, 2013, 09:28 pm by husnalraikumar Reason: 1
Hi SurferTim,

Thank you for the fast response. So i tried your code and it printed 192.168.2.2. So after doing that i uploaded the example code "DHCP Address printer"
Still no address ...
But if i remove the SD Card.. and run the code (DHCP Address printer).. then it prints the address

Thank you

SurferTim

This is the line of code in the SPI test sketch that makes it work with the SD card in the slot.
Code: [Select]
  // disable SD card if one in the slot
  pinMode(4,OUTPUT);
  digitalWrite(4,HIGH);

You can add that to your setup() until you are ready to use it.

husnalraikumar

Awesome SurferTim
Thank you so much...
It is working now. 

shivaprasad

i had burned  this  library software but im not getting ip adress  in ardunio uno

SurferTim

@shivaprasad: You didn't post enough information. Which ethernet shield/module are you using? Does it have a w5100, w5500, or ENC28J60 IC?

Rishi_me

#7
Jul 07, 2017, 02:00 am Last Edit: Jul 07, 2017, 02:23 am by Rishi_me
Hi there! I'm using Arduino Ethernet Shield-2 (W5500) with Arduino Mega 2560. I have the same issue with SPI connection and tried your code posted above. The serial monitor returns
Starting W5500
0.11.11.11

Checked the ICSP connection for loose contact. Although, after holding both the shields together firmly I didn't get the IP address.

Ethernet cables connected to the shield are brand new and I can see Green and Orange lights.

How can I make this Ethernet Shield work?

Answer: Sorry. I just found out that for Arduino Ethernet Shield-2 (W5500) we need to use Ethernet2.h
This fixed my issue.

Tamilselvan8621

@shivaprasad: You didn't post enough information. Which ethernet shield/module are you using? Does it have a w5100, w5500, or ENC28J60 IC?
I have a w5100 IC and I checked for the loose connection of ICSP. There is no loosely connection but still I am not getting my ip address if I upload the sketch to my board. I tried with both wiznet and ethernet2.h library but still in vain. It would be useful if you help me @SurferTim

SurferTim

Do you have a SD card in the shield's slot? If you are using a w5100, do not use the Ethernet2 library. That is for the w5500. Use the standard ethernet library included weith the IDE.

Tamilselvan8621

Do you have a SD card in the shield's slot? If you are using a w5100, do not use the Ethernet2 library. That is for the w5500. Use the standard ethernet library included weith the IDE.

No sir @SurferTim,  I don't SD card in slot and I'll give a try to standard ethernet library and I post the results soon and thank you for the reply @SurferTim

Tamilselvan8621

Do you have a SD card in the shield's slot? If you are using a w5100, do not use the Ethernet2 library. That is for the w5500. Use the standard ethernet library included weith the IDE.

@SurferTim sir, very sorry for my late reply
Actually I am a beginner..... So I don't know how to use the arduino forum to see my posts......

Yes sir, I used the standard library "dhcpaddressprinter"from the reference section of arduino as you said. In serial monitor it displays "failed to configure using Dhcp"
Is there any solution to fix it?

Go Up