vpgautham
Posts: 11
Joined: Wed Jan 01, 2014 4:16 am

Web Controlled Robot

Wed Jan 01, 2014 4:39 am

Hai Guys,

I am not just a newbie, i was completely unaware of raspberry pi and other devolopement boards untill last year.Now I am doing a project as part of my curriculum.
I am planning to do a raspberry pi+Arduino project. In the Project, The raspberry pi acts as a web server and when i press a button in the webpage hosted in pi i need pi to send a string to the arduino...how can i do this?? i have searched this in google...but as i am a beginner i could not understand the procedure...please anybody help me

Thanks in advance

Gautham

AforAlex
Posts: 85
Joined: Thu May 31, 2012 7:56 pm

Re: Web Controlled Robot

Wed Jan 01, 2014 3:54 pm

A nice place to start could be to look at WEBIOPI (https://code.google.com/p/webiopi/), also well worth reading some of the back issues of MagPi (http://www.themagpi.com/) as they have done some articles on using an Aurdino and also on using WEBIOPI.

Happy New Year

vpgautham
Posts: 11
Joined: Wed Jan 01, 2014 4:16 am

Re: Web Controlled Robot

Mon Jan 06, 2014 2:55 pm

thanks for the quick response...will surely do it...


thanks

danjperron
Posts: 3420
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Web Controlled Robot

Wed Jan 08, 2014 3:40 am

I just redid a small project using Xbee to power my roomba from the net.

I use webiopi lighttpd to send a string to a Xbee transceiver via usb serial.

Basically the Rpi run the webiopi web server and when I press a button at the web page, the web server send a serial command string which is interpret by the roomba to power on and it starts to clean the room.

web server -> usb -> serial -> XBee to XBee -> serial -> atmel cpu -> I.R. Led -> roomba (series 400).

Maybe this could help you. Maybe not the Xbee part but the serial stream stuff.

This is the post http://www.raspberrypi.org/phpBB3/viewt ... 09#p463609

It is in French but you could use google for translation or ask me any question.

Oops update . On this one I didn't use webiopi but lighttpd with cgi-bin script. I do use a lot webiopi and it will be easier to implement since everything will be in python. But this example is still a valid alternative.

Daniel

danjperron
Posts: 3420
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Web Controlled Robot

Wed Jan 08, 2014 11:44 pm

And this is the post I did for my little raspberry pi robot.

This one use "webiopi".

http://www.raspberrypi.org/phpBB3/viewt ... 89#p353089

In the python code , I do use the serial port to control the Polulu servo control board.


Again it is in French! But the code is easy to understand.


Daniel

vpgautham
Posts: 11
Joined: Wed Jan 01, 2014 4:16 am

Re: Web Controlled Robot

Mon Jan 27, 2014 2:41 pm

thanks sir for the response.....

sorry for my late reply...i was unable to check internet for the past 2 weeks...

i am gonna check the lighttpd now

vpgautham
Posts: 11
Joined: Wed Jan 01, 2014 4:16 am

Re: Web Controlled Robot

Mon Jan 27, 2014 2:58 pm

thank you sir for your replies....and finally i have decided to use webiopi .....

thank you sir....can i ask you if any problem occurs in future???

vpgautham
Posts: 11
Joined: Wed Jan 01, 2014 4:16 am

Re: Web Controlled Robot

Wed Jan 29, 2014 4:53 pm

Sir,

I am using this tutorial to make the RaspberryPi a web server and wifi access point.....but when i configure the RPi with WebIOPi what changes should i do?? pls help??

http://www.daveconroy.com/using-your-ra ... eb-server/

@danjperron sir pls help me...because the link you gave to your older post has helped me alot...big thanks for that....

danjperron
Posts: 3420
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Web Controlled Robot

Wed Jan 29, 2014 5:49 pm

I assume that the wifi parts is up and running.


Now if you have installed webiopi and just start the service

Code: Select all

 sudo service webiopi start

and when you open an webpage using the Rpi IP with the webiopi port like

http://RaspberryPi_IP:8000

what does it do?


Daniel

vpgautham
Posts: 11
Joined: Wed Jan 01, 2014 4:16 am

Re: Web Controlled Robot

Thu Jan 30, 2014 5:11 pm

So i dont have to direct webiopi to use wlan0 port...ok...let me try it....

Then i have a doubt if i have a RPi camera module can i give a live video stream in the same web page??

Thnx for responding always...!!

danjperron
Posts: 3420
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Web Controlled Robot

Thu Jan 30, 2014 5:49 pm

Yes if you are using mjpeg streamer, for example, just add an image in your html web page.

Code: Select all

<img width="800" height="450" src="http://MyRaspberryPI_IP:10088/?action=stream">

B.T.W. Don't use windows explorer . It won't work with this browser. Use safari, chrome or firefox.


Daniel

vpgautham
Posts: 11
Joined: Wed Jan 01, 2014 4:16 am

Re: Web Controlled Robot

Fri Jan 31, 2014 2:22 am

ok.....thnx.......will let you know the result..

vpgautham
Posts: 11
Joined: Wed Jan 01, 2014 4:16 am

Re: Web Controlled Robot

Fri Feb 07, 2014 8:48 am

sir i cant get the wifi part running......i am using a EDUP EP-N8531 wifi adapter and i cant configure hostapd ?? driver issue.....


actually can i get my local server running with just these lines in the /etc/interfaces??

iface wlan0 inet static
wpa-ssid "<My SSID>"
wpa-psk "<My Password>
address 192.168.1.100
netmask 255.255.255.0

do i have to use HostAPD??
pls help....

danjperron
Posts: 3420
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Web Controlled Robot

Fri Feb 07, 2014 12:05 pm

I'm not an expert in wifi.

But do you have a wifi router?

Since I'm not using a desktop I use "wpa-conf" instead of "wpa-roam"

Code: Select all

pi@raspberrypi ~ $ cat /etc/network/interfaces
auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
#iface wlan0 inet manual
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
And in the /etc/wpa_supplicant/wpa_supplicant.conf

Code: Select all

pi@raspberrypi ~ $ sudo cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
        ssid="putYourEssidThere"
        psk="putYourPskKeyThere"
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP
        auth_alg=OPEN
	}

I do have 3 types of wifi dongles. For the ZD1211B, I need to install a wifi firmware.

Code: Select all

sudo apt-get install zd1211-firmware
Daniel

vpgautham
Posts: 11
Joined: Wed Jan 01, 2014 4:16 am

Re: Web Controlled Robot

Fri Feb 07, 2014 2:01 pm

so i have to use a router if i dont use hostapd??? right??

danjperron
Posts: 3420
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Web Controlled Robot

Fri Feb 07, 2014 3:12 pm

Yes!

At least you will be able to go forward.

Or use your phone if you want to control it with it. I should check that, never done it.

Return to “Automation, sensing and robotics”