Go Down

Topic: setting up ethernet shield (Read 10510 times) previous topic - next topic



i am a noob when it comes to networking or adruino, i have a arduino mega2560 and a ethernet sheild. the ethernet shield is plugged into the arduino board. i have tried to set the ip address of the board and think it has worked using this code.
#include <SPI.h>

#include <Ethernet.h>

// the media access control (ethernet hardware) address for the shield:
byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x28, 0x67 };  
//the IP address for the shield:
byte ip[] = {172, 18, 5, 52 };    

void setup()
 Ethernet.begin(mac, ip);

void loop () {}

so the question is i want to check it responds when plugged into my computer, its running windows xp. so to do this i thought i would open up telnet and see if it sees it. the first line i type is ping but nothing happens. please could someone explain to me how i set the ip address and once i do that how do i get a response when connecting directly to my pc via either a cross over cable or ethernet cable. my knowledge is very limited so please explain everything thanks so much


What operating system are you using? If you are using Windows, use ipconfig to determine the IP address of your PC. What is it?

Does the ethernet shield really have an IP address that starts with 172?
The art of getting good answers lies in asking good questions.


im using xp , the ip address of the computer is, and its a works computer. in the end i want the arduino hooked into the works network so that it can send a email internally but i have no clue on this. i have been told a free available ip address within my company is so thats why i put that into the ethernet shield. any information on what i need to do will be appriacted. i have the email and all info of the receiver e.g their ip address plus other stuff that might be needed for security


in telnet it comes up with this when i type telnet if that helps
microsoft telnet> Telnet
invalid command. type ?/help for help

if this is of any help


Does the ethernet shield have any lights? If so, do any of them blink when you try to ping the server?
The art of getting good answers lies in asking good questions.


yer i tried to ping but when i do it says desination host unreachable




i tried to ping but when i do it says desination host unreachable

Time to talk to your network admins, then. The message is saying that the ping packet is not destined for a host that the packet can find a path to.

If the problem were on the Arduino end, the packet would be delivered, but no response would be received (which will happen because your Arduino isn't responding to requests now).

There are examples of the Arduino acting as a server. You should modify one of them, and put your network data in it, and upload that for testing.
The art of getting good answers lies in asking good questions.


If you are directly connecting the ethernet shield into an ethernet connection on a windows xp pc, you will probably need to set up internet connection sharing (ICS) and use a crossover ethernet cable.
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0


ok so i tried last night with putting a webserver example and just putting in my details i wanted e.g. the mac address and ip address. it ping fine last night but now i try it and it still says destination unknown. any help will help thanks


ok i found out why it wasnt pinging it was because when my computer was attached to the company network the ip started with 172. but when discontected then connected to the arduino ethernet shield it was 169.xx so when i set the ethernet shield up i was setting with the 172 and the computer was at 169. thats the reason i think so i set the ip address of arduino to the same as the computer but just changed the last number by ten and now it pings and works fine.

ok so this now leads on to my next question how do i get the arduino to automatically do this http://exchange.mvps.org/smtp_frames.htm . and is it possible for it to do this

Go Up