查看: 2276|回复: 0

[教程] 【一网打尽】Raspberry Pi Course Week 3 – Day 2.0 (Command Line Wi Fi ...

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

    连续签到: 1 天

    [LV.8]以坛为家I

    发表于 2015-3-27 16:45:05 | 显示全部楼层 |阅读模式
    分享到:

    Connecting the Raspberry Pi to a Wi-Fi network is straight forward providing you have a compatible Wi-Fi adapter.

    If you do not have a compatible wireless adapter then you can purchased one below from Amazon.


    raspberry-pi-compatible-wi-fi-adapter1.png raspberry-pi-compatible-wi-fi-adapter-usa.png

    To achieve this, a file called interfaces needs to be edited with the correct network information.

    What is the interfaces file?
    The interfaces file holds the information required to give the Raspberry Pi access to the wireless network or a wired network.  The file exists in /etc/network/ folder.

    Open a terminal window and enter the following.

    $ sudo nano /etc/network/interfaces

    Nano will load a file similar to this.

    —————————————–

    auto lo


    iface lo inet loopback

    iface eth0 inet dhcp
    allow-hotplug wlan0

    auto wlan0

    iface wlan0 inet dhcp

    wpa-ssid “YOUR_SSID”

    wpa-psk “YOUR-PASSWORD”

    —————————————–

    Edit the last two lines with your SSID and your password.  Your SSID is the network ID that your Wi-Fi router is broadcasting.  Note that your SSID and password need to appear in between the quotes.

    Save the file by pressing CTRL-X followed by Y to overwrite the file.  To be sure that these changes take affect reboot your password by enter the following.

    Before continuing, a quick summary of the file is in order.

    The word auto is used to identify the physical interface files that will be brought on or offline.  The lineauto wlan0 is an example of this.  It will allow wlan0 to be shut down or brought back online when using commands or when the system boots up.

    The iface refers to the interface which is followed by eth0, eth1 or wlan0 etc ,depending on which device it is referencing.    The inet dhcp is informing the raspberry pi that you require an IP address in order to access the network.  Enter the following to restart the system.

    $ sudo reboot

    If you are still having problems connecting see the troubleshooting page on Raspberry Pi Wireless Network SetupIssues.


    回复

    使用道具 举报

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

    本版积分规则

    关闭

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



    手机版|小黑屋|与非网

    GMT+8, 2024-4-25 09:02 , Processed in 0.115852 second(s), 16 queries , MemCache On.

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

    苏公网安备 32059002001037号

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.