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 连接,如果连接成功,那就没有问题了。

  • 相关阅读:
    分布式id生成
    DB主从一致性架构优化4种方法
    Mysql在大型网站的应用架构演变
    win10下iis绑定局域网ip无效的解决方案
    css随笔
    html标签说明
    C# JSON序列化日期格式问题
    使用事件机制相比直接调用函数的优势
    C#绑定事件时使用匿名函数
    C# t4模版引擎笔记 引入外部dll
  • 原文地址:https://www.cnblogs.com/stulzq/p/13951431.html
Copyright © 2011-2022 走看看