Linux迷+Python粉 - 环境搭建https://blog.pythonwood.com/2017-12-05T13:46:00+08:00树莓派初始化环境搭建的一些事2017-12-05T13:46:00+08:002017-12-05T13:46:00+08:00pythonwoodtag:blog.pythonwood.com,2017-12-05:/2017/12/树莓派初始化环境搭建的一些事/<p>第二波研究树莓派功能了,上次主要是当作linux系统来研究,这次当作只能设备来研究。是奔着遥控式家庭影音的方案来研究的,树莓派的基础环境非常重要,所以从新理一理,记录下来。</p> <h3 id="_1">一、奔着遥控式家庭影音的购买方案<a class="headerlink" href="#_1" title="Permanent link">&para;</a></h3> <p>经比较,树莓派在京东是挺贵的,鉴于是标准化带电子产品,去天猫买<a href="https://s.click.taobao.com/t?e=m%3D2%26s%3Di1ZaWZT35VIcQipKwQzePOeEDrYVVa64K7Vc7tFgwiHjf2vlNIV67pR2%2B%2F9Hp9mCHGUKWrwhgPms9V29auOuBOBgn3DwXo5fTavSczFePlBPv%2F0P2woSTIiNFfNqYeZfZqRIxUL2qmOWt8ptzziuV9VDE9N5gf5%2FRemoLTADB2DGJe8N%2FwNpGw%3D%3D&amp;pvid=10_120.239.178.0_551_1512529291425" title="树莓派天猫链接">树莓派</a>可以了。我没买<span class="caps">SD</span>卡,将旧的class10的16G的<span class="caps">SD …</span></p><p>第二波研究树莓派功能了,上次主要是当作linux系统来研究,这次当作只能设备来研究。是奔着遥控式家庭影音的方案来研究的,树莓派的基础环境非常重要,所以从新理一理,记录下来。</p> <h3 id="_1">一、奔着遥控式家庭影音的购买方案<a class="headerlink" href="#_1" title="Permanent link">&para;</a></h3> <p>经比较,树莓派在京东是挺贵的,鉴于是标准化带电子产品,去天猫买<a href="https://s.click.taobao.com/t?e=m%3D2%26s%3Di1ZaWZT35VIcQipKwQzePOeEDrYVVa64K7Vc7tFgwiHjf2vlNIV67pR2%2B%2F9Hp9mCHGUKWrwhgPms9V29auOuBOBgn3DwXo5fTavSczFePlBPv%2F0P2woSTIiNFfNqYeZfZqRIxUL2qmOWt8ptzziuV9VDE9N5gf5%2FRemoLTADB2DGJe8N%2FwNpGw%3D%3D&amp;pvid=10_120.239.178.0_551_1512529291425" title="树莓派天猫链接">树莓派</a>可以了。我没买<span class="caps">SD</span>卡,将旧的class10的16G的<span class="caps">SD</span>利用上(class10意思是写入速度约<span class="caps">10MB</span>/s)。</p> <ol> <li> <p><strong>我购买并用上的:</strong> <a href="https://s.click.taobao.com/t?e=m%3D2%26s%3DjB5CtrQXlAccQipKwQzePOeEDrYVVa64K7Vc7tFgwiHjf2vlNIV67rCnyOxJms%2BVtTN3K9waqqis9V29auOuBOBgn3DwXo5fTavSczFePlBPv%2F0P2woSTBN3oW5I7sw9oXcuyoAGSVzy%2Flc8YI1OgQvABqsOAyUlBEellxPfI1OiZ%2BQMlGz6FQ%3D%3D&amp;pvid=10_120.239.178.0_533_1512539397311" title="公牛usb插座天猫链接">公牛usb魔方插座</a>,<a href="https://s.click.taobao.com/t?e=m%3D2%26s%3Di1ZaWZT35VIcQipKwQzePOeEDrYVVa64K7Vc7tFgwiHjf2vlNIV67pR2%2B%2F9Hp9mCHGUKWrwhgPms9V29auOuBOBgn3DwXo5fTavSczFePlBPv%2F0P2woSTIiNFfNqYeZfZqRIxUL2qmOWt8ptzziuV9VDE9N5gf5%2FRemoLTADB2DGJe8N%2FwNpGw%3D%3D&amp;pvid=10_120.239.178.0_551_1512529291425" title="树莓派天猫链接">树莓派</a>,<a href="https://s.click.taobao.com/t?e=m%3D2%26s%3DyO9jlKzcxlwcQipKwQzePOeEDrYVVa64K7Vc7tFgwiHjf2vlNIV67jeJ0D4P3i%2B8UOZr0mLjuses9V29auOuBOBgn3DwXo5fs9cRaxJdiKw3LnkA3bZiA%2F6gPESVKznnDfaTZ11r%2FGF6awgoXsc5TKo%2FiSVAKeldcSpj5qSCmbA%3D&amp;pvid=10_120.239.178.6_72377_1512026724825" title="华趸hdmi转vga线带音频带供电"><span class="caps">HDMI</span>转<span class="caps">VGA</span>带供电</a>,带开关按钮线的电源,杜邦线。</p> </li> <li> <p><strong>不用购买就用上的配件:</strong> 红外接收仪(从坏的遥控玩具拆下可用),旧电视遥控器一个,老<span class="caps">VGA</span>显示屏,旧音箱。</p> </li> <li> <p><strong>我购买而还没用的可选配件:</strong> 七彩<span class="caps">RGB</span>的<span class="caps">LED</span>元件,面包板,<a href="https://s.click.taobao.com/t?e=m%3D2%26s%3DfV%2BZ61WfxfkcQipKwQzePOeEDrYVVa64K7Vc7tFgwiHjf2vlNIV67lKP%2BmjvssA7r8hK%2FDw%2Bbm2s9V29auOuBOBgn3DwXo5fs9cRaxJdiKw3LnkA3bZiA0KFaRH2Tl0r%2BlUnyCWbT92Wt8ptzziuVx4DebA4okkCqN5EGMnCL1bGJe8N%2FwNpGw%3D%3D&amp;pvid=10_120.239.178.0_378_1512536718652" title="HDMI转DVI天猫链接"><span class="caps">HDMI</span>转<span class="caps">DVI</span></a>,光敏电阻。</p> </li> <li> <p><strong>我认为不用买的:</strong>&nbsp;小屏幕(退货了),温度感应,五向摇杆,蜂鸣器,触摸感应器等。</p> </li> </ol> <p><img alt="房间树莓派媒体中心" src="https://blog.pythonwood.com/uploads/2017/房间树莓派媒体中心.jpg" title="房间树莓派媒体中心"></p> <h3 id="raspbian">二、树莓派安装官方的raspbian系统并初始化<a class="headerlink" href="#raspbian" title="Permanent link">&para;</a></h3> <h4 id="_2">基础部分教程:<a class="headerlink" href="#_2" title="Permanent link">&para;</a></h4> <p>包括修改Pi密码,修改国内源,显示中文,设置时区为Asia/Shanghai,安装开源中文字体<strong>文泉驿</strong>,安装fcitx谷歌拼音,开启ssh服务,设置wifi连接密码</p> <ol> <li> <p><strong>树莓派上手配置</strong>&nbsp;https://yaogangli.gitbooks.io/raspberry-pi-learning/content/Raspbian.html</p> </li> <li> <p><strong>新手入门树莓派必做的四件事</strong>&nbsp;http://blog.csdn.net/A_lPha/article/details/53116767</p> </li> <li> <p><strong>How to setup multiple WiFi networks?</strong>&nbsp;https://raspberrypi.stackexchange.com/questions/11631/how-to-setup-multiple-wifi-networks/11674</p> </li> <li> <p><strong>ssh服务配置</strong>&nbsp;https://www.raspberrypi.org/documentation/remote-access/ssh/</p> </li> </ol> <h4 id="_3">优化部分教程:<a class="headerlink" href="#_3" title="Permanent link">&para;</a></h4> <p>包括添加u盘自动挂载功能,<span class="caps">VNC</span>服务,优化无网络下树莓派开机时间等</p> <ol> <li> <p><strong>树莓派<span class="caps">USB</span>存储设备自动挂载</strong>&nbsp;http://www.jianshu.com/p/188828d9777a</p> </li> <li> <p><strong>How to change timeout in systemctl</strong>&nbsp;https://unix.stackexchange.com/questions/186162/how-to-change-timeout-in-systemctl</p> </li> <li> <p><strong>安装<span class="caps">VNC</span>服务(tightvncserver)</strong>&nbsp;https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-14-04</p> </li> <li> <p><strong>配置与学习树莓派config.txt配置文件</strong>&nbsp;https://www.zybuluo.com/SiberiaBear/note/328982</p> </li> </ol> <h3 id="_4">三、重要提醒:<a class="headerlink" href="#_4" title="Permanent link">&para;</a></h3> <p>经验证,我安装一大堆东西后,<span class="caps">SD</span>卡使用才4G,其中几百兆是音乐,&nbsp;所以8G卡也是够用的。</p> <p>熟悉Linux环境的话,完成一台树莓派环境配置之后,可随时备份,其它树莓派克隆环境就可以了。具体方法参考另一篇随笔。 <a href="https://blog.pythonwood.com/2017/11/树莓派SD卡Linux系统盘复制,10分钟克隆新机/">树莓派<span class="caps">SD</span>卡Linux系统盘复制,10分钟克隆新机</a></p> <h3 id="_5">四、参考<a class="headerlink" href="#_5" title="Permanent link">&para;</a></h3> <ol> <li> <p>开始 Raspberry Pi 项目前需要知道的 10 件事&nbsp;https://www.digikey.com.cn/zh/articles/techzone/2017/feb/10-things-to-know-before-starting-a-raspberry-pi-project</p> </li> <li> <p>树莓派启动那些事&nbsp;http://elmagnificogi.github.io/tags/#RaspberryPi</p> </li> </ol>