zoukankan      html  css  js  c++  java
  • 树莓派鼓捣记

    树莓派是自带有无线网卡的,所以可以连接 wifi。

    本文的树莓派系统环境是 Ubuntu Server 20.04,其他 Linux 系统都大同小异。

    ssh 进入树莓派。

    1.第一步设置时区

    sudo tzselect
    
    # 选择4 Aisa
    
    # 然后选择9 China
    
    # 接着选择1 Beijing Time
    
    # 最后选择1 确认
    
    sudo cp /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime
    

    设置完成后执行 date -R 看时间是否准确。

    2.设置 wifi

    cd /etc/netplan/
    sudo vim 50-cloud-init.yaml
    

    打开后应该会有以下内容:

    # This file is generated from information provided by the datasource.  Changes
    # to it will not persist across an instance reboot.  To disable cloud-init's
    # network configuration capabilities, write a file
    # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
    # network: {config: disabled}
    network:
        ethernets:
            eth0:
                dhcp4: true
                optional: true
        version: 2
    
    

    现在需要加一个wifi的配置,示例如下:

    # This file is generated from information provided by the datasource.  Changes
    # to it will not persist across an instance reboot.  To disable cloud-init's
    # network configuration capabilities, write a file
    # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
    # network: {config: disabled}
    network:
        ethernets:
            eth0:
                dhcp4: true
                optional: true
        wifis:
            wlan0:
                dhcp4: true
                access-points:
                    <wifi名字>:
                        password: "<wifi密码>"
        version: 2
    

    编辑完成后保存,然后执行命令

    sudo netplan --debug apply
    

    3.检查设置

    执行命令 ifconfig 检查是否有网卡 wlan0 的信息,并且获取到了ip,最后通过这个ip进行 ssh 连接,如果连接成功,那就没有问题了。

  • 相关阅读:
    237. Delete Node in a Linked List
    430. Flatten a Multilevel Doubly Linked List
    707. Design Linked List
    83. Remove Duplicates from Sorted List
    160. Intersection of Two Linked Lists
    426. Convert Binary Search Tree to Sorted Doubly Linked List
    142. Linked List Cycle II
    类之间的关系
    初始化块
    明确类和对象
  • 原文地址:https://www.cnblogs.com/stulzq/p/13951431.html
Copyright © 2011-2022 走看看