• 树莓派Raspbian 学习笔记 一路踩坑,各种问题 各种解决 , 开机自动连接指定Wi-Fi


    如果你只有一块树莓派的裸板,没有显示器,没有串口工具,怎么办?

    可以收集共享wifi,然后电脑和树莓派都连接到这个wifi,就可以ssh啦,

    当然还要在sd卡跟目录建一个ssh文件  使得派能自动开启ssh。

    步骤很简单:
    1.将装有完整Raspbian系统镜像的SD卡通过读卡器连接至电脑;
    2.在根目录下新建一个名为“wpa_supplicant.conf”的空白文件,并添加以下内容(不包括注释部分)

    country=CN
    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1
    network={
        ssid="目标Wi-Fi名称"	#注意区分大小写
        psk="目标Wi-Fi密码"	#注意区分大小写
    }
    

      

    换源

    1. 在terminal中输入:
    sudo nano /etc/apt/sources.list
    1. 注释掉源文件中的内容,更换为阿里源:
    deb http://mirrors.aliyun.com/raspbian/raspbian/ stretch main contrib non-free rpi
    deb-src http://mirrors.aliyun.com/raspbian/raspbian/ stretch main contrib non-free rpi
    1. 打开并编辑/etc/apt/sources.list.d/raspi.list文件
    sudo nano /etc/apt/sources.list.d/raspi.list
    1. 注释掉源文件内容,更换为:
    deb http://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian/ stretch main ui
    deb-src http://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian/ stretch main ui
    1. 更新软件源列表
    sudo apt-get update




    现在的问题是如何开机自启vncserver?

    1. 打开terminal,输入以下打开设置
    sudo raspi-config
    1. 选择Interfacing Options->VNC->选择yes 等待完成
    2. 打开初始化文件
    sudo vim /etc/init.d/vncserver
    

    并粘贴以下内容,粘贴后 按 ctrl+X 保存并退出:

    #!/bin/sh
    ### BEGIN INIT INFO
    # Provides: vncserver
    # Required-Start: $local_fs
    # Required-Stop: $local_fs
    # Default-Start: 2 3 4 5
    # Default-Stop: 0 1 6
    # Short-Description: Start/stop vncserver
    ### END INIT INFO
    # More details see:
    # http://www.penguintutor.com/linux/vnc
    ### Customize this entry
    # Set the USER variable to the name of the user to start vncserver under
    export USER='pi'
    ### End customization required
    eval cd ~$USER
    case "$1" in
    start)
    # 启动命令行。此处自定义分辨率、控制台号码或其它参数。
    su $USER -c '/usr/bin/vncserver -depth 16 -geometry 1920x1200 :1'
    echo "Starting VNC server for $USER "
    ;;
    stop)
    # 终止命令行。此处控制台号码与启动一致。
    su $USER -c '/usr/bin/vncserver -kill :1'
    echo "vncserver stopped"
    ;;
    *)
    echo "Usage: /etc/init.d/vncserver {start|stop}"
    exit 1
    ;;
    esac
    exit 0
    
    1. 修改权限
    sudo chmod 755 /etc/init.d/vncserver
    1. 添加开机启动项
    sudo update-rc.d vncserver defaults
    1. 重启树莓派
    sudo reboot
    

    安装samba  提示依赖错误的解决办法

    https://jingyan.baidu.com/article/6b1823090fa81bfa59e1594e.html

    https://www.cnblogs.com/sailifsh-lyh/p/10961270.html

    开机启动    编辑/etc/rc.local文件

    在最后加上

    sudo /etc/init.d/smbd restart
    sudo /etc/init.d/nmbd restart

    配置串口

    https://blog.csdn.net/qq_16775293/article/details/97891715 

    安装QT开发环境

    1. pi@raspberrypi:~ $ sudo apt-get update
    2. pi@raspberrypi:~ $ sudo apt-get install qt5-default
    3. pi@raspberrypi:~ $ sudo apt-get install qtcreator
    4. pi@raspberrypi:~ $ sudo apt-get install qtmultimedia5-dev
    5. pi@raspberrypi:~ $ sudo apt-get install libqt5serialport5-dev
    

      

     这个也算是交叉编译了吧

     https://blog.csdn.net/little_bobo/article/details/72329770?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-5.baidujs&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-5.baidujs

    python can总线

    https://zhuanlan.zhihu.com/p/173648955?utm_source=wechat_session

  • 相关阅读:
    JavaScript-数学对象与定时器
    JavaScript(八)-字符串与数组
    嵌入式的笔试题目(1)
    更改登录使用的默认shell的方法
    查看当前Linux 命令行使用的shell 的方法
    启动引导程序 Bootloader
    Debian 系(Deepin, Ubuntu, Linuxmint等)包管理工具
    ubuntu 服务器 samba 局域网内 如何添加samba user
    win10 和 树莓派3b+ 处于同一wifi环境(同一网段), win10 无法ping 通 树莓派3b+
    数据结构概念
  • 原文地址:https://www.cnblogs.com/crazyxu/p/14354109.html
Copyright © 2020-2023  润新知