Authorized Online Retailers

Buy from US Buy from UK Buy from DE Buy from IT Buy from FR Buy from ES Buy from JP

Objective

In this lesson, we will learn how to let the robot car has vision to see front environment and how to control the robot car through web browser or mobile APP.

To complete this task, we need install a web server software called "mjpg-streamer" in Raspberry Pi, this software will catch video from Robot Car camera and send the video to a web page.

We also need to install another web server software called "WebIOPi" in Raspberry Pi. This software will allow user to use browser to remotely control Raspberry Pi GPIO input/output and therefore control the movement of our robot motor.

top

Hardware Installation

If you don't install camera in lesson1, please install and connect camera as following pictures. If you have already installed and connected these, please skip this step.


top

Software Installation

Simple Installation Guide

If you follow to the simple installation guide, you can ignore the complex installation guide.

If you want to learn more, you can try the complex installation guide.

In Shell Terminal, type following commands:
wget http://osoyoo.com/driver/picar.sh
chmod 777 picar.sh
sudo ./picar.sh

Above shell script command will automatically download installation file from remote software repository,configure and install the webiopi and mjpg-streamer server onto your Raspberry Pi.

Once the script file command finishes running, raspberry pi will restart automatically. You will see the Pop-up window "Server unexpectedly closed network connection", click "Confirm" button.

Now you go to Test Step or Apple/Android APP test and run the car.

top

Testing

Testing Server Installation

Now you can put your car on the ground and turn on the power-switch in battery box. We need to use SSH to control the car. So you must enable SSH with raspi-config command before testing. If you are using windows, please use download Putty to ssh your Pi, if you are using MacBook, please directly use ssh command in terminal.

Step 1. To start mjpg-streamer, in ssh terminal, please type followinig command:
cd ~/osoyoo-robot/cam-robot/mjpg-streamer
sudo ./start.sh

Step 2. To start webiopi, please open another ssh window and type following command:
sudo webiopi -d -c /etc/webiopi/config

Control the car with browser
Now you can use your browse to acess Raspberry IP with port 8000(i.e, if your Pi IP address is 192.168.0.115, please visit http://192.168.0.115:8000, you will see following picture in your browser, click arrow buttons, you can make car moving to your desired directions.

User Name: webiopi
Password: raspberry

top

Android and iOS App

You can also use our free Android App or Apple App instead of browser to control the car.

Download the Android app fromhttp://osoyoo.com/driver/osoyoo-robot.apk

For Apple iOS user, please search Osoyoo raspberry Pi Robot Car in Apple APP store ,download and install it.

Run the App, click set up and enter config page set the fields as following:

Robot IP:

your raspberrr pi ip Port: 8000
Video URL: http://your_raspberry_pi_ip:8899/?action=stream(please use IP such as 192.168.0.16 to replace your_raspberry_pi_ip)
User Name: webiopi
Password: raspberry

Click Save button and exit config page

Now you can use the arrow buttons in App to control the car

top