WebBrick runs under Win98, WinNT, Win2000. It may work under
WinME, and it will probably have problems under Win95 unless you
have the latest socket patches from Microsoft. Before you run WebBrick,
you must install
the software that comes with your Lego set, since WebBrick uses spirit.ocx
that is included with the Lego software. However, be sure to shut down the
Lego software and any other program that may communicate directly with the
brick before running WebBrick to avoid conflicts between the two programs.
To set up WebBrick
1. Download the executable.
2. Run the executable and read your machine's IP address.
3. Make a web page with some buttons on it using the little JavaScript
provided.
4. Put the IP address into your JavaScript
5. Set up your robot, turn on your RCX
6. Press the connect button, and watch it go!
1. First, you need to download the executable to your machine. It will only run if you have the Lego software installed. By downloading the software you agree to the following conditions:
The software is copyright Amnon Silverstein
2001, and may not be resold or redistributed in any manner without
prior written permission from its author.
The software is provided as-is, and it may contain defects. There
is no warranty of any kind, express or implied. The fitness of
the software for any purpose is not implied. If you use this software,
you do so at your own risk. IN NO EVENT WILL AMNON SILVERSTEIN
BE LIABLE FOR LOSS OF DATA OR FOR DIRECT, SPECIAL, INCIDENTAL,
CONSEQUENTIAL (INCLUDING LOST PROFIT), OR OTHER DAMAGE, WHETHER
BASED IN CONTRACT, TORT, OR OTHERWISE.
Lego, Lego Mindstorms are copyrights of the
Lego Group. This software uses the Spirit.ocx, and it has its
own restrictions described at the Lego Mindstorms web page. This
software was not developed in affiliation with the Lego Group.
I AGREE TO THE ABOVE CONDITIONS
2. Your machine must be connected to the internet and have an IP address where it can be reached. This probably won't work if you have a firewall. Most private internet services will work. WebBrick will try to determine your web address, but it might get it wrong if you use a dynamic IP server. If you use one, the software from your ISP can probably show you what IP address you were assigned.
3. Copy this code into a web page, and please add in the little WebBrick icon if you find the program useful.
![]()
Test.html
<HTML>
<HEAD>
<TITLE>WebBrick Test Script</TITLE>
<META NAME="keywords" CONTENT="WebBrick
Lego Mindstorms telerobot">
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
// This is just a mini demo. Advanced users
// should get the WebBrick JavaScript API
var dummy = new Image();
var WebBrickURL = "http://YOUR
IP ADDRESS HERE:7070/";
function Activate(prog){
// Math.random is used to avoid proxy caching
dummy.src=WebBrickURL+"X"+prog+"0."+Math.random();
}
// -->
</SCRIPT>
</HEAD>
<BODY>
<H1>WebBrick Test Script</H1>
<FORM>
<INPUT TYPE="button" NAME="button1"
VALUE="Program
1" onClick="Activate(1)"><br>
<INPUT TYPE="button" NAME="button1"
VALUE="Program
2" onClick="Activate(2)"><br>
<INPUT TYPE="button" NAME="button1"
VALUE="Program
3" onClick="Activate(3)"><br>
<INPUT TYPE="button" NAME="button1"
VALUE="Program
4" onClick="Activate(4)"><br>
<INPUT TYPE="button" NAME="button1"
VALUE="Program
5" onClick="Activate(5)"><br>
<INPUT TYPE="button" NAME="button1"
VALUE="Halt All
" onClick="Activate(6)"><br>
</FORM>
<!-- WebBrick is a Lego Mindstorm's web interface program by
Amnon Silverstein, Copyright 2001 -->
<!-- Please also include this link if you use
my program. -->
<A
HREF="http://www.best.com/~amnon/Homepage/Lego/"><IMG
SRC="WebBrickIcon.gif" ALT="Powered by WebBrick"></A>
</BODY>
</HTML>
4. Replace the YOUR IP ADDRESS HERE with your PC's IP address. If you run WebBrick, it will tell you what your machine thinks is its IP address. If it gets a dynamic IP address, this number could be wrong, and you will need to check it some other way.
5. Make sure your RCX is on, the tower is plugged in, and check that WebBrick has the right COM port number for the tower. You can use the Lego software to troubleshoot your RCX connection.
6. Press the connect button on WebBrick. Its little indicators should go from red (disconnected) to blue (standby). When you press the buttons on your web page, the corresponding indicators should flash green (active). The indicated program on your brick should also execute.

There is also documentation that can help
you with trouble
shooting. It also describes some of the advanced features of WebBrick,
such as two-way communication with the brick so your web page can show
sensor readings etc. Check out the Code
Examples to get started with JavaScript coding for WebBrick.