Go Down

Topic: Ethernet Shield. Communication over the internet. (Read 6209 times) previous topic - next topic


Jun 07, 2010, 11:01 pm Last Edit: Jun 07, 2010, 11:01 pm by KOR Reason: 1
Hi I bougt the magnificent ethernet shield and put the webserver on my arduino. works just fine in my LAN. but I don't know how I can access my arduino over the internet. I think the problem is that I got a router(AVM FritzBox).

I want to built a sensor which gives me weather data over the internet. Where I can get graphs for last month last year etc. The Atmel chip is probably to small to store all this data. So My second question is how would you do it? Store data until its called from a home computer or a server? The best thing bwould be if one could put a flash card in the arduino like 4 gig an be done but I read that you cant use the Memory port and the Ethernet?
or can you switch back and force the whole time?


Jun 07, 2010, 11:13 pm Last Edit: Jun 07, 2010, 11:19 pm by stephen_t Reason: 1
Easier said than done, initially look into the documentation for your router into setting up port forwarding to port 80 and the IP adddress of your ethernet shield on your lan.  Once you've got that far you need to know how to address it from the internet.  If you're lucky enough to have a static IP address from your ISP (unlikely), its just a matter of pointing a browser at that IP address. Otherwise its going the dynamic DNS route with sites like http://www.dyndns.com/  and something on the inside updating the outside so to speak.  Your router is probably the best bet for this.  A complex subject in its own right.

The card slot on the ethernet shield is all but useless.

Heres one I did earlier :  http://majestic81.plus.com/    ;)


Jun 07, 2010, 11:21 pm Last Edit: Jun 07, 2010, 11:24 pm by KOR Reason: 1
the problem is I cant do portforwarding for the arduino on my router. It wont show the arduino as an device. an one can only do portforwarding vor an device. odly I can access the arduino over the lan where the router is the central switch.
Do you mind to release your code


Jun 07, 2010, 11:35 pm Last Edit: Jun 07, 2010, 11:42 pm by stephen_t Reason: 1
The ones I've seen that play with devices usually have a function to add a device usually based on its MAC address, but I'm not familiar with your router.  The arduino code isn't going to help you access it from the internet. My example site very closely resembles the example server in the IDE which I used as a starting point.  Its just got extra bits tagged on.  

Accessing it from the lan is easy, it doesn't involve a router. :)


Sounds like a modern router is in order. I bought a Netgear WGR614 wireless router at Walmart for $40 and it works very well. No issues with port fowarding, sees my connected arduino ethernet shield, and has a feature for updating the dynamic IP services. I'm testing operating a robot via a web page and I use my no-ip.com address in the web page.
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0


I found the option to portforward an ip which has no device and it works just fine :-) and with dyn dns it works perfectly. :-)

Now a new question arises.
Is it possible to make a dynamic html site with the arduino?


Depends on what you mean by dynamic. If you mean that you want the Arduino to serve up a page that shows the current values from several sensors attached to it, then, yes you can.

If you mean a page that lets you play a game, that would be more challenging.

The limit is the amount of memory that the Arduino has to contain the structure of the page. All the strings that define the page (HTML, BODY, TITLE, etc. are stored in memory. Too many of them and you run out of memory.
The art of getting good answers lies in asking good questions.


I mean the changing sensor values.
could you tell me how you put the canging values in a page If done a small html code on my arduino but i need to reload evrytime I want to see a change.


Jun 08, 2010, 04:38 pm Last Edit: Jun 08, 2010, 04:43 pm by cowjam Reason: 1
I wouldn't use the arduino as the web server, I'd use it to pass details to a web site somewhere else.

If you have access to web server running PHP [edit: or ASP] (they're free, you could set one up on your home PC), you can create a web page that gets data from the URL.  If you're passing weather data you might have:
index.php?temp=60 where the value comes from your temp sensor.  The php web page can grab that data (using the GET method).

You web server will far more suited to dealing with the data than your arduino, so you'll be able to feed that into a database and output it as a graph.

As far as I'm aware you need to find the web server by IP address, so might be a bit tricky if you opt to use shared hosting, but if you're using a local host it'll be fine, and you'll be able to forward the port properly.


I would publish the data to Pachube.  It gives you free graphing and you can add triggers.  http://www.pachube.com/


I have accessed my arduino via the local 192.. address. I can also access via the default gateway address. I cannot assign a domain to it tho...i have managed this for a NAS and an IP Cam before.

Any ideas as to what might be different this time?

TCP Port is 80


I can also access via the default gateway address.

Does this mean you can access it from the gateway's internal address (from whatever is acting as your gateway - usually a router) or from out on the internet using the gateway's external IP address ?

Giving it a domain name usually involves either buying a domain, or using one of the ones provided by Dynamic DNS services.  What have you done so far ?.  

Its exactly the same process as setting up any other internal server type device although it doesn't come with setup software from the manufacturer like many NAS and IP cameras do



Thanks I got it working right before I decided to do it the other way around and use the arduino as a client^^

Go Up