Arduino Web Server

Hello All,

I am currently trying to publish a website on the internet using an Arduino as a server. The problem is I don't know where to start. I have created a website using iWeb and have html and css files to upload to a micro SD card. I don't know what the ip address or mac address of my ethernet shield is an its not stated anywhere on the device. Can I found out what they are? Any help would be much appreciated.

The mac address seldom matters: you can code your own like deadbeeffeed or whatever. The ip address is coded into the sketch and needs to suit the lan side of the router; or can be dynamic.

You need to look at the examples halfway down the right side of this page, and this site is very good.

As a matter of interest, you can view my simple Arduino server here.

go to command prompt on your computer. click that app and type in ipconfig and hit enter. what are the values for default gateway? the first three are important. they are probably 192.168.1 or 192.168.0 but could be something else.

Anyway that will be your starting point. You will then assign a forth number not currently used on your modem. 177, 174, or 172 will likely do the trick. You will assign the four numbers for the ip address. don't worry about the mac address.

Open the ethernet web server program that comes pre loaded in the libary.

you will see this line

IPAddress ip(192,168,1,177);

change the first three numbers to match your internet number (found by ipconfig) and the forth number just play around with. load it. If you prefer, the Webserver program may be easier to figure out the forth number

What do you mean by click that app? This is what came up when I typed ipconfig into the terminal on my computer;

Last login: Tue Jun 3 13:17:58 on console
Mac-2:~ Sam$ ipconfig
usage: ipconfig
where is one of waitall, getifaddr, ifcount, getoption, getpacket, set, setverbose
Mac-2:~ Sam$

If your computer is connected to your WiFi network, go to the Command Prompt (located under accessories folder in Windows 7) and type in "ipconfig" and hit return. This should bring up the IP configuration information for your computer (IP address) and the router (gateway IP address), subnet mask, etc.

This app should be a black screen sort of box.

Typical of what ipconfig displays:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\zoomkat>ipconfig

Windows IP Configuration


Wireless LAN adapter Wireless Network Connection:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Wireless Network Connection 2:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::eda8:a9dd:bd47:fc09%12
   IPv4 Address. . . . . . . . . . . : 192.168.1.2
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1

Ethernet adapter Local Area Connection:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter isatap.{53E6413A-8571-459A-B5D8-6F517CB976F8}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter Teredo Tunneling Pseudo-Interface:

   Connection-specific DNS Suffix  . :
   IPv6 Address. . . . . . . . . . . : 2001:0:5ef5:79fb:4da:ed5:bc3a:9a3c
   Link-local IPv6 Address . . . . . : fe80::4da:ed5:bc3a:9a3c%15
   Default Gateway . . . . . . . . . : ::

Tunnel adapter isatap.{B5747525-D02E-4CEB-891E-83A877DE140C}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter isatap.{F809F5A9-46FA-4299-9055-1293B87E7B62}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

C:\Users\zoomkat>

Yes, Good idea zoomkat to provide the code it displays.

Notice in the example code zoomkat provided the line

Default Gateway . . . . . . . . . : 192.168.1.1

Those first three numbers are where the first three numbers below comes from (from the example I posted earlier).

IPAddress ip(192,168,1,177);

The 177 comes from a number not currently being used on your system. If 177 doesn't work try one of these. 172, 174, 176 instead of 177. You can really use almost any number not currently being used by your system so don't think 177 means anything special.

Once you get it loaded, type in the number on your internet search bar. (use periods instead of comma's though)

---------------------edit-----------------------------
I look at the internet protocols as mailing a letter. In this case the letter gets to the house and 177 identifies which person in the house the letter is for. That may help you understand the logic better if you are interested.