Go Down

Topic: [Solved] IP address oddity with Ethernet shield (Read 824 times) previous topic - next topic

rwiens

Feb 01, 2013, 02:23 pm Last Edit: Feb 13, 2013, 08:38 pm by rwiens Reason: 1
I am running the example WebServer sketch with my shield and setting the IP address to 192.168.1.122  manually (no DHCP), with the shield plugged into the port on my laptop and ICS enabled.  When I run an ipconfig on the laptop, it gives the IP address of that network adapter as something else.  When I try to ping the shield (at the .122 address or the one from ipconfig) I get a timeout.

The shield seems to be doing tx/rx (is there documentation about what all those lights mean?) and if you look at the properties on the connection there are bytes sent and received.

As you may be able to tell, I know just enough about networking to be dangerous but not enough to know how to troubleshoot this.  Any advice or guidance on a good thread on the subject would be appreciated.

PaulS

Quote
with the shield plugged into the port on my laptop

I'll bite. Why? If the Arduino is to be tethered to the laptop, a USB cable is far cheaper, and data transfer is far faster.

If the Arduino with Ethernet shield is connected to a router, then it makes sense for the Arduino to be wearing one.

rwiens

For clarification, the Arduino IS connected to the laptop via USB (for serial communication).  The shield is connected to the laptop via Ethernet (and sharing the wireless connection of the laptop to the router...or so is the intention), simply because I don't want to do my development in the cold, dark basement where the router is!

I suspect it has to do with the Internet Connection Sharing, so my first test will be to plug the shield directly into the router and see if that works.

My guess would be that you're not using the right kind of network lead to connect the Arduino directly to the Network port on your laptop. You would need a "cross-over" lead: http://en.wikipedia.org/wiki/Ethernet_crossover_cable

Nick Gammon

I would agree with vincentmckenzie. Try plugging the Arduino in your router (or switch), not the laptop.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

WOW! There's a name from the past! I registered Mush Client in the 90s because it was by far the best client out there.

Nick Gammon

Still is! :)

Only joking. There are lots of clients these days.

Still, thanks for saying that.

I did a small Adventure game on an Arduino a couple of years ago (still a work in progress) ...

Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

rwiens

Is your game based on something else?  I have a vague recollection of a very early PC game that had swirling mists and you had to make pretty basic choices like which direction to go out of a room.

On the cross-over cable topic, I have read that Macs are smart enough to take care of this internally but perhaps no such luck with PCs...I do have something I think is a crossover and it didn't seem to work either but I will try again.

I did discover that with ICS, it appears that the Ethernet port gets assigned a fixed static IP address.  I will have to change the Arduino code to reflect that and see if it works.

SurferTim

If you enabled ICS on a Windows machine, the ethernet port normally gets 192.168.0.1. You should use something like this on the Arduino:
ip = 192.168.0.2
subnet = 255.255.255.0
gateway = 192.168.0.1

The dns server may require some playing to figure what to use for that. I use my ISP's dns server ip.

rwiens

SurferTim that worked like a charm.  I only tried the server configuration so I didn't need any DNS monkeying but at least I know where to start.  Thanks.

Nick Gammon


Is your game based on something else?  I have a vague recollection of a very early PC game that had swirling mists and you had to make pretty basic choices like which direction to go out of a room.


The Original Adventure by Crowther and Woods, was the inspiration for the idea.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Go Up