Objective: In this project we will connect Robot Car to Wifi and Use an APP to control the car through Internet. This is a typical Internet of Things(IoT) Application. Hardware Installation: Step 1: Insert to Osoyoo ESP8266 Wifi Shield onto your UNO board, then Connect E_TX pin to Arduino D5 and E_RX pin to D4 as per following picture: Step 2: Connect Motor control wires as per following connection table
Wifi Shield Model X
D12 IN1
D11 IN2
D3 ENA
D6 ENB
D7 IN3
D8 IN4
After connected above wires, download a test sketch file from http://osoyoo.com/driver/l6test.ino . Load above file to Arduino, you car should move forward ,backward, left turn , right turn and then stop. If the car does not move in above mentioned scenario,  please check your wiring. Software Installation: Step 1)APP installation: you need search "Osoyoo Wifi Robot APP" in Google Play or Apple Store  . Install this APP and we will discuss how to use it to control the robot car. Step 2)Download and Install WiFiEsp-master library Please download the library zip file from http://osoyoo.com/driver/WiFiEsp-master.zip . In Arduino IDE, click Sketch ->Include Library ->Add .ZIP library , then load above zip file into Arduino. Step 3)Arduino Sketch code Installation: Osoyoo V2 Robot Car can work in two Wifi modes: STA mode and AP mode. The Arduino sketches for these two modes are different. Let's explain these two modes one by one: 1)STA mode In STA mode, V2 Robot Car will be a client device of your LAN router. You need save the SSID name and password of your LAN router in Arduino sketch. Once the sketch is running, your router DHCP service will assign an IP address to your robot car and your APP will use this IP address to access your car. Please download STA mode sketch code from http://osoyoo.com/driver/v2smartcar-lesson6A.zip . Unzip the file downloaded just now, you will see a folder "v2smartcar-lesson6A". Enter into this folder and open the v2smartcar-lesson6A.ino file with Arduino IDE, You need change the code Line 96 and Line 98 : char ssid[] = "YOUR_ROUTER_SSID"; // replace this with your router wifi SSID char pass[] = "YOUR_ROUTER_WIFI_PASSWORD"; // replace with your wifi  password upload the sketch to Arduino. Finally, click the Serial monitor window in upper right corner of Arduino IDE, you will see following result: In above example, your will see an IP address 192.168.50.160 , this is our LAN IP address assigned by my router. Please write down this IP address and later set this IP address to your APP Setting section(no need change default port 80 in APP). Now your Robot is connected to your LAN, you can use Mobile phone under same LAN to control the robot car. If your APP is in WAN, you need to go to your Router Control Panel, forward Port 80 to Robot car LAN IP address, then you can use Router IP to control the car. This feature makes our robot car  A REAL INTERNET OF THING device 2)AP mode Sometimes we do not have a LAN or Wifi Router. In order to control the car, we need to use AP mode. When working in AP mode, our robot car itself will become a Wifi Hot Spot. Our cell phone can connect to Robot Car as its wifi client. The IP address of Robot is fixed as 192.168.4.1 and It is not connected to WAN. In order to work in AP mode, please download sketch from following link: http://osoyoo.com/driver/v2smartcar-lesson6B.zip Unzip above file , you will see a folder "v2smartcar-lesson6B". Open the ino file inside this folder and upload the sketch into Arduino. Finally, open your Arduino Serial monitor.  You will see a similar result as STA mode. A new Wifi SSID "osoyoo_robot" with IP address 192.168.4.1 will show up in the window. This means your Robot car has a Wifi Hot Spot name "osoyoo_robot" , its IP address is 192.168.4.1 Use APP to control your robot car First, download V2car.apk in http://osoyoo.com/driver/v2car.apk , you can also search Osoyoo Wifi Robot Car APP V2 in Google Play and Apple Store. Open your Osoyoo Wifi Robot Car APP, you will see following screen: In AP mode, you need contact your cell phone to "osoyoo_robot" wifi hot_spot, In STA mode, you need connect cell phone to the same LAN ssid of your robot car. Now click Setting to set up robot IP address. In STA mode, set IP address same as the Robot IP showed in Arduino Serial Monitor. In STA mode , set IP address as 192.168.4.1 Use 80 as default port number in both modes. Now you can click the < > ^ v direction keys to make the car move. Use || pause key to stop the car movement. If you click Obstacle key, the car will do obstacle avoidance auto driving similar to  Lesson 5 If you click Tracking key, the car will do link tracking auto driving similar to lesson 4