官术网_书友最值得收藏!

Accessing the RC car remotely

You can now control your RC Car, but you certainly want to do this without any connected cables. This section will show you how to add a wireless LAN device so that you can control your car remotely. The first step in doing this is to install a Wireless LAN device. There are several possible ways to do this; however, the one that works well, with full documentation, is described at https://learn.adafruit.com/setting-up-a-raspberry-pi-as-a-wifi-access-point/overview.

You should now be able to connect to your Raspberry Pi via the Wireless Access Point. Once you've created the wireless access point, you can login via a VNC connection, this way you can add a USB webcam to your car to make it even easier to control. To do this, first download an application that can support a VNC connection. You can get this on your Raspberry Pi using an application called vncserver. You'll need to install a version of this on your Raspberry Pi by typing sudo apt-get install tightvncserver in a terminal window on your Raspberry Pi.

TightVNC Server is an application that will allow you to remotely view your complete graphical desktop. Once you have it installed, you can do the following:

  1. You need to start the server by typing vncserver in a terminal window on Raspberry Pi.
  2. You will be prompted for a password and then asked to verify it, then you will be asked if you'd like to have a view-only password. Remember the password that you have entered, you'll need it to remotely login via a VNC Viewer.
  3. You'll need a VNC Viewer application for your remote computer. One choice for Windows users is RealVNC, available at http://www.realvnc.com/download/viewer/. When you run it, you will see the following:
    Accessing the RC car remotely
  4. Enter the VNC Server address, which is the IP address of your Raspberry Pi, and click on Connect. You will get a warning about an unencrypted connection, select Continue and you will get the following pop-up window:
    Accessing the RC car remotely
  5. Type in the password that you entered while starting the vncserver, and you will then get a graphical view of your Raspberry Pi, which looks like the following screenshot:
    Accessing the RC car remotely

You can now access all the capabilities of your system; however, they may be slower if you are doing a graphics-intense data transfer. To avoid having to type vncserver each time you boot your Raspberry Pi, use the instructions given at http://www.havetheknowhow.com/Configure-the-server/Run-VNC-on-boot.html.

Vncserver is also available via Linux. You can use an application called Remote Desktop Viewer to view the remote Raspberry Pi GUI system. If you have not installed this application, install it using the update software application based on the type of Linux system you have. Once you have the software, perform the following steps:

  1. Run the application and you will get the following result:
    Accessing the RC car remotely
  2. Make sure vncserver is running on Raspberry Pi; the easiest way to do this is to log in using SSH and run vncserver at the prompt. Now click on Connect on Remote Desktop Viewer. Fill in the screen as follows, under the Protocol selection, choose VNC, and you will see the following screenshot:
    Accessing the RC car remotely
  3. Now enter the host IP address, make sure you include a :1 at the end and then click on Connect. You'll need to enter the vncserver password that you created when you first ran vncserver on Raspberry Pi, like this:
    Accessing the RC car remotely

You can see the graphical screen of Raspberry Pi. Now you are ready to observe the output of a USB webcam connected to your car. This is quite straightforward, simply plug in a USB webcam and download a video viewer. One such video viewer that works well is luvcview. To install this, type sudo apt-get install luvcview.

With all these tools installed, you can now run vncview, bring up a luvcview window so you can see what your RC Car is seeing and control it remotely by running the xcmodControl.py program that you wrote earlier. The screen will look similar to the following:

Accessing the RC car remotely

There are a lot of additions that you can make to your Raspberry Pi controlled car, such as adding the joystick control or more autonomy. However, let's move on to the next project.

主站蜘蛛池模板: 历史| 安化县| 呈贡县| 高陵县| 车险| 渭南市| 通辽市| 名山县| 东至县| 景东| 多伦县| 苍山县| 乡城县| 色达县| 西盟| 靖江市| 远安县| 社旗县| 崇阳县| 金溪县| 社旗县| 阿巴嘎旗| 柳河县| 运城市| 东乡族自治县| 精河县| 石泉县| 塔城市| 达拉特旗| 辛集市| 湘潭县| 台安县| 正安县| 滕州市| 鹿泉市| 增城市| 吕梁市| 宣威市| 黑山县| 张家界市| 新竹市|