Skip to content

Commit

Permalink
新文件: "Raspberry-Pi/Linux \344\270\213\344\275\277\347\224\250\344\27…
Browse files Browse the repository at this point in the history
…0\262\345\217\243\350\277\236\346\216\245\346\240\221\350\216\223\346\264\276"

	新文件:   Raspberry-Pi/README.md
	新文件:   "Raspberry-Pi/\344\275\277\347\224\250\345\221\275\344\273\244\350\241\214\350\256\276\347\275\256\346\240\221\350\216\223\346\264\276\347\232\204 wifi \347\275\221\347\273\234"
	新文件:   "Raspberry-Pi/\346\240\221\350\216\223\346\264\2763b TTL\344\270\262\345\217\243\347\231\273\345\275\225\351\227\256\351\242\230"
	新文件:   "Raspberry-Pi/\346\240\221\350\216\223\346\264\276\347\224\250\345\221\275\344\273\244\350\241\214\346\222\255\346\224\276\351\237\263\351\242\221\343\200\201\350\247\206\351\242\221"
  • Loading branch information
zhrq95 committed Feb 23, 2018
1 parent ed6df5b commit b1ddfbb
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Raspberry-Pi/Linux 下使用串口连接树莓派
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
1、安装 ckermit
sudo apt-get install ckermit

2、编辑配置文件 vim ~/.mykermrc,写入以下内容:
set line /dev/ttyUSB0
set speed 115200
set carrier-watch off
set handshake none
set flow-control none
robust
set file type bin
set file name lit
set rec pack 1000
set send pack 1000
set windows 5

3、# lsmod | grep usbserial
如果有 usbserial,usbserial 33019 1 ch341 之类的信息则说明系统支持USB转串口
如果没有则 sudo apt-get install setserial
插上USB转串口,在终端输入命令 # dmesg | grep ttyUSB0,如果出现连接成功信息,则说明ubuntu系统已经识别该设备。

4、在 root 权限下打开 kermit
sudo kermit -c
出现分割线后,敲回车,再输入树莓派用户名、密码即可
2 changes: 2 additions & 0 deletions Raspberry-Pi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Raspberry-Pi
Learning Raspberry Pi
20 changes: 20 additions & 0 deletions Raspberry-Pi/使用命令行设置树莓派的 wifi 网络
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
1、
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

2、
在文件的底部添加 wifi 信息:
network={
ssid=”zhrq95 – wifi”
psk=”123456789″
key_mgmt=WPA-PSK
}

3、
wpa-supplicant 在几秒钟内应该就会注意到设置已经改变了,并且会尝试去连接这个网络。
如果没有,那么就需要使用 sudo ifdown wlan0 和 sudo ifup wlan0 命令手动重启接口;
或者直接使用 sudo reboot 命令重启树莓派

4、
使用 ifconfig wlan0 命令确认是否已经成功连接上网络:
如果inet addr中已经有地址了,说明树莓派成功连接上了网络;
如果没有,检查 wifi 密码和 ESSID 是否正确。
12 changes: 12 additions & 0 deletions Raspberry-Pi/树莓派3b TTL串口登录问题
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
树莓派3b 的主控芯片内部,将串口分配改了芯片内部集成的蓝牙,所以导致串口不能使用(Putty连接后会一直保持黑屏)。
为了能够使用 TTL 串口登录树莓派,需要修改根文件夹下 boot 里的 config.txt 文件。

输入命令:
pi@raspberrypi:~ $ sudo nano /boot/config.txt

打开config.txt文件,在最后一行加上
dtoverlay=pi3-miniuart-bt

保存退出,重启启动树莓派,就可以使用TTL串口登录了

注:若在树莓派3启动完成后,打开串口登录,需要先回车,要不然不会跳到输入用户名
13 changes: 13 additions & 0 deletions Raspberry-Pi/树莓派用命令行播放音频、视频
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
sudo apt-get install omxplayer
一般系统默认已经安装好了
播放视频需要通过 HDMI 连接到显示器看

sudo omxplayer -r -o [both,local,hdmi] 文件名
例:
omxplayer -o hdmi /path/to/filename.mp4

-o 说明了输出源,-o hdmi 表示音频直接通过 HDMI 播放
-r 说明全屏幕播放
'+' 和'-'按键控制播放的声音大小
按左右箭头快进
按 q 退出

0 comments on commit b1ddfbb

Please sign in to comment.