This example demonstrates the ease in which
serial data can be transmitted from a Web Page and SitePlayer
module wirelessly. In this example, the Local DS-WCM is connected
directly to the serial port of the Siteplayer Development board. The
remote DS-WCM is connected to a TR2 Rover. The TR2 Rover uses the
Net TR2 Rover OOPic code to move while searching for obstacles. If
an obstacle is confronted, it will decide which way is clear to go
and then continue on its journey.
By using the TR2 Net Rover Website and SitePlayer, an override
command can be sent to the rover allowing manual control from the
website.
This example consists of fourteen separate documents that will interact
with each other to create the application, these can be extracted
from a zip file that can be downloaded HERE.
SitePlayer
TR2.SPD is a file used by Sitelinker for the initial variables.
Here the IP Address, Sitefile, Sitepath and Includes, amongst others,
are stated.
The setting of the Sitefile and Sitepath in TR2.SPD determines the
SitePlayer Binary file (SPB) and the path and file allocations for
the documents in this application respectively.
If the current settings are used from TR2.SPD, the files will be in
the following allocations.
Sitefile C:\Program Files\SitePlayer\TR2.spb
Sitepath C:\Program Files\SitePlayer\TR2
The file TR2 contains the files:
TR2Rover.htm
TR2RoverSlow.htm
TR2.SPI"
TR2Slow.SPI
SitePlayer_Logo.Gif
round_lighted_red_on.Gif
spinner_down.Gif
spinner_left.Gif,
spinner_right.Gif
spinner_up.Gif
The .HTM files are the HTML web pages. By changing settings in here,
the websites appearance can be altered.
The .GIF files are called up by the Web pages. These are images used
on the site.
The .SPI (Serial Peripheral Interface) files are pointers for any
external device link events that occur. In this application, when
baud rate or any command is selected, the same web page is loaded.
The files TR2.SPD, UDPsend_def.INC and pcadef_TR2.INC
are, in this application, allocated in C:\Program Files\SitePlayer.
The .INC files are used by the .SPD file to set up UDP and file allocations
within SitePlayer itself. In the file pcadef_TR2.INC,
Com is the serial port output, and baud is the baud rate for serial
communication. These are used within the web page.
DS-WCM Connection to Siteplayer
The Local DS-WCM has a serial port that can be connected directly
to the SitePlayers DB-9 connector. By using a DS-W232CAB RS232 interface
cable and a gender changer, the two units can be simply and neatly
connected together.
DS-WCM Connection to OOPicII (TR2 Rover)
The Remote DS-WCM can be connected directly to the OOPicII via a
DS-WI2CCAB I2C interface cable. Connection should be made from the
DS-WCMs I2C Input to pins 1-4 of the OOPicII. Using the WI2CCAB
interface cable allows easy connection.
SiteLinker
Sitelinker is used to download the web files to the SitePlayer TM.
When using Sitelinker, ensure that the local and remote DS-WCM and
TR2 Rover units are powered down so no serial communication will
occur while the Sitelinker is downloading to SitePlayer.
In SiteLinker, Open TR2.SPD. Now select Download
then Make and Download.
The Sitelinker creates an .SPB file, which is downloaded to the
SitePlayer.
Select Browser and load http://192.168.1.250/TR2Rover.htm. Power
up the Local DS-WCM and Remote WCM and TR2 Rover. Press reset on
the OOPic, set the baud rate and when you want to, send an override
command from the website to the TR2 Rover.
SitePlayer is a Registered Trademark of Netmedia Inc. |