查看: 2087|回复: 0

[教程] 【一网打尽】LEARN RASPBERRY PI (5 of 13)

[复制链接]
  • TA的每日心情
    开心
    2016-8-4 10:56
  • 签到天数: 242 天

    连续签到: 1 天

    [LV.8]以坛为家I

    发表于 2015-3-30 21:23:38 | 显示全部楼层 |阅读模式
    分享到:
    Overview SIMON MONK

    In this lesson you will learn how to remote control your Raspberry Pi with a console cable.

    learn_raspberry_pi_overview.jpg
    The great advantage of connecting this way is that it can even supply the power for your Pi and you do not need keyboard, mouse or display attached to the Pi to log into it.
    You will need to install terminal emulation software (Putty) if you are using Windows and also USB drivers for the Console Lead. The Mac Terminal comes with its own software.
    The Raspberry Pi uses its built-in serial port to allow devices to connect to its console and issue commands just as if you were logged in.
    In the next lesson, we will look at another way of doing much the same thing but over a local network using something called SSH.

    You Will Need SIMON MONK

    To follow this lesson, you will need:
    Part
    learn_raspberry_pi_F01_01.jpg
    Raspberry Pi
    learn_raspberry_pi_console_cable (1).jpg
    Adafruit Console Lead
    This cable has 3.3V logic levels so its safe to use, but not all cables are 3.3V! Only use the Adafruit console cable for this tutorial to avoid damaging your Pi's GPIO pins


    Software Installation (Mac) SIMON MONK

    OSX includes terminal emulation software that you can use from the command line, so we only need to install the USB drivers for the cable.
    Check out the most recent Mac Driver from prolific
    If using Lion or Mountain Lion or later OS X, try this driver here http://changux.co/osx-installer-to-pl2303-serial-usb-on-osx-lio
    Both downloads are standard Mac installers. Accept all defaults when prompted.


    learn_raspberry_pi_mac_usb_install.png
    Software Installation (Windows) SIMON MONK

    Download and install Putty from here: http://www.putty.org/
    From the list of downloads select the binary called just "putty.exe" from the section "For Windows on Intel x86". This will prompt you to save the file. Save it onto the Desktop for now.

    Note that this actually saves the Program itself not an installer. Simply double click putty.exe to run putty!

    Install PL2303 Drivers from here: http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=225&pcid=41
    This will save a zip file called “PL2303_Prolific_DriverInstaller_v1_7_0.zip”. Unzip this onto the desktop and within the folder run the installer called “PL2303_Prolific_DriverInstaller_v1.7.0.exe”.

    The current PL2303 console cables are not compatible with Windows 8!

    learn_raspberry_pi_win_install_1.png
    learn_raspberry_pi_win_install_2.png
    The driver is installed in such a way that when you later plug in the USB console lead, it will still launch the “Found New Hardware” wizard. If you allow the Wizard to search the Internet and install it should work.

    learn_raspberry_pi_win_driver_install_3.png
    When it has finished installing the driver, you should get this message:

    learn_raspberry_pi_win_driver_install_done_5.png
    Software Installation (Linux) SIMON MONK

    Linux Kernels 2.4.31 and above already have the PL2303 USB driver for the Console Lead built-in, so you should not need to install that.

    Some distributions such as Ubuntu 12.10 do not include the "screen" command. Try running the command "screen" and if you get an error message, you can install it by typing the following command:

    Copy Code


    • sudo apt-get install screen


    Connect the Lead SIMON MONK

    The Console lead has four female connections that can be plugged directly onto the GPIO header of the Raspberry Pi.
    The Adafruit USB console cable has 3.3V logic, so its safe to use with your Pi.

    learn_raspberry_pi_console_cable.jpg
    For this experiment, the serial lead is going to power the Raspberry Pi. So, DO NOT attach the Pi's USB power adapter. If you would rather power the Pi from your USB power adapter then leave the Red lead from the Serial lead un attached.
    The important thing here is to only power it from one source, the USB power adaptor or the Console Lead BUT NOT BOTH.
    Attach the leads as shown below:

    learn_raspberry_pi_gpio_closeup.jpg
    The connections are to the outside pin connections of the GPIO header. See Lesson 4, for more information about the header: http://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/the-gpio-connector

    • The red lead should be connected to 5V,
    • The black lead to GND,
    • The white lead to TXD.
    • The green lead to RXD.
    Check the diagram below if you are not sure about the connections. But note that the connect is being viewed upside down, so rotate the diagram by 180 degrees to compare it with the photograph.

    learn_raspberry_pi_gpio-srm.png

    Now plug in the USB lead and you will see the Pi's power LED should light.


    Test & Configure SIMON MONK

    If you are using a Mac, then all you need to do is open a Terminal window and issue the command:

    Copy Code


    • screen /dev/cu.PL2303-00001004 115200

    The device will have a slightly different name to mine. So, type the line above as far as "cu.PL" then press the TAB key to auto-complete to whatever your device is called, before adding 115200 (which is the baud rate) to the end.

    If you are using Linux then use the command:

    Copy Code


    • sudo screen /dev/ttyUSB0 115200

    To start communication with the Pi, press ENTER and you should see the login prompt from the Pi.
    Here it is running on a Mac.

    learn_raspberry_pi_new_mac_term_screen.png
    and here is what it looks like in Ubuntu.
    learn_raspberry_pi_connected_ubuntu.png
    If you are using a PC, then before you start Putty, you need to know which com port is being used for the cable. You can find this by looking in the Ports section of the Windows Device Manager.

    The Device Manager is accessible from the Control Panel under System.
    learn_raspberry_pi_new_win_devive_mgr_com7.png
    In this case it is COM7 that is in use.

    Now start Putty and you will see a connection window.
    learn_raspberry_pi_new_putty_connection_window.png
    Select a connection type of "Serial" from the radio buttons, then set the speed to 115200 and the serial line to COM7.

    Finally click 'Open' to connect. Remember to press ENTER to start communications.
    learn_raspberry_pi_new_pc_putty_after_login.png
    For a new installation of Occidentalis or Wheezy, the default username is “pi” and the default password is “raspberry”.

    Thats it! You are connected and can use the command line to navigate around your Pi.

    In the next session we will look at using SSH as another means of connecting to your Pi over your local network.













    回复

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /2 下一条



    手机版|小黑屋|与非网

    GMT+8, 2024-3-29 02:07 , Processed in 0.119558 second(s), 17 queries , MemCache On.

    ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

    苏公网安备 32059002001037号

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.