Being new to this I have to ask about step 0 in connecting the arduino ehternet shield to the internet. I don't know how to find the gateway, mac or IP addresses for the device. I was planning on plugging it right into the spare port on the cable modem in our house. Does each port have an IP address (There are four) and if so can I move my computer over 1 port and find the ip address?
How do I get the other addresses? The mac and Gateway
No, the ports on the back of network devices don't have their own IP address. (in almost every case, I have met programmed switches that use different IP address ranges on each switch port). Its very little to do with the arduino and a lot to do with what you're calling the cable modem (with 4 ports its more likely to be a router), and your ISP. You can get a lot of clues from the computer already connected. Usually the MAC address isn't important - USUALLY but not always.
If its windows, running ipconfig from the command line will tell you a lot of what you want to know.
It also makes a big difference if you're getting the the arduino to read and write to the internet or you want the internet to be able to reach the arduino.
Hi there. To some extent, it depands on your network setup.
You can just leave the mac as it is in the example sketches.
The gateway is the IP of your router. Are you on Windows?
The IP you assign the arduino depends on what range of addresses your router assigns devices.
If you tell me what version of windows you have, and how your PC is connected to the router, i.e. wireless or ethernet, I'll tell you how to find the IP's you need.
In the mean time, give the DCHP example sketch a go. You don't have to give it any IP's to set it up. They're assigned automatically by your router. Chances are that your router is using DCHP if your not to sure about gateways, IP's, etc.
Hmm. A bit confused here. You saying the DCHP example isn't part of the standard library? I thought it was. God knows where I got that from then 'cos it's different to the library you pointed out. :-?
On another point, I wasn't able to get the standard library to work at all, but with this library it works no problem. Woo hoo. So happy. ;D
So, thanks for the heads up on that, and to psppb, ditch the standard library and give the one pluggy pointed out a go, it will automatically setup all your network variables.
Being new to this I have to ask about step 0 in connecting the arduino ehternet shield to the internet. I don't know how to find the gateway, mac or IP addresses for the device.
Assuming you have a router, it has the gateway IP address, usually something like 192.168.0.1. You assign the mac address and IP address to the ethernet shield in the code uou upload to the arduino. It will look something like below.
#include <WString.h>
#include <Ethernet.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
byte ip[] = { 192, 168, 1, 102 }; // ip in lan
byte gateway[] = { 192, 168, 1, 1 }; // internet access via router
byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
Server server(84); //server port
Hmm. A bit confused here. You saying the DCHP example isn't part of the standard library? I thought it was. God knows where I got that from then 'cos it's different to the library you pointed out.
Don't worry about it, if your memory is anything like mine, you forget what's standard because when you add a library it integrates seamlessly.
The standard IDE (0018) has 3 ethernet examples : Chatserver, Webclient and Webserver, all of which are manual setup. I never bothered with DHCP because I managed a large network in an earlier life.
Way off topic, Fife was one of my stamping grounds in another Earlier life I did a stint at Rosyth with HM navy, long time ago, I still miss haggis suppers from the local emporium.......