Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: thecadguy91 on April 23, 2007, 08:31:06 PM

Title: Control Microcontrollers thorugh the internet?
Post by: thecadguy91 on April 23, 2007, 08:31:06 PM
I'm part of my highschool robotics team but i did all of the CAD work, not the programming but i'm wanting to get more involved in the programming aspect.  anyway, i was wondering if it's possible to control a micrcocontroller [programmed to run servos, lights, whatever] through web. i know there would probabally have to be some sort of radio controll for the microcontroller and that would somehow link to a computer and then you'd somehow access it. but's that's exactly my question there:
can i access/controll a microcontroller through the web?
Title: Re: Control Microcontrollers thorugh the internet?
Post by: dunk on April 24, 2007, 03:19:39 AM
hi,
so i've done this a few times. there are other ways of doing it but below is the way i did it.

first thing you need to do is find a microcontroler that you can controll from a PC.
i have used both PICs and AVRs, connected via their UART to a PCs serial port.
under normal circumstances this allows you to controll the microcontroler from terminal software such as hyperterminal.

next you need to install some sort of programming language on the PC that can be run as a CGI (Common Gateway Interface) which will allow you to run your program as a script from a web server.
also for that programing language you will need some libraries that let you controll the serial port.
i used Python as a programming language and ModSerial to controll the serial port because i knew Python and it's free (open source) but there are other choices.

next step, you need to install webserver software on your PC that can run CGI scripts.
i used Apache because its free and i know it well but again, there are other (probably simpler) choices.

connect your computer to the internet so it is reachable from the outside world.
you do have firewall software in place right?

design a fancy web page with buttons that link to your CGI script, in turn sending controll strings through the serial port to your micrcontroller and controlling your creation.

the individual steps i have described above are all simple enough once you know how but i think you are in for a lot of research if you choose to do it this way.

dunk.
Title: Re: Control Microcontrollers thorugh the internet?
Post by: Hal9000 on April 24, 2007, 03:21:21 AM
This sounds pretty cool. Might look into this myself. Cheers :)
Title: Re: Control Microcontrollers thorugh the internet?
Post by: Dreamcatcher on April 24, 2007, 04:51:11 AM
hi
in order to make connection between the two hosts, should we have a static IP adress?
if not how do we know the IP adress?
Title: Re: Control Microcontrollers thorugh the internet?
Post by: dunk on April 24, 2007, 06:59:50 AM
hey Dreamcatcher,
so yes, a static IP makes things far simpler but there are ways around the problem.
if your internet provider only allocates temporary IP addresses you can use a "dynamic DNS" service.
http://en.wikipedia.org/wiki/Dynamic_DNS (http://en.wikipedia.org/wiki/Dynamic_DNS)

alternatively, as more and more entertainment systems are giving you the ability to log in over the internet, static IPs are becoming more common.
a lot of ISPs will give you a static address if you ask for one.

dunk.
Title: Re: Control Microcontrollers thorugh the internet?
Post by: Kohanbash on April 24, 2007, 08:25:54 AM
if you want to use a linux computer that only costs $69 than you can hook it up directly to your ethernet/wireless network.

see the admins post on the computer:
http://www.societyofrobots.com/robotforum/index.php?topic=926.msg6272#msg6272
Title: Re: Control Microcontrollers thorugh the internet?
Post by: dunk on April 24, 2007, 06:36:46 PM
nope. i'm afraid that board has no wireless network capability. (one of the first things i looked for when i saw it.)
i have never been able to find a wired ethernet to wireless adapter that doesn't burn through batteries.

if you want to go that route then i'd recommend something like this: http://www.acmesystems.it/?id=4 (http://www.acmesystems.it/?id=4) with a USB wireless card.

dunk.
(ducking from the flurry of people who are going to suggest the gumstix.com (http://gumstix.com) now...)
Title: Re: Control Microcontrollers thorugh the internet?
Post by: Kohanbash on April 24, 2007, 06:53:08 PM
Hi
they make usb wireless adapters that use relatively low power that you can use with that linux board.

ex. http://www.bestbuy.com/site/olspage.jsp?skuId=7843836&st=usb+wireless&type=product&id=1142298457206
Title: Re: Control Microcontrollers thorugh the internet?
Post by: dunk on April 25, 2007, 02:33:17 AM
so you could use a USB wireless adapter with the Fox board i posted a link to but *not* the $69 Atmel board you and Admin are talking about.

the Atmel board only has a USB client port which allows you to connect it to a PC but you can't connect USB devices to it.

dunk.
Title: Re: Control Microcontrollers thorugh the internet?
Post by: meistro on January 12, 2009, 03:20:07 PM
 :)This fits my description. I'm using a Via Artigo Pico-Itx. Its so small it fits right into a Radio Shack project box. I have a 2.5sata drive with Debian Etch installed. I get wifi through a usb "G" network dongle. I have a PCMCIA Sprint broadband card that plugs into a PCMCIA host linksys router that has 10/100 connector. I have Arduino connected to one of the usb ports on the Artigo. So, hosting a web app. using Processing allows me to send commands directly to the Arduino.

Next I need to hook up my new CMU-CAM3. The nice thing about the Artigo is it can do more processing as the Arduino collects sensor data and handles controls.