Go Down

Topic: home automation from outside local ip using ethernet shield (Read 949 times) previous topic - next topic


Nov 27, 2015, 10:12 pm Last Edit: Nov 27, 2015, 10:14 pm by mathematica_inc
i have been able to control LEDs over local ip using my ethernet shield. but now i want to control leds outside my network, that is from a website from anywhere around the world.

my idea is to upload a website (with buttons to control the leds ) to a free subdomain which i have already registered in my name. then use this website to control my arduino. but what do i have to change in my code.

what replaces the ip and mac and how do i link this website in my code. please anyone help. thanks in advance.  and also in this case do i need to use the sd card ???

previouslyi used this tutorial



but what do i have to change in my code.
You would use a full URL to your arduino server like below. If you don't have a static IP address, you can use one of the dynamic IP address services like http://www.noip.com

Code: [Select]
<a href="http://zoomkat.no-ip.org/cgi/ZK2PTB.bat?03&229">DN</a></li>
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


You will also need to find out if your router can be configured to allow connections from the internet to devices on your local network- this might be called something like "port forwarding".

If you can configure your router this way you can use the method suggested by zoomcat- no need for an additional website.

If not then your arduino will have to poll the external website you set up to download its instructions- eg it will be a http client rather than a http server. In this case you will most likely have a page written in PHP or some other web scripting language which implements your controls then another plain text page (updated by the first page) which has simple instructions for your arduino to download.



I have a dynamic ip address and i control a 13amp socket outlet via WAN. The easiest and cheapest solution is to use port forwarding. Find out your ip address via Google, just type in 'my ip'. make a note of this ip because this is what you will type into a  browser when you are outside of your own network. Then in your router settings (usually in firewall rules ) you will need to add Arduino's local ip address and port its using (usually port 80) into 'inbound services rules', once you have added this rule you should be good to go. So to access from outside your network you would type in your ip address and the port Aurduino is on .i.e When your dynamic ip as changes all you need to do is make a note of the new ip address and put 80 in front of it. My ip address changes every 21 days which is not to much on an inconvenience.

Just has a side note, i have also created a rule in my routers setting to give my Arduino a set ip address everytime it connects to it. Unless you have set a ip address in your Arduino code, i would recommend this because the rule you create via port forwarding relies on your Arduino ip address to never change.


Go Up