Controling a remote device via internet

Feel like posting Off Topic? Do it here.

Moderator: MaxCoderz Staff

Post Reply
thecheat
Calc Guru
Posts: 901
Joined: Tue 29 Mar, 2005 9:13 pm
Location: almost..........there........

Controling a remote device via internet

Post by thecheat »

Hey, I was curious, I've got a project I'm starting (a "web cam bot") that I want to be controllable via the internet.

Basically the idea is to have a live broadcast from a laptop with a wireless card. Through some basic programming (may need help there, but that's later on, not there yet) have a few motors and such that would be controlled.

The key is that the live broadcast would be embedded into a web page, where you'ld have controls you could send the "web bot" It's been done before... but since you guys are the programmers, anyone know of anything/anyway to send/receive commands over the internet?

PS: if you don't get the drift, think RC car you could control from say africa via the internet. How would I do that via a web page and flash or... something...
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

<just an idea>
could you just use standard HTTP commands? POST commands?
</just an idea>
not much of an idea, but at least all browsers know how to do a simple POST, so there probably won't be any trouble on that end.. On the other end, you'll need to catch and process the command of course, but how hard can that be? (let's hope your server lets you do this)
otherwise
<other idea>
anything server-side that has even a bit power will somehow be able to execute programs and perhaps even provide input for them, that would make it almost too easy to be fun though, except it will also have to accept user-input of course
</other idea>

ok I know, stupid ideas..
thecheat
Calc Guru
Posts: 901
Joined: Tue 29 Mar, 2005 9:13 pm
Location: almost..........there........

Post by thecheat »

Hey, I'm open to anything right now... to be honest, I'm NOT a programmer...

I've tried, but linguistics is not my skill... and programming is definitely a language. Right now that half of the project isn't shaky, it's just not there period. Trying to patch the holes in the project, but that one is wide open to hard vacuum. :wink:


Again though, the idea is you log into my site (which is currently theoretical atm :lol: ) and depending on how I work it out... you basically are re-directed to a web page where you have a live video feed, and controls for the bot.

It'd be cool if it could be done with the arrow keys/ wasd keys, but even clickable keys would be ok.... (which would be what you were talking about, right?)


PS: more detail on the "other idea" ? :wink:

PPS: another cool idea would be to have a "queue line" where you enter your commands, how long, etc, then press "go" and watch it run. That'd probably be an even better idea unless someone can think of a faster way to transmit the webcam signal... it's got an 8 second delay currently... :x
User avatar
Dwedit
Maxcoderz Staff
Posts: 579
Joined: Wed 15 Dec, 2004 6:06 am
Location: Chicago!
Contact:

Post by Dwedit »

Lego mindstorms?
You know your hexadecimal output routine is broken when it displays the character 'G'.
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

I've been thinking about making something similar for my ehm... "dorm" is the proper English word I guess...

My initial idea for a proof of concept system was to write a Perl script that controls the parallel port of my webserver, and make requests to that script over the web, with the GET/POST variables indicating what the script should be doing to the parallel port. Then I could connect a bit of hardware to the port which controls turning the camera, and on the user side of things I was planning to let a few XmlHTTPRequests (you know, "Ajax") handle the requests to the perl script without leaving the page where the webcam stream is.

Provided that you don't have too much delay between pressing a key and seeing the webcam image rotate, that should work nicely for a first demo. And with Javascript you could also bind the buttons for rotating the webcam to keys on your keyboard.
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
thecheat
Calc Guru
Posts: 901
Joined: Tue 29 Mar, 2005 9:13 pm
Location: almost..........there........

Post by thecheat »

The only problem that's a real struggle, is the fact that so far, that 8 second delay is a real nuisance... I can't help but feel that perhaps if you used a video conference or something there would be only a second or so of lag...

I mean, you play MMORPG's online and there isn't lag... there's got to be a way to cut it.

PS: dwedit... I'd like to, but I don't have any, and I'd like to use a computer if I could. make it more accessible to the public.
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

How do you stream the video?
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
thecheat
Calc Guru
Posts: 901
Joined: Tue 29 Mar, 2005 9:13 pm
Location: almost..........there........

Post by thecheat »

I'm using Windows Media Encoder....

you can see the stream here:

mms://thecheat.myvnc.com:1755

I'm using no-ip.com currently to provide a stable (semi?) safe ip address...

that help any?
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

Well, as far as I can see, it just loads too slowly (so Windows Media Player buffers too far ahead and even pauses at times)
thecheat
Calc Guru
Posts: 901
Joined: Tue 29 Mar, 2005 9:13 pm
Location: almost..........there........

Post by thecheat »

That's the current issue.... I'm not sure how to embed... and I'd like to get rid of the buffering. Maybe a second delay would be ok... but 8 seconds??? I mean seriously...

I'm assuming you DID see a feed, though, right?

hmm... anyone know where I should look to look into the programming of something like this?
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

I wouldn't start writing your own streaming media server any time soon ;)

You'll need an intermediate server because you don't have a static IP/direct connection, appearently. You can do it the old fashioned way and install one of the many crappy little applications that grab a frame from your webcam every X seconds and upload it to an FTP server. Then on your website you can use a bit of Javascript to refresh the image at the same speed, and you've got something kinda like video ;) I've used this a lot a few years ago and it's really quite simple to set up, and the delay is no more than the worst case scenario of 1 second plus network latency. Of course the frame rate sucks ass.

The other way I've been experimenting with is VLC media player. This excellent piece of software also contains a streaming media server (VLM) that you can configure to use your webcam (and microphone, if you want) as inputs, and stream them in any encapsulation and compression to a specific server or broadcast onto the network. Of course, this only works as far as the nearest firewall that blocks UDP or broadcast traffic, or as many hops as you set the broadcast to. It worked quite nicely on our university campus, but you want to use it on a website, so that could be a bit more tricky. But I think I remember it having options for that too, so I think you should take a look at it. On our network the stream quality was excellent, and the delay about a second. VLM can also forward a stream that it receives from the network, so that should work with your intermediate server thing mentioned above...

Those are the two methods I've been playing with, and that have proven useful. Of course there are hundreds more. I'd stay away from anything that's named "Windows Media Something" though ;)
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
thecheat
Calc Guru
Posts: 901
Joined: Tue 29 Mar, 2005 9:13 pm
Location: almost..........there........

Post by thecheat »

last point = double yes...

works pretty good...


Anyways, I think that's a static/direct IP connection... or atleas that's what no-ip.com claims...

I'll look into VLC though... ANYTHING to get a quicker response time! (minus actually paying money... the webcam cost 10 bucks... at the store...)
thecheat
Calc Guru
Posts: 901
Joined: Tue 29 Mar, 2005 9:13 pm
Location: almost..........there........

Post by thecheat »

Hmm... I couldn't figure anything out with vlc... hmm... I'm going to see if I got an older version... .8?
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

Check this out:
http://www.videolan.org/doc/streaming-h ... /ch05.html

It's a bit tricky, with it being a new feature without a GUI and some half working features, but it's powerful and fairly stable once up and running.
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
Post Reply