User avatar
Super-Nathan
Posts: 67
Joined: Sun Jun 17, 2012 6:56 am
Location: South Korea
Contact: Website

Input from web help

Thu Sep 13, 2012 4:42 am

I am not completely new to input from the web. I recently built a website to feed my fish from a website using an arduino. http://www.grovercam.com. In that project an HTML button activated a php script that ran a BASH script that sent command to my Arduino.

I would love some way above and beyond help for my next project. I would like to build a remote control car for my house (to play with my dog at work). I plan to put a webcam on it and use the RasPi, via a wireless dongle, to transmit video to my main server. I would like to be able to control the car via commands issued from my main server over the network. I beleive it would be simple to use PHP and BASH again to issue commands. Th problems I have are 2 fold:

1) I need to capture the input with python and use python to control the gpio (controlling the car). I am rather new to python and would love some sources on how to do that.

2) I would really like to have a joystick like graphic on the website to control the car. If i have 4 axis buttons I cannot stear and go forward at the same time. How would I program a joystick that could go both forward and right/left at the same time. something that looked like a round bubble level perhaps.

I know this is a LOT to ask in a forum post, but some sources and right direction pointed out would be greatly appreciated.
echo "Something Useful" > /dev/null

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Input from web help

Thu Sep 13, 2012 6:53 am

If you are really into bash , you can still use the GPIO via bash.
But I favor Python. Have a look a http://www.themagpi.com , download
all the issues. Excellent GPIO and of course , Python tutorials in there.

So , i believe you know Webdesign and such - there is a Microframework called
flask available for python - and you can combine that with jQuery (Mobile).
Wheter you use the Pi as server or as intermediate device or if you integrate a Arduino
into this setup is up to you.
The biggest problem i see is latency , because the commands are sent over the internet and we
don't know what your car does in the meantime.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
Dweeber
Posts: 606
Joined: Fri Aug 17, 2012 3:35 am
Location: Mesa, AZ
Contact: Website

Re: Input from web help

Thu Sep 13, 2012 7:11 am

Super-Nathan wrote:I am not completely new to input from the web. I recently built a website to feed my fish from a website using an arduino. http://www.grovercam.com. In that project an HTML button activated a php script that ran a BASH script that sent command to my Arduino.
Reading this reminded me immediatly of a book I read as a child about over feeding a gold fish...

http://en.wikipedia.org/wiki/A_Fish_out ... %28book%29

As for your new project, interesting..
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

Return to “General programming discussion”