Go Down

Topic: Accessing google con Arduino Ethernet, those 3 magic numbers (Read 3 times) previous topic - next topic

ofransen

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:
Code: [Select]

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...?

Owen F. Ransen

johnwasser

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.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

ofransen

Of course within minutes of posting the question I found the answer:

I got two of the three numbers wrong! Here are the corrections:
Code: [Select]

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.

Owen F. Ransen

ofransen


Your board needs an IP address in your local network, not the router's address on the external network....


I've understood maybe 25% of your reply, but that is better than the 1% I would have understood a week ago! Many thanks!

I guessed my local router's free IP address and it worked, I'll eventually be able to do this properly if I persist I hope...

Owen F. Ransen

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.

If we run across one, we can point people to it to help them understand stuff like DHCP and home router addresses. 
Trying to keep my house under control http://www.desert-home.com/

ofransen


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!

Owen F. Ransen

zoomkat

There are lots of lan/wan router diagrams on the net that show the various setups.
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

ofransen


There are lots of lan/wan router diagrams on the net that show the various setups.


You're probably right, but putting it all together with the Arduino hardware and software is not exactly a snap for beginners.

Owen F. Ransen

zoomkat

#8
Nov 12, 2011, 05:08 pm Last Edit: Nov 12, 2011, 05:38 pm by zoomkat Reason: 1
Diagrams like this one are useful for getting the big picture.

edit: modified pix for better representation.

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

draythomp

That's a darn fine picture zoomkat.  Is it yours? 

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.
Trying to keep my house under control http://www.desert-home.com/

zoomkat

Quote
That's a darn fine picture zoomkat.  Is it yours?


No, I appropriated it from the net and corrected an inaccurate part of it.
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

ofransen


Diagrams like this one are useful for getting the big picture.


Yes, that is helpful...

Owen F. Ransen

Go Up