• RaspberryPI 3b 技术总结(包括Linux)


    安装系统,无屏幕,无网线,windows下

    • 第一步当然是把ROM(官方系统)和刷写工具备好,TF卡一张,当然必须有读卡设备。
    • 启动Etcher,将ROM刷入TF卡,这需要挺长一段时间,完毕后将会出现四个分区,但是windows只能识别两个,EXT4的linux分区是无法读写的。
    • 完毕后,默认TF卡已经弹出系统,重新拔插,并且定位到boot分区,在分区的根目录下新建一个文件【ssh】,注意只有三个字母,没有扩展名。这一步操作表示初始化系统后支持远程连接。
    • 继续新建第二个文件【wpa_supplicant.conf】,这一步操作表示初始化后自动连接wifi网络。
    • 使用稍微高级一点的文本编辑器,打开刚才新建的第二个文件,设置换行标准为unix(notepad++为:Edit→EOL Convertion→UNIX Format),这将启用类unix系统的文本支持。

    wpa_supplicant.conf

    country=cn
    update_config=1
    ctrl_interface=/var/run/wpa_supplicant
    
    network={
    scan_ssid=1
    ssid="MyNetworkSSID"
    psk="MyNetworkPassword"
    }
    
    • 两个文件都创建好,第二个文件也设置好WIFI网络,就可以将TF卡插入树莓派,开机初始化了。
    • 局域网的windows机器,运行PuTTY,“Host Name”填入【raspberrypi】,点击“Open”连接树莓派,等待命令行输出:login as。则表示成功连接至树莓派。
    • 输入登录用户【pi】密码【raspberry】,即可开始远程操作树莓派。

    官方系统Raspbian:https://www.raspberrypi.org/downloads/raspbian/
    刷写工具Etcher:https://www.balena.io/etcher/
    远程连接PuTTY:https://www.putty.org
    参考资料:http://www.thinkingcog.com/post/2017/12/23/setup-raspberry-pi-in-a-headless-mode.aspx


    移动硬盘映射相关

    树莓派自带的usb供电可能无法供给比较耗电的设备,所以推荐准备好外部电源,比如双公头usb辅助供电,带电源的usb-hub。
    映射,树莓派现在的系统都自动识别了,理论上的流程是:添加ntfs分区支持、查看硬盘分配标识、创建映射目录、使用命令映射、自启动映射。


    创建系统服务相关

    linux服务所在目录为【/lib/systemd/system】

    创建aria2c的daemon服务

    cd /lib/systemd/system
    touch aria2.service
    nano aria2.service
    

    修改文件【/lib/systemd/system/aria2.service】

    [Unit]
     Description=Aria2c download manager
     Requires=network.target
     After=dhcpcd.service
        
     [Service]
     Type=forking
     User=root
     RemainAfterExit=yes
     ExecStart=/usr/bin/aria2c --conf-path=/etc/aria2/aria2.conf --daemon
     ExecReload=/usr/bin/kill -HUP $MAINPID
     RestartSec=1min
     Restart=on-failure
        
     [Install]
     WantedBy=multi-user.target
    

    修改文件【/etc/aria2/aria2.conf】

    # Daemonize, rpc and session save.
    # The daemon is launched by the rpc query and
    # stops when all downloads are completed.
    
    continue
    daemon=true
    on-download-complete=exit
    dir=/home/**youruser**/path/to/download/folder
    save-session=/home/**youruser**/.aria2/session
    input-file=/home/**youruser**/.aria2/session
    max-concurrent-downloads=99999
    seed-ratio=0
    max-connection-per-server=4
    bt-save-metadata
    rpc-save-upload-metadata
    enable-rpc=true
    rpc-listen-all=true
    rpc-user=**youruser**
    rpc-passwd=**yourpassword**
    rpc-listen-port=**yourport** # should be same as in the upstart script
    
  • 相关阅读:
    为ccflow增加禁用用户立刻生效功能
    关于工作流引擎授权问题的需求变更
    sql server 2005 安装过程中出现错误Insatalling performance countter: Cannot create a file when that file already exists.
    web.config中错误
    三个SQL视图查出所有SQL Server数据库字典
    恢复备份的数据库
    sql语句读取excel数据
    It is an error to use a section registered allowDefinition='MachineToApplication' beyond application level. 错误
    DOS命令实现创建文件夹
    如何查看sql server 的版本(网摘)
  • 原文地址:https://www.cnblogs.com/3Tai/p/10915035.html
Copyright © 2020-2023  润新知