This project can be useful for you if you have a website that you can use to keep the data and you can't get static IP address from your internet provider. The common way is to set the ENC28J60 to server mode and connect to it from the internet by entering your router static IP address in a browser.
In this project the Ethernet is set to Client mode and it sends data of the Arduino analogue input A0 and digital input D3 to a website. At the same time the Arduino reads the buttons state which selected on the website and switches output 5. I can browse at the Arduino inputs data or control the Arduino output by logging to a page in my website from anywhere.
A disadvantage of this system is that you can't access the Ethernet module directly from a browser on the internet. Changes to the code can allow for transfer of more data. The idea is taken from here: https://thingspeak.com/ The process is to request a file and to add the data using URL parameters. The PHP file (a21.php) records the data on another file a22.php. To read inputs and select output log to page a23.php (a24.php records the output state). I added a suggestion for a PHP script. To see the data log to page: http://moty22.co.uk/a23.php. The Arduino's output is updated when the Ethernet module sends data every 20 seconds.
In the code change the name of my website to yours. You can use my website to test your project. The code is based on a sample in github/jcw/ethercard.
You can download the php file and get more info on my website: http://moty22.co.uk/wIfI.php
Comments
Please log in or sign up to comment.