Pages: [1]   Go Down
Author Topic: Accessing google con Arduino Ethernet, those 3 magic numbers  (Read 3276 times)
0 Members and 1 Guest are viewing this topic.
Italy
Offline Offline
Full Member
***
Karma: 0
Posts: 127
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Owen F. Ransen

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 208
Posts: 8855
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Italy
Offline Offline
Full Member
***
Karma: 0
Posts: 127
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Owen F. Ransen

Italy
Offline Offline
Full Member
***
Karma: 0
Posts: 127
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Owen F. Ransen

New River, Arizona
Offline Offline
God Member
*****
Karma: 19
Posts: 936
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Trying to keep my house under control http://www.desert-home.com/

Italy
Offline Offline
Full Member
***
Karma: 0
Posts: 127
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!

Logged

Owen F. Ransen

0
Offline Offline
Tesla Member
***
Karma: 144
Posts: 9613
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Italy
Offline Offline
Full Member
***
Karma: 0
Posts: 127
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Owen F. Ransen

0
Offline Offline
Tesla Member
***
Karma: 144
Posts: 9613
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

edit: modified pix for better representation.

« Last Edit: November 12, 2011, 11:38:28 am by zoomkat » Logged

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

New River, Arizona
Offline Offline
God Member
*****
Karma: 19
Posts: 936
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Trying to keep my house under control http://www.desert-home.com/

0
Offline Offline
Tesla Member
***
Karma: 144
Posts: 9613
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Italy
Offline Offline
Full Member
***
Karma: 0
Posts: 127
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Yes, that is helpful...

Logged

Owen F. Ransen

Pages: [1]   Go Up
Jump to: