Networking Acronyms at Work
There are a number of networking protocols that come into play in Webster2's design.
- DHCP. Webster2 can use DHCP to obtain its networking parameters (IP address, and so forth) from a DHCP server on the network to which it is attached. If DHCP isn't used, the networking parameters can be set statically via entries in a configuration file.
- DNS. DNS is like a phone book for the Internet for turning host names into IP addresses. DNS entries must be in place so that Webster2 can be found on the Internet by name.
- FTP. Webster2's software includes an FTP server that lets website content be stored on the on-board SD memory card to be updated remotely. Updates can be made using FTP client programs like FileZilla, or via the publishing mechanism of your web page design software.
- HTTP. HTTP is the protocol of the WorldWide Web. HTTP is used between web browsers and web servers for information transfer.
- NTP. Webster2's software uses NTP (Network Time Protocol) for keeping its system clock accurate.
- UDP. UDP (User Datagram Protocol) can be used by Webster2 to log web server accesses to a remote computer.
Because Webster2 uses all of these protocols, it may be necessary to configure any firewall software you use. Most importantly, you must allow HTTP requests to pass through the firewall or Webster2 won't be available on the Internet. This feature is called "port forwarding" in some cases.
Using Webster2
Before Webster2 can go online. you must decide if static or dynamic IP addressing is to be used. Using DHCP is always easiest if your network permits it. For my website, I connect Webster2 directly to my wireless DSL router and use DHCP so the router assigns an IP address automatically. This works fine. Once your web server has a public IP address, as mentioned, you must open up the firewall in the router to allow inbound HTTP connections so users outside your network can hit your server. How this is done depends upon your firewall software.
Keep in mind, in trying to host a website on a home DSL connection, the IP address assigned to your DSL router changes from time to time. This is a problem whether you are using Webster2 as your web server or a professional product like Apache. Regardless of how you access your website, when your router's IP address changes, connectivity to your website using an old address will be lost.
A solution that lets you host a DSL-connected website is a program called No-IP (www.no-ip.com). No-IP (the company) offers a free dynamic DNS and web redirection service for just this purpose. No-IP will even provide you the use of a domain name from a list of preexisting domains that you can use for free.
The No-IP client program runs as a service under Windows XP. It continually monitors the public address exposed by your router for your web server and informs No-IP's DNS servers of any changes. So as long as access to your website is via your chosen domain name, you are insulated from changes to your router's IP address. By running No-IP on any PC in your network, access to your website is maintained even if the public IP address of your router/server changes. Pretty slick, huh?
Once you register your web server host with No-IP and your server is operational, you should be able to ping your server:
ping myhost.mydomain.com
Executing this command verifies whether myhost in the domain mydomain.com is operational or not. You would need to change the ping command to check your server in your domain.
Once you have web content in place and you can ping your server, you should be able to access your website with a browser (Internet Explorer, Firefox, or whatever) by specifying a Universal Resource Locator or URL of the form:
http://hostname.domainname
If you don't specify a specific HTML file to access, the file index.html is assumed. Once this works, you are good to go.
Webster2 Hardware
Again, Webster2 is based entirely on the NB MOD5270LC development kit hardware. As such, only two things are required to get Webster2 running. First, you need to insert an SD memory card (64-GB max) into the socket on the development board and second. you need to download the web server code I provide (see www.ddj.com/code/) with this article.
While packaging the NB hardware is not required for its operation, I decided to package the development hardware to protect it from accidental abuse or damage. At my local electronics shop, I found a plastic box made by Serpac that the hardware would easily fit into; see the complete parts list in Table 1.
Designation | Value | Notes |
MOD5270LC | NB development kit hardware. Part #: NNDK-MOD5270LC-KIT | Available directly from NetBurner, Inc. |
Box | Serpac Model #271 or #271-I Dimensions: 7"x 4 3/4"x 1 3/4" | See www.serpac.com |
SPST power switch | Any brand off/on switch | I used a miniature toggle switch |
SPST momentary contact pushbutton switch | Any brand pushbutton switch | This is the server's reset switch |
LED power on indicator | Any brand LED | I used a green LED for power on |
LED access indicator | Any brand LED | I used a red LED as access indicator |
Misc. hardware | Screws, nuts and spacers, etc. | For mounting NB module |
Memory Card | SD memory card | 64 GB max; 1 GB usually adequate |
Because I was going to hide the hardware inside the box, I thought it necessary to mount important controls and indicators on the outside. In the end, I mounted a power switch, power indicator, reset switch, and access indicator on the box; see Figures 1 and 2. The packaging steps I took are as follows:
- Lay the NB module into the box with the dip-switch facing the front of the box to visualize how things will fit.
- Remove any of the box's molded standoffs that are in the way using a drill bit larger in diameter than the standoff. The idea is that the NB hardware should be supported in the box by the acrylic feet attached to the bottom of the printed circuit board (PCB).
- With the PCB held in place, mark the box with the position of two or more of the mounting holes on the NB PCB. Drill these holes for #6 machine screws.
- Layout the positions of the two switches and the two LEDs on the bottom front portion of the box. Drill holes of the appropriate sizes for mounting. Glue the LEDs into place and mount the switches.
- File two holes in the top rear portion of the box to allow the power and network cables to protrude.
- Mount the NB PCB into the box using appropriate screws. The screw heads should be on the outside of the box; nuts on the inside. Tighten the screws but not so tightly as to cause the PCB to bend.
- Carefully unsolder surface-mounted LEDs 8 and 9 from the PCB. Unsolder and remove the reset switch as well. Led8 is the furthest right in the row of eight LEDs. Led9 is located to the left of the dip-switches. The reset switch is located above the row of eight LEDs.
- Cut the connector off of the supplied power cable. Pay attention to the polarity of the cable. There was a white strip on the + side of the cable on the unit I used. If you cannot tell which is the + side of the cable. use a multimeter to determine it.
- You will probably have to extend the power cable by soldering other wires onto it. A six-inch extension will probably do it. Again. be careful of the polarity.
- Solder the - end of the power cable to the GND terminal on the PCB. Solder the + end to one side of the power switch.
- Solder one side of another wire to the other switch connection and the other side to the "7to18V" terminal on the PCB.
- Determine the + side of the power LED by holding the leads to a 9V battery and noting which orientation causes the LED to light. Note which lead of the LED is connected to the + side of the battery.
- Solder a wire from the + side of the power LED to the + connection on the PCB for Led9, which was removed earlier. Solder another wire from the other lead of the LED to the other connection for Led9.
- If you are feeling lucky, plug in the wall wort and turn the power switch on, if all is well you should see the power LED come on. Turn power back off and unplug the wall wort.
- Solder two wires from the reset switch to the two pads on the PCB from which the reset switch was removed. Polarity is not important here.
- Determine the + side of the access LED as you did for the power LED.
- Solder a wire from the + side of the access LED to the + connection on the PCB for Led8, which was removed earlier. Solder another wire from the other lead of the LED to the other connection for Led8.
- Connect an Ethernet cable to the RJ-45 connector on the MOD5270 module and route it and the power supply cable out of the box.
- Place the top on the box and screw it to the bottom using the screws provided.
That's it with the hardware. Plug Webster2's power cable in and plug the network cable into a network port. Flip the power switch to on and you are ready to go.