58
Program Analysis and Explanation
Abstract
From the perspective of software, the smart car is of C/S structure. The TCP server program is
run on Raspberry Pi to listen to the command from the client and control the car accordingly.
The client program is run on the PC and connected with the server through the TCP, which
provides the user with a graphical user interface (GUI) to conveniently control the Raspberry
Pi remotely. Both the client and server programs are written in Python.
Make sure that the circuit is connected properly. Power the smart car, log in the Raspberry
Pi remotely, go to the directory
Sunfounder_Smart_Video_Car_Kit_for_RaspberryPi
and check
the files under it.
cd
~/
Sunfounder_Smart_Video_Car_Kit_for_RaspberryPi
ls
pi@raspberrypi
~/
Sunfounder_Smart_Video_Car_Kit_for_RaspberryPi
$ ls
client datasheet html_server
i2cHelper.py
mjpg-streamer
README.md
server
You can see seven files under the directory:
client
,
datasheet
,
html_server
,
i2cHelper.py
,
mjpg-streamer
, a file
README.md
, and
server
.
Wherein,
client
, the client run on your PC,
datasheet
contains some PDF files about the chip (you need to view them on PC),
html_server
, the web server run on the Raspberry Pi for Android app client,
i2cHelper
, a simple script to help you set up i2c on the Raspberry Pi,
mjpg-streamer
, the camera driver to acquire and upload images,
README.md
, an introduction file with update information,
server
, the server run on the Raspberry Pi for the client on your PC.
Introduction of Socket
The C/S-structure program of the SunFounder Raspberry Pi-based Smart Car is written based
on the socket module of the Python language. Socket wraps and applies the TCP/IP and is
used to describe IP address and port. Also it is a network data structure for computer. The
socket module should be created before the communication of network applications. If the
socket can be said to be the plug of a telephone, which is the lowest layer of communication,
then the combination of IP address and ports can be said to be that of area code and
phone numbers. Only having the hardware for a phone call making is not enough. You still
need to know whom and where to call. An Internet address is composed of the essential IP
address and port for network communication.
SunFounder
Содержание Smart Video Car Kit B+
Страница 5: ...2 Components A Acrylic Plates S u n F o u n d e r ...
Страница 9: ...6 USB Wi Fi adapter 1 USB camera 1 18650 2 Battery holder 1 Ribbon 1 USB cable 1 S u n F o u n d e r ...
Страница 30: ...27 The whole picture of wiring should be like this S u n F o u n d e r ...
Страница 57: ...54 S u n F o u n d e r ...
Страница 65: ...62 Process Diagram of Client Program S u n F o u n d e r ...