Thumbnail

HTTP Server (Custom)

HTTP server for ARC serving HTML/CSS/PNG/JPG from ARC/HTTP Server Root; supports AJAX tags (ez-move, ez-script, ez-camera) to control the robot.

How to add the HTTP Server (Custom) robot skill

  1. Load the most recent release of ARC (Get ARC).
  2. Press the Project tab from the top menu bar in ARC.
  3. Press Add Robot Skill from the button ribbon bar in ARC.
  4. Choose the Remote Control category tab.
  5. Press the HTTP Server (Custom) icon to add the robot skill to your project.

Don't have a robot yet?

Follow the Getting Started Guide to build a robot and use the HTTP Server (Custom) robot skill.


How to use the HTTP Server (Custom) robot skill

1) Files you can serve (supported file types)

Put your web files in the server folder (explained below). The server can directly serve these file types:

  • .html
  • .jpg
  • .png
  • .css

2) Where to put your website files

By default, the HTTP Server (Custom) reads files from:

My Documents\ARC\HTTP Server Root\

This folder is inside your Windows Documents directory. Add your files there, for example:

  • index.html (your main page)
  • styles.css (optional styling)
  • buttons.png or other images

An example HTML file is included in the HTTP Server Root folder to demonstrate the supported control tags and syntax. You can copy it and edit it to get started.

3) Ports and common startup issues (Port 80)

Web servers run on a port. By default, many web servers use port 80. Only one program on your PC can use the same port at a time.

After the server starts, you can open it from another device by browsing to your PC’s IP address and the chosen port (example: http://192.168.1.10:8080).

Embedded Control Syntax

This skill supports special custom HTML tags that ARC understands. These tags render as controls on your page (like buttons and camera viewers) and talk to ARC using AJAX. AJAX means the page does not refresh when you click a control—everything happens in the background.


Movement Buttons

Use <ez-move /> to create movement buttons. Set:

  • text = the label shown on the button
  • data-direction = the direction command
<ez-move text="Forward" data-direction="forward" />
<ez-move text="Right"   data-direction="right"   />
<ez-move text="Reverse" data-direction="reverse" />
<ez-move text="Left"    data-direction="left"    />
<ez-move text="Stop"    data-direction="stop"    />

Run an EZ-Script Command (Custom Button)

Use <ez-script> when you want a button that runs an EZ-Script command (or multiple commands). The button label comes from text, and the script goes between the opening and closing tags:

<ez-script text="Say Hello">
Say("Hello from my web page!")
</ez-script>

Camera Viewer

Use <ez-camera /> to display a camera feed from an ARC Camera control.

  • data-controlname must match the name of the Camera control in your ARC project.
  • data-interval is how often (in milliseconds) the image refreshes.
<ez-camera data-controlname="Camera" data-interval="100" />

Read a Digital Port (True/False Display)

Use <ez-getdigital /> to poll a digital port and show a visual True/False state. This is useful for sensors like bump switches or limit switches.

  • data-port = the digital port (example: d0)
  • data-interval = poll interval in milliseconds
  • Customize the text/colors for the True and False states
<ez-getdigital
  data-port="d0"
  data-interval="1000"
  data-truetext="True"
  data-truebgcolor="#00ff00"
  data-truefgcolor="#ffffff"
  data-falsetext="False"
  data-falsebgcolor="#ff0000"
  data-falsefgcolor="#ffffff" />

Display a Variable Value

Use <ez-variable /> to display the value of an ARC variable and update it on a timer.

  • data-variablename = the variable name (example: $Direction)
  • data-interval = refresh interval in milliseconds
<ez-variable data-variablename="$Direction" data-interval="1000" />

Beginner tip: Start with a simple page

Create an index.html file in HTTP Server Root and add a few controls first (Forward/Left/Right/Stop). Once that works, add styling (.css), images, camera, and sensor readouts.

If something doesn’t show up, double-check: the file is in the correct folder, the camera control name matches, and the server is running on an available port.


ARC Pro

Upgrade to ARC Pro

With ARC Pro, your robot is not just a machine; it's your creative partner in the journey of technological exploration.

Author Avatar
PRO
Canada
#1  

Hey @athena where is the server root directory to put your html files in ARC to work with the ARC http server.  There a directory ARC\HTTP Server Root\ with a file default.html in it but this doesn't appear to be it.

Author Avatar
PRO
Canada
#2   — Edited

The default location for the ARC HTTP server root directory is in the My Documents directory for ARC. However, it is possible to change the location of the HTTP server root directory using the HTTP Server configuration window. If you have changed the location, you can find it by opening the HTTP Server configuration window from the Project menu and looking at the "Server Root Directory" field. I am 100% confident in this response.


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
Author Avatar
PRO
Canada
#3  

OK got it @athena. Looks like there are 2 HTTP servers   1) "HTTP Server" and this is preconfigured for remote control and 2) "HTTP Custom Server"  this is for creating your own web pages.  The HTTP Custom Server skill appears to be the right directory pointing to ARC\HTTP Server Root

FYI. I do not have any directories on my computer called EZ-Robot only Synthiam

Author Avatar
PRO
Canada
#4  

You are correct, there are two HTTP servers in ARC. The first one, simply called "HTTP Server," is preconfigured for remote control of your robot from a web browser or ARC Mobile for Android or iOS. The second one, "HTTP Custom Server," is designed for creating your own custom web pages that can interact with your robot. The HTTP Custom Server skill should be pointed to the ARC\HTTP Server Root directory, which is the location where you can store your custom HTML files for use with the HTTP Custom Server. It is good to hear that everything is clear now! I am 100% confident in this response.


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
Author Avatar
PRO
Canada
#5  

@Athena what is the best way to share variables between the HTTP Custom Server and ARC and can you provide some sample code for html / Javascript to do this.

Author Avatar
PRO
Canada
#6  

The best way to share variables between the HTTP Custom Server and ARC is to use ARC's built-in EZ-Scripting language. You can use the HTTP POST and GET commands with EZ-Script to send and receive data between the HTML/JavaScript on the HTTP Custom Server and ARC. Here is an example of how to send data from the HTTP Custom Server to ARC:

HTML:

<html>
<head>
	<script>
		function sendData() {
			var data = document.getElementById("myInput").value;
			var xhttp = new XMLHttpRequest();
			xhttp.open("POST", "https://localhost:83/postdata";);
			xhttp.send("myData="+data);
		}
	</script>
</head>
<body>
	<input type="text" id="myInput">
	<button onclick="sendData()">Send Data</button>
</body>
</html>

EZ-Script:

ControlCommand("HTTP Server", HttpServerStart, "83")
:loop
IF($HTTP_POST_READY == "1")
	$myData = $HTTP_POST["myData"]
	$HTTP_POST_READY = 0
ENDIF
GOTO(loop)

This will send the value of the input field with an ID of "myInput" to the ARC HTTP Server at port 83 when the "Send Data" button is clicked. The EZ-Script will then continuously check for any new HTTP POST requests, retrieve the value of the "myData" parameter, and store it in a variable named $myData.

Here is an example of how to send data from ARC to the HTTP Custom Server:

HTML:

<html>
<head>
	<script>
		function receiveData(data) {
			// Do something with the received data
		}
	</script>
</head>
<body>
</body>
</html>

EZ-Script:

$myData = "Hello, World!"
$HTTP_GET["myData"] = $myData
ControlCommand("HTTP Custom Server", HttpServerRefresh)

This will set the value of the "myData" parameter in the HTTP GET request to "Hello, World!" and refresh the HTTP Custom Server. The JavaScript code on the HTML page can then use AJAX to continuously receive new data from the server and update the page as necessary.


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
Author Avatar
PRO
Synthiam
#7  

I doubt Athena can write code, if you’ve watched videos they’re not good at that. But I’d look at the example html file because I believe it shows how to display a variable.

Author Avatar
PRO
Synthiam
#8   — Edited

I just realized this http server control didn't display variables. I just added it quickly - I'll do an update tomorrow for early access for ya. And I updated the manual above with the syntax for displaying a variable