I'm looking for some very basic tutorials on using the ethernet shield.... most tutorials seem to be complex.. :-/
Any good suggestions?
Cheers,
Pracas
I'm looking for some very basic tutorials on using the ethernet shield.... most tutorials seem to be complex.. :-/
Any good suggestions?
Cheers,
Pracas
The reason is that Ethernet and network protocols are not simple.
The examples in the IDE are about as simple as it gets, have you worked through those ?
Well i'm lost in the worlds of DHCP and DNS... and how the whole thing works... i can understand the code but somehow not very clear on how it all goes together... perhaps someone can explain in a few lines...
:-/
pracas
of Resolved... i found this thread...
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1236113841/5#5
I think the most important & difficult part of the ethernet shield configuration is the IP address which, as per "tutorial", "depends on network configuration"... which does not explain anything!
Unfortunately I can give explanations only for Windows environment.
Go to START button and click on RUN menu item (start -> esegui on Italian version)
Type CMD and press ENTER
Type IPCONFIG and press ENTER (for Windows XP)
You'll get several numbers "to experiment with".
In my case, first group of numbers contained informations I needed:
Suffisso DNS specifico per connessione: miarete
Indirizzo IP. . . . . . . . . . . . . : 192.168.0.7
Subnet mask . . . . . . . . . . . . . : 255.255.255.0
Gateway predefinito . . . . . . . . . : 192.168.0.1
Third line "reveals" you're only allowed to specify last number of the IP address on your network (the "0" means this).
Second line contains local IP of my PC: it "reveals" the pattern of ALL devices connected to my network: 192.168.0.xxx : "192.168" is standard for local networks (don't ask me why); "0" is fixed due to the "255" in the subnet mask in 3rd line; "7" identify my PC.
This means that I must assign to my arduino a number like 192.168.0.111, i.e. choosing a "random" final number. Actually it's not exactly random, as some of the 256 numbers (from 0 to 255) are already assigned: "7" is my PC, another would be my router, and so on.
If you choose a not available number, you won't just be able to connect to the arduino, with no harm for your devices: just try another number.
About MAC address: as far as I know, each device in the world must have a different MAC address (?), usually hard-coded in its circuitry; on ethernet shield you can define it as you like, but to prevent possibile conflicts with other devices, you should use the MAC address specified on the sticker you found attached to your ethernet shield (if any).
Again, if you specify an already-used number, board will not work.
To know which MAC addresses are used by your devices, add "/all" option to IPCONFIG command used before:
ipconfig /all
Once your ethernet board is properly configured, you must properly configure your router, in such a way your board will be visible from outside your local network (i.e. from internet): you'll have to specify in the "proper" section of your router configuration pages (on my Sitecom there is a "Virtual Server" tab to be clicked) the configuration of your ethernet board: IP address and port.
You must usually specify two ports: "local" and "public":
Local port is the one you specify in your sketch, which the board uses to communicate with any device attached to it; as the board is not directly attached to internet but to a router, this port will not be directly visible on internet: internet surfers will only see your router, which performs "ports redirection"; this means that you can specify which ports the surfers must use to connect to the actual port of ethernet board.
As web browsers always use port 80, you'll have to specify "80" as public port number; but local port specified in your sketch with Server server(80); statement can be the one you prefer: just remember that what you write in this line must be the same you write as "local port number" on your router configuration.