Raspberry Pi Raspberry Pi entry-1- Notes basic configuration

System installation Noobs

noobs are suitable for novice guidance system, the official suggested initial configuration of choice for Raspberry Pi, but larger, installation trouble, burned directly into the system much simpler.

Set raspberry pi tutorial   https://projects.raspberrypi.org/en/projects/raspberry-pi-setting-up/3

下载NOOBS,https://www.raspberrypi.org/downloads/noobs/

Prepare a SD card, you need to format

After the download is complete decompression, larger files, copy files to SD root directory.

image_thumb2

Peripheral connectivity raspberry pie, mouse and screen

SD card is inserted, energized, an initial start, for noobs guides installation system, like e.g. raspbian

Download the package off-line and online.

System installation raspbian

raspbian system is the official system, offers a variety of versions, can be installed by noobs, you can download image files directly to install.

Download the official website: https://www.raspberrypi.org/downloads/raspbian/

Personally do not recommend the official website to download the system, including download noobs, Suman them to wait a day, these resources will be able to get links in the network disk or micro-letter search the following, please download

Installation System Preparation

Need a lot of basic hardware, sd card reader is essential, cable, mouse, keyboard, router, these external devices can make the screen easier to install

The software includes the following

1. SD Formatter (formatted sd card)

2.Win32DiskImager (programming system image)

3.putty (ssh remote connection Raspberry Pi)

Programming step is very simple, the card is formatted sd ---- programmer mirror, little introduction, it is noted that the programming is done by sd card, rewrite the configuration file ssh.

Raspberry Pi connected to complete the basic configuration

For the screen, keyboard, mouse, have, the Raspberry Pi can be set independently, you do not need to complete the basic configuration of computer communications

有一点需要说明,屏幕连接之后,树莓派有屏保功能,长时间没有活动,屏幕会熄灭,而不是没有连接成功。

下面结合网上经验总结几点可行方案

1网线连接树莓派

网线连接需要笔记本,或者路由器,

笔记本连接是通过网络共享的方式实现,通过网线将笔记本和树莓派连接,在网络和共享中心,设置无线网络属性,勾上共享

共享之后通过cmd命令

arp -a

可以找到树莓派对应的ip地址

而路由器连接一般会自动分配,通过登入路由器后台,可以查看ip地址,而且会显示出设备名称,更加容易找出对应地址

2无线连接树莓派

在boot目录下 新建文件 wpa_supplicant.conf
写入网络配置:

country=CN
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
ssid="NETGEAR48-5G"
psk="passwd"
key_mgmt=WPA-PSK
priority=1
}

ssid:网络的ssid
psk:密码
priority:连接优先级,数字越大优先级越高(不可以是负数)

参考链接:http://www.imooc.com/article/268242

无线连接之后,同样在路由器的后台查看IP地址,或者其他ip查看工具。

3串口线连接树莓派

用串口线的4根线连接

控制台-树莓派

5V-5V

GND-GND

RX-TXD(GPIO14)

TX-RXD(GPIO15)

安装驱动

PUTTY设置

连接设置为串口(Serial),波特率115200,设置串口COM端口(通过设备管理器查看)

putty连接树莓派

下载 www.putty.org

获得ip地址之后,两种方式都需要在sd卡,新建一个ssh文件,无后缀,已开启初次ssh连接。

有了ip地址,并且添加了ssh文件,就可以通过putty连接上树莓派

SSH连接树莓派

第一次连接上树莓派首先启用SSH 可以使用

$ sudo raspi-config

在interfaces 选项

设置完成之后,可以开启其他camera,vnc,设置无线网络等设置,完成之后输入指令

sudo reboot

重启

RDP远程连接

树莓派安装xrdp

sudo apt-get upddate
sudo apt-get install xrdp

win打开附件的远程连接桌面

树莓派静态IP设置

方法一、使用路由器设置

使用浏览器登录路由器,在地址栏输入:192.168.1.1,然后回车,默认的账号密码都是admin。部分路由器可能不是这个地址,可以从路由器背面查看操作引导。

image

image

点击保存即可。MAC地址可以在树莓派终端下输入:

pi@raspberrypi:~ $ ifconfig -a

方法二、指令修改
修改/etc/network/interfaces文件设置(这个方法不适用于本人的树莓派2b)

终端下输入

pi@raspberrypi:~ $ sudo nano /etc/network/interfaces

原先网卡IP是从DHCP服务器获取的,找到下面这一句

iface eth0 inet dhcp

我们需要改为静态IP,将这一句替换为如下内容,如果找不到这一句就直接填写下面的内容到文件最后

iface eth0 inet static

#固定IP地址

address 192.168.1.201

#掩码,可以登录路由器查看

netmask 255.255.255.0

#网关,可以登录路由器查看

gateway 192.168.1.1

#DNS服务器

dns-nameservers 114.114.114.114

eth0是有线网卡,如果连接的是无线网络,把eth0改成wlan0

iface wlan0 inet static

address 192.168.1.202

netmask 255.255.255.0

gateway 192.168.1.1

dns-nameservers 114.114.114.114

树莓派打开interfaces出现以下代码需要更改dhcpcd.conf文件

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

输入

sudo nano /etc/dhcpcd.conf

文件打开后也会有例子提示怎么添加,在文件后面添加以下代码

interface wlan0
static ip_address=192.168.1.11/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1

第一个是网卡名字,有线网卡一般为eth0,第二是IP地址,第三是路由器网关,最后是DNS

更改完成重启

sudo reboot

方法三、进入桌面设置(这个方法最简单,但是要有屏幕显示)

右键点击菜单栏上面网络的图标,进入网络设置

image

image

根据上面4个填写即可

修改时区

sudo raspi-config

根据提示选择上海的市区

locallisationg optiongs->change timezone->asia->shanghai

显示时钟指令

date

Change Password command

passwd

Or configuration interface

sudo raspi-config

Guess you like

Origin www.cnblogs.com/nightowl/p/raspberry.html