树莓派装机笔记

版权声明:本文为博主原创文章,转载注明:转载自 https://blog.csdn.net/weixin_39871788/article/details/78780353

树莓派装机笔记

1.     烧写系统

2.     打开配置

sudo raspi-config

其中选择Expand Filesystem扩展文件系统、Overscan让屏幕内容全屏显示、Change Keyboard Layout改变键盘布局为英语(美国)

3.     安装中文字体

sudo apt-getupdate

sudo apt-get install ttf-wqy-zenhei ttf-wqy-microhei

4.     安装中文输入法

sudo apt-get install fcitx fcitx-googlepinyin fcitx-module-cloudpinyinfcitx-sunpinyin

5.     在图形界面配置其余需要选项

6.     改变更新源

sudo apt-get update

sudo vi /etc/apt/sources.list

修改为

debhttp://mirrors.ustc.edu.cn/raspbian/raspbian/ stretch main non-free contrib
deb-srchttp://mirrors.ustc.edu.cn/raspbian/raspbian/ stretch main non-free contrib
#debhttp://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi
# Uncomment line belowthen 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/stretch main contrib non-free rpi


7.     更新vim

sudo apt-get install vim

sudo vim ~/.vimrc   配置vim如下:

set nocompatible  
set number  
filetype on   
set history=1000   
color evening  
syntax on   
set autoindent  
set smartindent  
set tabstop=4  
set shiftwidth=4  
set showmatch  
set guioptions-=T  
set vb t_vb=  
set ruler  
set nohls  
set incsearch  
if has("vms")  
    set nobackup  
else  
    set backup  
endif  


8.     安装远程桌面

sudo apt-getinstall xrdp

然后即可通过windows远程桌面连接到树莓派(输入树莓派ip以及用户名和密码)

9.     安装samba

sudo apt-get install samba samba-common-bin

sudo vim/etc/samba/smb.confa

a)开启用户认证,找到“#####Authentication #####”,将“#  security = user ”的井号去掉。

b)配置用户可以读写自己的home 目录,在“[homes]”节中,把 “readonly = yes” 改为 “read only = no” 

c)找到browseable=no改为yes 否则等会访问时此文件夹会隐藏

       sudo/etc/init.d/samba restart

       sudosmbpasswd -a pi

会提示你输入密码

windows访问,任意打开一个文件浏览器,输入ip地址:例如\\172.20.223.91\pi就可以从其它机器上访问 pi 这个用户的 home 目录了。

10.  安装code::blocks

sudo apt-get install codeblocks

11.  安装qt

sudo apt-getinstall qt5-default

sudo apt-get install qtcreator

sudo apt-get install qt-sdk

由于Qt Creator不能自动识别树莓派上的工具链,因此需要手动添加。点击Tools -> Options打开配置对话框,在Build & Run-> Kits选项卡中点击Add。Compiler设置为/usr/bin/gcc,Debugger可设置为/usr/bin/gdb,Devices type选择Desktop,Device选择local,qt version选择/usr/bin/qmake。

安装完毕,若使用了wiringPi库,需打开源码.pro文件,在最后加上一行LIBS += -lwiringPi

12.  安装opencv

sudo apt-get install libcv-dev-*

动态链接库位于/usr/lib/arm-linux-gnueabihf目录下libopencv开头的so 文件

头文件位于/usr/include目录下opencv和opencv2文件夹下

13.  安装wiringPi

官方已经集成自带,动态链接库位于/usr/lib目录下

头文件位于/usr/include目录下wiringPi.h

14.  安装Arduino

sudo apt-get install arduino

猜你喜欢

转载自blog.csdn.net/weixin_39871788/article/details/78780353