家里有台老式电视,又没有接入有线,也没有买机顶盒,恰巧这几天买了一个树莓派,于是就想着让树莓派充当一个”电影播放员”的角色.
树莓派系统的安装
买来的树莓派只是一个板子,我们要先给他安装一个操作系统. 这里使用的是淘宝卖家给的respbian,即一个经过优化的debian系统.
安装过程非常简单, 使用Win32Write
给树莓派扩容
默认情况下树莓派并没有给你的SD卡使用全部的空间
- 执行
df -h
查看磁盘空间 - 执行
1
sudo raspi-config
给树莓派扩容,使用默认选项,让系统占用所有的SD卡空间.
安装远程控制软件teamview
首先,去下载teamview的debian版软件,注意,这里需要arm架构的.
然后执行如下命令:1
dpkg -i teamviewer-host_12.1.83885_armhf.deb
这里会报各种依赖问题,执行如下命令解决依赖问题:1
apt-get -f install
依赖安装完成后,重新执行一下安装命令.然后等待软件安装完成,然后重启树莓派.
使用teamviewer info命令查看一下当前的id:1
2
3
4
5
6
7
8
9
10
11
12
TeamViewer 12.1.83885 (DEB)
TeamViewer ID: xxxxxxx
teamviewerd status ● teamviewerd.service - TeamViewer remote control daemon
Loaded: loaded (/etc/systemd/system/teamviewerd.service; enabled)
Active: active (running) since Sun 2018-03-25 09:30:02 UTC; 33s ago
Process: 499 ExecStart=/opt/teamviewer/tv_bin/teamviewerd -d (code=exited, status=0/SUCCESS)
Main PID: 584 (teamviewerd)
CGroup: /system.slice/teamviewerd.service
└─584 /opt/teamviewer/tv_bin/teamviewerd -d
xxxxxx 就是你的teamviewer id
因为此时我们并没有外接显示器,所以我们使用命令行的方式接受teamview的使用协议:1
sudo teamviewer license accept
使用:1
sudo teamviewer passwd xxxxx
设置你的访问密码
然后将你的树莓派绑定到你的teamviewer账户中(没有账号的话去申请一个,免费)1
sudo temaviewer setup
绑定成功后,你会看到如下输出:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16This short guide helps you to setup TeamViewer on this device. After you have successfully finished the setup,
this device will automatically be available in your Computers & Contacts.
Please enter your e-mail / username: youremail@123.com
Please enter your password:
*** You have successfully added this computer to your Computers & Contacts. You can now access it with a simple
double click in your Computers & Contacts list. ***
远程访问
设置完成后,在你的pc中打开teamviewer 输入你树莓派的viewer id即可连接
然后就可以在没有键鼠的情况下,远程操作树莓派了.
安装播放器
本来想装Mplayer,后来发现这玩意居然不带UI界面, 然后换成了SMPlayer1
sudo apt-get install smplayer
然后就可以正常地播放了.