玩树莓派(raspberry pi) 2/3 raspbian的遇到的一些问题

简介:   raspberry pi买回来玩了一段时间,现在就记录一下入门遇到的一些问题吧。 首先是烧写镜像,和安装电脑系统是一样的道理。 先要有一个制作一个U启动盘。先将SD卡格式化,再用Win32DiskImager或dd命令将raspberry官方下载的镜像烧写进去(这种文档很多的,随便找一个都可以完成操作)。

 

raspberry pi买回来玩了一段时间,现在就记录一下入门遇到的一些问题吧。

首先是烧写镜像,和安装电脑系统是一样的道理。

先要有一个制作一个U启动盘。先将SD卡格式化,再用Win32DiskImager或dd命令将raspberry官方下载的镜像烧写进去(这种文档很多的,随便找一个都可以完成操作)。

使用dd时可能很慢,那么请用:

sudo dd if=/location/of/raspbian.img of=/dev/rdisk1 bs=1m
/dev/rdisk1表示是U盘设备,最好不用/dev/disk1,因为后者慢。详细参见:http://serenity.ee/post/82120938429/mac-os-dd-with-devdisk-vs-devrdisk

将SD卡插到板子上就会自动加载镜像了,最后出来界面如下:

  如果完成上面这些步骤,就可以将键盘鼠标插入板子上。将无线鼠标插上去反应很慢,很卡的我换了有线鼠标就没事了,网上说可以改变鼠标的反应时间,后来插入另一个无线鼠标正常也就没有管它了。

设置键盘

  后面想试下打印一个hello world!发现#include的#号打不出来,出来£,并且输入@出来了"。我也是一脸懵。后来去群里面问人才知道更改输入法,因为UK和US使用的习惯不同。具体操作:

 

系统设置

  之后想试试自己的板子的音频输出是否正常,接上耳机除了有点杂音意外功能还是正常的,试试蓝牙音响,用蓝牙配对上了蓝牙音响就是没有声音,后面也是在网上找到方法可以选择音频输出的选项,找到右上角那个下喇叭右键就会出现选项就可以了。也试过通过sudo raspi-config来更改,但是就是找不到蓝牙的选项,所以还是通过图像界面这种方法更改。(吐槽下raspberry的音频真的不咋地)

  基本外设都可以,看群里面的人都在研究远程登录界面,之前学校培训过一些LINUX的皮毛,知道远程登录挺方便的,可以不用再开一个显示器给树莓派用。先试了一个简单的SSH连接,这个是连接terminal命令窗口的,如果说想学linux的话这个就足够了。具体教程网上也是有很多的,记得一点是raspberry默认SSH是DISABLE的,需要通过sudo raspi-config来开启,不然是连接不上的。

  之后我就想用下真正的远程桌面了,网上也是有很多的教程,特别的简单,但是我在安装xrdp的时候一直提示连接不上,不能成功安装。

pi@raspberrypi:/ $ sudo apt-get install xrdp
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  ssl-cert x11-apps x11-session-utils xbitmaps xfonts-75dpi xfonts-scalable xorg xorg-docs-core xorgxrdp
Suggested packages:
  openssl-blacklist xorg-docs x11-xfs-utils guacamole
The following NEW packages will be installed:
  ssl-cert x11-apps x11-session-utils xbitmaps xfonts-75dpi xfonts-scalable xorg xorg-docs-core xorgxrdp xrdp
0 upgraded, 10 newly installed, 0 to remove and 1 not upgraded.
Need to get 4 75 kB/49 26 kB of archives.
After this operation, 97 62 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err:2 http://mirrordirector.raspbian.org/raspbian stretch/main armhf xrdp armhf 0.9.1-9
  404  Not Found [IP: 93.93.128.193 80]
Err:1 http://101.110.118.74/mirrordirector.raspbian.org/raspbian stretch/main armhf xorgxrdp armhf 0.9.1-9                                                   
  Could not connect to 101.110.118.74:80 (101.110.118.74), connection timed out
E: Failed to fetch http://101.110.118.74/mirrordirector.raspbian.org/raspbian/pool/main/x/xrdp/xorgxrdp_0.9.1-9_armhf.deb  Could not connect to 101.110.118.74:80 (101.110.118.74), connection timed out
E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/x/xrdp/xrdp_0.9.1-9_armhf.deb  404  Not Found [IP: 93.93.128.193 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

  

  我一直以为是自己家里网络限制不能连接上,让后网上找了很多资料都不行,最后看见提示后面的E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?,我才想起来我系统装完一直没有updata过,所以赶紧apt-get update,等一会更新完了,在运行sudo apt-get install xrdp,就欻欻的往下跑了,在输入sudo -apt-get install tightvncserver一切都搞定!

 
 

禁止休眠

步骤

1.打开lightdm.conf

sudo vi /etc/lightdm/lightdm.conf

2.修改lightdm.conf

找到[SeatDefaults]段下的’xserver-command’,取消注释,修改为如下:

#xserver-command=X

修改为

xserver-command=X -s 0 -dpms
  • -s # –设置屏幕保护不启用
  • dpms 关闭电源节能管理

3.重启

  reboot


镜像源不可用或超时

国内连接 opencas.cn and update sources.list. 超时
#1) edit the sources.list by typing
sudo vi /etc/apt/sources.list

#2) Change
#deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
#to 
deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi

#3) add the line
deb http://mirrors.shu.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi

#4) Run the following
sudo apt-get update && sudo apt-get -y dist-upgrade && sudo apt-get update

 

总结:

  升级固件、系统,千万不要用Ubuntu mate什么的,最好用官方推荐的raspbian,稳定、高效。 

 

  上个图吧(ELK dashboard):

 

谋胆并重
目录
相关文章
|
Linux
Raspberry Pi 4B树莓派学习笔记
Raspberry Pi 4B树莓派学习笔记
351 0
Raspberry Pi 4B树莓派学习笔记
|
Linux 开发者
使用QEMU模拟树莓派Raspberry Pi
使用QEMU模拟树莓派Raspberry Pi
470 0
使用QEMU模拟树莓派Raspberry Pi
|
数据安全/隐私保护 网络架构
树莓派安装Debian-Pi-Aarch64桌面全功能版
树莓派安装Debian-Pi-Aarch64桌面全功能版
392 0
树莓派安装Debian-Pi-Aarch64桌面全功能版
|
物联网 Linux API
如何将Alexa添加到Raspberry Pi(或任何Linux设备)
我们的Amazon Alexa虚拟设备项目旨在提供将Alexa添加到任何Linux设备(包括Raspberry Pi板等嵌入式系统)的功能。
605 0
如何将Alexa添加到Raspberry Pi(或任何Linux设备)
|
Web App开发 网络安全 数据安全/隐私保护