Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 12-24-2011, 03:52 PM   #1
Baseband Member
 
Join Date: Mar 2010
Posts: 34
Default Web based interface for non-web application

I recently got into robotics and I am interested in making a website that allows a user to control a robot plugged into the web somehow. I am sure this is possible, as I have seen several security cameras that are controlled via web-based interfaces. I'm trying to do the same exact thing, I just don't know how to get javascript or a flash interface talking to the C or Java program that will likely be running the microcontroller in my robot.

Also, I am not sure if I understand this right but I have read a bit about embedded ethernet and it almost sounds like I could just store all my programming on my webpage and plug my robot straight into a router, thereby allowing 24-hour access to the robot and eliminating the need for the robot to be connected to a server. Is this right?

Thanks,
Rob

---------- Post added at 04:52 PM ---------- Previous post was at 04:34 PM ----------

Here's an one of those security camera's I mentioned: Web controlled Surveillance Camera

This guy even posted all of his code on that site (I can post some here if you don't want to click the link and download the pdf containing his code). I understand most of it, I'm just hazy on where and how the php is talking to the C. And is all this code stored on one page like he makes it seem? Or is the C code in a separate file on his PC somewhere?
__________________

AnnihilationRob is offline   Reply With Quote
Old 12-27-2011, 01:20 AM   #2
Baseband Member
 
dIxie's Avatar
 
Join Date: Jan 2010
Location: Canada
Posts: 68
Default Re: Web based interface for non-web application

This might be taking what you want to the next level, but it definately will do the job, it involves the use of PHP and Javascript.

Robots at Camosun College - YouTube

It's a video a friend of mine did on the project as a whole.
__________________

__________________
dIxie

The hacker mindset doesn't actually see what happens on the other side.
dIxie is offline   Reply With Quote
Old 12-27-2011, 01:30 AM   #3
Baseband Member
 
Join Date: Mar 2010
Posts: 34
Default Re: Web based interface for non-web application

That's awesome man. Any chance they've shared their code online?
AnnihilationRob is offline   Reply With Quote
Old 12-27-2011, 02:50 AM   #4
Baseband Member
 
dIxie's Avatar
 
Join Date: Jan 2010
Location: Canada
Posts: 68
Default Re: Web based interface for non-web application

I'm not sure if they have posted it anywhere. I'll try talking to him to see if he is willing to release some of the code. Some of it is quite confidential in their control algorithms but the basic control code should be available.

---------- Post added at 11:50 PM ---------- Previous post was at 11:45 PM ----------

I did find the information about using multiple controllers and how they are recognized so that you could actually use a mouse to control the motion. These are sample pieces of code that should run in a linux operating system after being compiled just to do some simple testing.

ftp://elex.camosun.bc.ca/mdundas/Elex233/Week10/
__________________
dIxie

The hacker mindset doesn't actually see what happens on the other side.
dIxie is offline   Reply With Quote
Old 12-28-2011, 11:31 AM   #5
Baseband Member
 
Join Date: Mar 2010
Posts: 34
Default Re: Web based interface for non-web application

I've been studying the code from that security camera project i posted, and there is one line that is probably very important in it that I don't understand. When a button labelled "Camera On" is clicked, php runs this code:

<?php
if(isset($_POST['Camera_On']))
{
system('sudo /etc/init.d/camera start > /dev/null');
}
if(!isset($_POST['Camera_Off']))
{
system('sudo /etc/init.d/camera status');
}
?>

What is happening in the "system('sudo /etc/init..." lines?
AnnihilationRob is offline   Reply With Quote
Old 12-28-2011, 04:26 PM   #6
..m.0,0.m..
Site Team
 
iPwn's Avatar
 
Join Date: May 2010
Location: USA
Posts: 3,870
Default Re: Web based interface for non-web application

Quote:
Originally Posted by AnnihilationRob View Post
I've been studying the code from that security camera project i posted, and there is one line that is probably very important in it that I don't understand. When a button labelled "Camera On" is clicked, php runs this code:

<?php
if(isset($_POST['Camera_On']))
{
system('sudo /etc/init.d/camera start > /dev/null');
}
if(!isset($_POST['Camera_Off']))
{
system('sudo /etc/init.d/camera status');
}
?>

What is happening in the "system('sudo /etc/init..." lines?
I don't pretend to understand PHP as of yet, but this is an 'if' statement that checks which command is received from the page ($_POST) and then runs the subsequent commands.

The "system('sudo /etc/init.d/camera *'" is basically telling the system (host machine or camera) to run the camera start/status scripts as a superuser (sudo = superuser do).
__________________
Me: You'd think as the dominant species we wouldn't be so effing stupid.
J: We're just intelligent enough to be completely effing stupid.
iPwn is offline   Reply With Quote
Old 12-29-2011, 11:34 AM   #7
Baseband Member
 
Join Date: Mar 2010
Posts: 34
Default Re: Web based interface for non-web application

So are the start and status scripts located in /etc/init.d/camera on the server? Are they php scripts or another language?
AnnihilationRob is offline   Reply With Quote
Old 12-29-2011, 01:03 PM   #8
Baseband Member
 
dIxie's Avatar
 
Join Date: Jan 2010
Location: Canada
Posts: 68
Default Re: Web based interface for non-web application

The start up scripts are located in that folder, although they will usually just be shell scripts that will link to other drivers and misc. files. The actual files that execute will be C files. PHP is a web format that is able to make a link between web pages and systems, that is why it has to make a system command call.
__________________
dIxie

The hacker mindset doesn't actually see what happens on the other side.
dIxie is offline   Reply With Quote
Old 01-04-2012, 10:49 AM   #9
BSOD
 
Join Date: Jan 2012
Location: wilsondavid
Posts: 5
Default Re: Web based interface for non-web application

You can also create a web based Interface for non web application system. For that you have create and design your desktop form in such a way that it is completely look like web page. You can also run you web application in local server also on in your PC.
__________________

wilsondavid is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 05:59 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0