Asked — Edited

Running Your Bot Through A Custom Website/Http Server Layout

Hey guys. Little project I want to look into.

As I mentioned in this thread, I want to make a webpage/custom web server layout and run the ez-b through this. I have html background, so designing the webpage should be no problem, but I know little of getting ARC stuff into that page. I tried setting up the http server but it wouldn't work. So, who's up for helping me try this?


ARC Pro

Upgrade to ARC Pro

Subscribe to ARC Pro, and your robot will become a canvas for your imagination, limited only by your creativity.

United Kingdom
#25  

What about the camera? You have the url to the image which is http://IPAddress:Port/CameraImage.jpg?c=Camera you just need to find a method for auto refreshing the image without reloading the page. There are hundreds of examples of that online.

Personally I have a small script running which reloads the IMG source every 1000ms using document.getElementById

  <script type="text/javascript">

    var reloader1;

    function reloadImg1() {

      var d = new Date();

      document.getElementById("CamImg1").src = "URL to camera?id" + d.getTime();
    }

and

<img src="URL to camera" id="CamImg1" style="width: 640px;" onload="reloader1 = setTimeout('reloadImg1()', 1000);" >
#27  

Pardon me for the java/jquery/html questions, but how would I specify a specific <button>? Disregard, I found it.

#29  

Just wanted to say thanks for the help Rich. It helped out a lot. Now it's just up to me to make a simple to use, rearrange-able interface.

I found some sample code for the camera which worked out fine. Once finished it will be released to everyone as an open source html control panel.:D

#30  

Hey Tech... good work. Looking forward to your finished version...

#31  

Hey @Technopro,

Not sure if this will help you, but many browsers do not allow local scripts to perform AJAX operations (of which $.get is one), for security/ So if you open the page in your browser, I'd bet that's why IE won't let it run. You said that:

Quote:

I'm putting mine in an html file and then opening the file in IE and pressing the button.

That means you're running the HTML file directly in the browser, not in a web server... correct? You would be able to run scripts from a web server - like the ARC web server. Or, if you aren't using the ARC web server, I bet if you set up a quick local server, eg.XAMPP, the script will work in any browser.

Also, make sure when you are attaching an event handler to an element, like

$('button').click()

that the element exists in the page first. If the script is in the header, it can't attach the event handler to the element, because it doesn't exist yet. Nothing would happen.

You can put your script at the end of the page, or there is the deferred function $(document).ready() that you can use to make sure all the elements in the page have loaded before your script runs:)

#32  

Thanks for the tips Chrissi. I first plan on having a local version, which I am making now. Then I want to make a server html file.

Haven't had any problems yet with what you outlined, other than the $get. If on the release people are having those issues I'll do what you mentioned.

Maybe I'll give a referral for Non chrome users to try XAMPP. For the server version I think this would be required.

Thanks again Chrissi.

Tech