I'm using an Arduino Ethernet which I want to send emails from. But before I get that far I'd like to get the connect to google example going, which I found here in the rreference: ClientConstructor.html
The three magic numbers are:
byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x6A, 0xC7 }; // from the sticker on the back of the board
byte ip[] = {62,123,180,214}; // Hmm, is this right?
byte server[] = { 64, 233, 187, 99 }; // Google
The ip is the ip of my router. Is that the correct thing to put there? I know it is of my router because I get to the config of the router via that address , or via the local version of it (192.168.1.1)
But the client fails to connect. I think that either my magic numbers are wrong or I need to configure my router to accept the arduino link, or...?
Your board needs an IP address in your local network, not the router's address on the external network. The router will typically provide IP addresses with DHCP (Dynamic Host Control Protocol). In the router settings you can probably assign a fixed IP address to the MAC address of your Arduino board so the router knows not to hand that address out to a DHCP client.
Of course within minutes of posting the question I found the answer:
I got two of the three numbers wrong! Here are the corrections:
byte ip[] = {192,168,1,101}; // Where I want to place the Arduino within my own Lan. Guessed number
byte server[] = {66,102,13,103} ; // Google IP found at http://www.dnsstuff.com
And this allows me to get a web page back from google.
This brings up an interesting point, has anyone come across a web site that actually explains this kind of thing without a heck of a lot of jargon that will confuse the newbies to internet addressing? I haven't. They all seem to get into it way too far right off the bat and don't help the newcomer much.
If we run across one, we can point people to it to help them understand stuff like DHCP and home router addresses.
draythomp:
This brings up an interesting point, has anyone come across a web site that actually explains this kind of thing without a heck of a lot of jargon that will confuse the newbies to internet addressing? I haven't. They all seem to get into it way too far right off the bat and don't help the newcomer much.
I think many people want to send emails from their Arduion via their "domestric" router and are probably fumbling around like I am. If I ever get it to work I'll post the details!
One of the problems newbies have is that the DSL modem and the router are the same device. We talk about them like their different things, and they could well be, but a lot of folk look around and only see one little thingie with a phone in, an antenna, and four plugs for other stuff. Add to that the self installing software that doesn't tell them anything to brag about and they get lost easily.
I don't have a solution, I'm just looking for one.