<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WiFi &#8211; 编码无悔 /  Intent &amp; Focused</title>
	<atom:link href="https://www.codelast.com/tag/wifi/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.codelast.com</link>
	<description>最优化之路</description>
	<lastBuildDate>Mon, 27 Apr 2020 18:01:56 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>[原创] 在树莓派的Ubuntu MATE 18.04系统上连接WiFi</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e5%9c%a8%e6%a0%91%e8%8e%93%e6%b4%be%e7%9a%84ubuntu-mate-18-04%e7%b3%bb%e7%bb%9f%e4%b8%8a%e8%bf%9e%e6%8e%a5wifi/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e5%9c%a8%e6%a0%91%e8%8e%93%e6%b4%be%e7%9a%84ubuntu-mate-18-04%e7%b3%bb%e7%bb%9f%e4%b8%8a%e8%bf%9e%e6%8e%a5wifi/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Thu, 05 Dec 2019 16:59:55 +0000</pubDate>
				<category><![CDATA[Raspberry Pi/树莓派]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Ubuntu MATE]]></category>
		<category><![CDATA[WiFi]]></category>
		<category><![CDATA[树莓派]]></category>
		<guid isPermaLink="false">https://www.codelast.com/?p=11223</guid>

					<description><![CDATA[<p>
要查看更多树莓派相关文章，请点击<a href="https://www.codelast.com/?p=5013" rel="noopener noreferrer" target="_blank"><span style="background-color: rgb(255, 160, 122);">这里</span></a>。</p>
<p>树莓派3B(V1.2)有板载WiFi模块，而<a href="https://ubuntu-mate.org/raspberry-pi/" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">Ubuntu MATE</span></a> 18.04也支持它，下面来看看怎么在命令行启用。<br />
<span id="more-11223"></span></p>
<div>
	<span style="color: rgb(255, 0, 0);"><span style="background-color: rgb(0, 255, 0);">▶▶</span></span>&#160;修改网络配置文件，添加WiFi配置内容</div>
<blockquote>
<div>
		cd /etc/netplan</div>
</blockquote>
<div>
	里面只有一个文件：</div>
<blockquote>
<div>
		01-network-manager-all.yaml</div>
</blockquote>
<div>
	备份，然后编辑它：</div>
<blockquote>
<div>
		sudo cp 01-network-manager-all.yaml 01-network-manager-all.yaml.bak<br />
		sudo vim.tiny 01-network-manager-all.yaml</div>
</blockquote>
<div>
	下面的<span style="color:#0000ff;">蓝色</span>部分，是我新添加的内容：</div>
<blockquote>
<div>
		# Let NetworkManager manage all devices on this system</div>
<div>
		network:</div>
<div>
		&#160; version: 2</div>
<div>
		&#160; renderer: NetworkManager</div>
<div>
		<span style="color:#0000ff;">&#160; # below are WiFi info</span></div>
<div>
		<span style="color:#0000ff;">&#160; wifis:</span></div>
<div>
		<span style="color:#0000ff;">&#160; &#160; wlan0:</span></div>
<div>
		<span style="color:#0000ff;">&#160; &#160; &#160; optional: true</span></div>
<div>
		<span style="color:#0000ff;">&#160; &#160; &#160; access-points:</span></div>
<div>
		<span style="color:#0000ff;">&#160; &#160; &#160; &#160; &#34;MyWiFi&#34;:</span></div>
<div>
		<span style="color:#0000ff;">&#160; &#160; &#160; &#160; &#160; password: &#34;my_password&#34;</span></div>
<div>
		<span style="color:#0000ff;">&#160; &#160; &#160; dhcp4: true</span></div>
</blockquote>
<div>
	&#160;</div>
<div>
	其中的&#34;<span style="color:#ff0000;">wlan0</span>&#34;是用 iwconfig&#160;命令得到的网卡名；&#34;<span style="color:#0000ff;">MyWiFi</span>&#34;，则是我的无线网络的SSID；&#34;<span style="color: rgb(0, 0, 255);">my_password</span>&#34;是无线网络的密码。这些参数要根据实际情况修改。</div>
<div>
	保存文件，接着就可以测试这个配置了。<br />
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a></div>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e5%9c%a8%e6%a0%91%e8%8e%93%e6%b4%be%e7%9a%84ubuntu-mate-18-04%e7%b3%bb%e7%bb%9f%e4%b8%8a%e8%bf%9e%e6%8e%a5wifi/" class="read-more">Read More </a>]]></description>
										<content:encoded><![CDATA[<p>
要查看更多树莓派相关文章，请点击<a href="https://www.codelast.com/?p=5013" rel="noopener noreferrer" target="_blank"><span style="background-color: rgb(255, 160, 122);">这里</span></a>。</p>
<p>树莓派3B(V1.2)有板载WiFi模块，而<a href="https://ubuntu-mate.org/raspberry-pi/" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">Ubuntu MATE</span></a> 18.04也支持它，下面来看看怎么在命令行启用。<br />
<span id="more-11223"></span></p>
<div>
	<span style="color: rgb(255, 0, 0);"><span style="background-color: rgb(0, 255, 0);"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/25b6.png" alt="▶" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/25b6.png" alt="▶" class="wp-smiley" style="height: 1em; max-height: 1em;" /></span></span>&nbsp;修改网络配置文件，添加WiFi配置内容</div>
<blockquote>
<div>
		cd /etc/netplan</div>
</blockquote>
<div>
	里面只有一个文件：</div>
<blockquote>
<div>
		01-network-manager-all.yaml</div>
</blockquote>
<div>
	备份，然后编辑它：</div>
<blockquote>
<div>
		sudo cp 01-network-manager-all.yaml 01-network-manager-all.yaml.bak<br />
		sudo vim.tiny 01-network-manager-all.yaml</div>
</blockquote>
<div>
	下面的<span style="color:#0000ff;">蓝色</span>部分，是我新添加的内容：</div>
<blockquote>
<div>
		# Let NetworkManager manage all devices on this system</div>
<div>
		network:</div>
<div>
		&nbsp; version: 2</div>
<div>
		&nbsp; renderer: NetworkManager</div>
<div>
		<span style="color:#0000ff;">&nbsp; # below are WiFi info</span></div>
<div>
		<span style="color:#0000ff;">&nbsp; wifis:</span></div>
<div>
		<span style="color:#0000ff;">&nbsp; &nbsp; wlan0:</span></div>
<div>
		<span style="color:#0000ff;">&nbsp; &nbsp; &nbsp; optional: true</span></div>
<div>
		<span style="color:#0000ff;">&nbsp; &nbsp; &nbsp; access-points:</span></div>
<div>
		<span style="color:#0000ff;">&nbsp; &nbsp; &nbsp; &nbsp; &quot;MyWiFi&quot;:</span></div>
<div>
		<span style="color:#0000ff;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; password: &quot;my_password&quot;</span></div>
<div>
		<span style="color:#0000ff;">&nbsp; &nbsp; &nbsp; dhcp4: true</span></div>
</blockquote>
<div>
	&nbsp;</div>
<div>
	其中的&quot;<span style="color:#ff0000;">wlan0</span>&quot;是用 iwconfig&nbsp;命令得到的网卡名；&quot;<span style="color:#0000ff;">MyWiFi</span>&quot;，则是我的无线网络的SSID；&quot;<span style="color: rgb(0, 0, 255);">my_password</span>&quot;是无线网络的密码。这些参数要根据实际情况修改。</div>
<div>
	保存文件，接着就可以测试这个配置了。<br />
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);"><span style="background-color: rgb(0, 255, 0);"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/25b6.png" alt="▶" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/25b6.png" alt="▶" class="wp-smiley" style="height: 1em; max-height: 1em;" /></span></span>&nbsp;测试配置</div>
<blockquote>
<div>
		sudo netplan --debug try</div>
</blockquote>
<div>
	会输出一堆信息，部分内容如下：</div>
<blockquote>
<div>
		DEBUG:New interfaces: set()</div>
<div>
		** (generate:1387): DEBUG: 00:07:20.808: Processing input file /etc/netplan/01-network-manager-all.yaml..</div>
<div>
		** (generate:1387): DEBUG: 00:07:20.809: starting new processing pass</div>
<div>
		** (generate:1387): DEBUG: 00:07:20.809: wlan0: adding wifi AP &#39;MyWiFi&#39;</div>
<div>
		** (generate:1387): DEBUG: 00:07:20.809: wlan0: setting default backend to 2</div>
<div>
		** (generate:1387): DEBUG: 00:07:20.810: Configuration is valid&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
<div>
		** (generate:1387): DEBUG: 00:07:20.810: Generating output files..</div>
<div>
		** (generate:1387): DEBUG: 00:07:20.810: networkd: definition wlan0 is not for us (backend 2)</div>
<div>
		DEBUG:no netplan generated networkd configuration exists</div>
<div>
		DEBUG:netplan generated NM configuration changed, restarting NM</div>
<div>
		DEBUG:wlan0 not found in {}</div>
<div>
		(...中间省略...)</div>
<div>
		DEBUG:Skipping non-physical interface: lo</div>
<div>
		DEBUG:Skipping non-physical interface: eth0</div>
<div>
		DEBUG:{}</div>
<div>
		DEBUG:netplan triggering .link rules for lo</div>
<div>
		DEBUG:netplan triggering .link rules for eth0</div>
<div>
		DEBUG:netplan triggering .link rules for wlan0</div>
<div>
		Do you want to keep these settings?</div>
<div>
		(...后面省略...)</div>
</blockquote>
<div>
	&nbsp;</div>
<div>
	如果不出错的话，回车就会保存刚才添加的配置（如果不回车，过一段时间之后会自动revert到修改之前的版本）。</div>
<div>
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a></div>
<div>
	为确保成功，再执行一遍：</div>
<blockquote>
<div>
		sudo netplan --debug generate</div>
</blockquote>
<div>
	输出：</div>
<blockquote>
<div>
		DEBUG:command generate: running [&#39;/lib/netplan/generate&#39;]</div>
<div>
		** (generate:1579): DEBUG: 00:13:42.069: Processing input file /etc/netplan/01-network-manager-all.yaml..</div>
<div>
		** (generate:1579): DEBUG: 00:13:42.070: starting new processing pass</div>
<div>
		** (generate:1579): DEBUG: 00:13:42.070: wlan0: adding wifi AP &#39;MyWiFi&#39;</div>
<div>
		** (generate:1579): DEBUG: 00:13:42.070: wlan0: setting default backend to 2</div>
<div>
		** (generate:1579): DEBUG: 00:13:42.070: Configuration is valid</div>
<div>
		** (generate:1579): DEBUG: 00:13:42.070: Generating output files..</div>
<div>
		** (generate:1579): DEBUG: 00:13:42.070: networkd: definition wlan0 is not for us (backend 2)</div>
</blockquote>
<div>
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a></div>
<div>
	最后应用配置：</div>
<blockquote>
<div>
		sudo netplan --debug apply</div>
</blockquote>
<div>
	&nbsp;</div>
<div>
	如果上面的命令不出错一切正常，现在可以重启树莓派了：</div>
<blockquote>
<div>
		sudo shutdown -r now</div>
</blockquote>
<div>
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a></div>
<div>
	<span style="color: rgb(255, 0, 0);"><span style="background-color: rgb(0, 255, 0);"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/25b6.png" alt="▶" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/25b6.png" alt="▶" class="wp-smiley" style="height: 1em; max-height: 1em;" /></span></span>&nbsp;一些问题<br />
	如果不能连接WiFi，要看你的树莓派能不能扫描到你在配置文件中设置的SSID，可以用下面的命令查看树莓派能扫描到哪些SSID：</div>
<blockquote>
<div>
		sudo iw dev wlan0 scan | grep SSID</div>
</blockquote>
<div>
	输出类似于：</div>
<blockquote>
<div>
		SSID: ChinaNet-HG5o</div>
<div>
		SSID: ASUS-HuHu</div>
<div>
		SSID: TP-LINK_6D7F</div>
</blockquote>
<div>
	如果你设置的SSID是公开的，并且不在这个列表中，那么树莓派就连不上了。</div>
<div>
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
	感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
		<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e5%9c%a8%e6%a0%91%e8%8e%93%e6%b4%be%e7%9a%84ubuntu-mate-18-04%e7%b3%bb%e7%bb%9f%e4%b8%8a%e8%bf%9e%e6%8e%a5wifi/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[原创] 树莓派3代Model B上手</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e6%a0%91%e8%8e%93%e6%b4%be3%e4%bb%a3model-b%e4%b8%8a%e6%89%8b/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e6%a0%91%e8%8e%93%e6%b4%be3%e4%bb%a3model-b%e4%b8%8a%e6%89%8b/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Thu, 14 Apr 2016 16:43:16 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Raspberry Pi/树莓派]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[Mode B]]></category>
		<category><![CDATA[Raspberry Pi 3]]></category>
		<category><![CDATA[WiFi]]></category>
		<category><![CDATA[树莓派3]]></category>
		<guid isPermaLink="false">http://www.codelast.com/?p=8773</guid>

					<description><![CDATA[<p>
最近入手了树莓派3代，从树莓派出世到现在（2016.04），总共买了共4片各型号的树莓派，算不上狂热的爱好者，但也算是个比较热心的用户了吧。<br />
在此记录一些树莓派3代的使用笔记。<br />
<span id="more-8773"></span></p>
<div style="text-align: center;">
	<a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><img decoding="async" alt="Raspberry Pi 3 Model B" src="https://www.codelast.com/wp-content/uploads/2016/04/rpi_3_model_b.png" style="width: 400px; height: 650px;" /></a></div>
<p><span style="background-color: rgb(0, 255, 0);">『1』</span>ARMv8的Arch Linux系统？<br />
树莓派3代的CPU是ARMv8的64位CPU，但是在Arch Linux ARM的官方网站上，并没有for Raspberry Pi 3的ARMv8版本的OS下载，现在只能下载ARMv7 Raspberry Pi 2的OS来用。不用担心，以后面包会有的。<br />
<span style="color:#0000ff;">2017.2.24更新：再次到Arch Linux ARM官网看时，发现已经有了，开源社区实在太棒。</span><br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
<span style="background-color:#00ff00;">『1』</span>切换到 root 用户<br />
OpenSSH7默认已经禁止了root用户登录，因此，刚安装好的Arch Linux ARM是用alarm用户登录的。<br />
然而登录后，一堆操作（例如用pacman安装软件）都是需要root权限的，因此，需要切换到root再操作：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
su root
</pre>
<p>输入默认密码 root 即可。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
<span style="background-color:#00ff00;">『2』</span>添加中科大的源<br />
按照<a href="https://lug.ustc.edu.cn/wiki/mirrors/help/archlinuxarm" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">这个页面</span></a>的说明，在文件&#160;/etc/pacman.d/mirrorlist 最上方添加一句：</p>
<blockquote>
<p>
		Server = https://mirrors.ustc.edu.cn/archlinuxarm/$arch/$repo</p></blockquote>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e6%a0%91%e8%8e%93%e6%b4%be3%e4%bb%a3model-b%e4%b8%8a%e6%89%8b/" class="read-more">Read More </a>]]></description>
										<content:encoded><![CDATA[<p>
最近入手了树莓派3代，从树莓派出世到现在（2016.04），总共买了共4片各型号的树莓派，算不上狂热的爱好者，但也算是个比较热心的用户了吧。<br />
在此记录一些树莓派3代的使用笔记。<br />
<span id="more-8773"></span></p>
<div style="text-align: center;">
	<a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><img decoding="async" alt="Raspberry Pi 3 Model B" src="https://www.codelast.com/wp-content/uploads/2016/04/rpi_3_model_b.png" style="width: 400px; height: 650px;" /></a></div>
<p><span style="background-color: rgb(0, 255, 0);">『1』</span>ARMv8的Arch Linux系统？<br />
树莓派3代的CPU是ARMv8的64位CPU，但是在Arch Linux ARM的官方网站上，并没有for Raspberry Pi 3的ARMv8版本的OS下载，现在只能下载ARMv7 Raspberry Pi 2的OS来用。不用担心，以后面包会有的。<br />
<span style="color:#0000ff;">2017.2.24更新：再次到Arch Linux ARM官网看时，发现已经有了，开源社区实在太棒。</span><br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
<span style="background-color:#00ff00;">『1』</span>切换到 root 用户<br />
OpenSSH7默认已经禁止了root用户登录，因此，刚安装好的Arch Linux ARM是用alarm用户登录的。<br />
然而登录后，一堆操作（例如用pacman安装软件）都是需要root权限的，因此，需要切换到root再操作：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
su root
</pre>
<p>输入默认密码 root 即可。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
<span style="background-color:#00ff00;">『2』</span>添加中科大的源<br />
按照<a href="https://lug.ustc.edu.cn/wiki/mirrors/help/archlinuxarm" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">这个页面</span></a>的说明，在文件&nbsp;/etc/pacman.d/mirrorlist 最上方添加一句：</p>
<blockquote>
<p>
		Server = https://mirrors.ustc.edu.cn/archlinuxarm/$arch/$repo</p>
</blockquote>
<p>即可。<br />
然后用 pacman -Syu 升级系统，你就会发现快了许多。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
<span style="background-color:#00ff00;">『3』</span>使用树莓派3代的板载的WiFi<br />
<span style="color:#ff0000;">注：在本小节的最后有更新说明，请注意看。</span><br />
在Raspbian上把WiFi用起来实在是太轻松了（当然也有可能是我运气太好），只要用dd命令把Raspbian系统写到TF卡上，再插到树莓派3的卡槽里，上电，进Raspbian系统，WiFi就自然而然地可用了，完全不需要做任何配置！但是在Arch Linux ARM系统下，就没有那么爽了&mdash;&mdash;<br />
我以前在树莓派Model B+的Arch Linux系统里配置过USB WiFi，记录在<a href="http://www.codelast.com/?p=5393" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">这篇文章</span></a>里。如果在树莓派3代上刚装好Arch Linux，就使用同样的方法去配置，会发现不能work。<br />
为了让它work，我们先要使用<a href="https://github.com/Hexxeh/rpi-update" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">rpi-update</span></a>这个第三方工具来更新树莓派的firmwre。<br />
以root用户执行：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
rpi-update
</pre>
<p>可能会提示：</p>
<blockquote>
<div>
		&nbsp;*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom</div>
<div>
		&nbsp;*** Performing self-update</div>
<div>
		&nbsp;*** Relaunching after update</div>
<div>
		&nbsp;*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom</div>
<div>
		&nbsp;!!! This tool requires you have readelf installed, please install it first</div>
<div>
		&nbsp; &nbsp; &nbsp;In Debian, try: sudo apt-get install binutils</div>
<div>
		&nbsp; &nbsp; &nbsp;In Arch, try: pacman -S binutils</div>
</blockquote>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
所以我们按它说的，先安装另一个package：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
pacman -S binutils
</pre>
<p>安装完之后，重新执行 rpi-update，遇到问你yes or no的地方都输入y即可，就会输出下面的一堆信息：</p>
<blockquote>
<div>
		&nbsp;*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom</div>
<div>
		&nbsp;*** Performing self-update</div>
<div>
		&nbsp;*** Relaunching after update</div>
<div>
		&nbsp;*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom</div>
<div>
		&nbsp;*** We&#39;re running for the first time</div>
<div>
		&nbsp;*** Backing up files (this will take a few minutes)</div>
<div>
		&nbsp;*** Backing up firmware</div>
<div>
		&nbsp;*** Backing up modules 4.1.20-3-ARCH</div>
<div>
		#############################################################</div>
<div>
		WARNING: This update bumps to rpi-4.4.y linux tree</div>
<div>
		Be aware there could be compatibility issues with some drivers</div>
<div>
		Discussion here:</div>
<div>
		https://www.raspberrypi.org/forums/viewtopic.php?f=29&amp;t=144087</div>
<div>
		##############################################################</div>
<div>
		Would you like to proceed? (y/N)</div>
<div>
		&nbsp;*** Downloading specific firmware revision (this will take a few minutes)</div>
<div>
		&nbsp; % Total &nbsp; &nbsp;% Received % Xferd &nbsp;Average Speed &nbsp; Time &nbsp; &nbsp;Time &nbsp; &nbsp; Time &nbsp;Current</div>
<div>
		&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Dload &nbsp;Upload &nbsp; Total &nbsp; Spent &nbsp; &nbsp;Left &nbsp;Speed</div>
<div>
		100 &nbsp; 168 &nbsp; &nbsp;0 &nbsp; 168 &nbsp; &nbsp;0 &nbsp; &nbsp; 0 &nbsp; &nbsp;111 &nbsp; &nbsp; &nbsp;0 --:--:-- &nbsp;0:00:01 --:--:-- &nbsp; 111</div>
<div>
		100 50.2M &nbsp;100 50.2M &nbsp; &nbsp;0 &nbsp; &nbsp; 0 &nbsp;45414 &nbsp; &nbsp; &nbsp;0 &nbsp;0:19:20 &nbsp;0:19:20 --:--:-- 73368</div>
<div>
		&nbsp;*** Updating firmware</div>
<div>
		&nbsp;*** Updating kernel modules</div>
<div>
		&nbsp;*** depmod 4.4.7+</div>
<div>
		&nbsp;*** depmod 4.4.7-v7+</div>
<div>
		&nbsp;*** Updating VideoCore libraries</div>
<div>
		&nbsp;*** Using HardFP libraries</div>
<div>
		&nbsp;*** Updating SDK</div>
<div>
		&nbsp;*** Running ldconfig</div>
<div>
		&nbsp;*** Storing current firmware revision</div>
<div>
		&nbsp;*** Deleting downloaded files</div>
<div>
		&nbsp;*** Syncing changes to disk</div>
<div>
		&nbsp;*** If no errors appeared, your firmware was successfully updated to 1e84c2891c1853a3628aed59c06de0315d13c4f1</div>
<div>
		&nbsp;*** A reboot is needed to activate the new firmware</div>
</blockquote>
<div>
	按它的提示，我们重启系统。<br />
	可能是我运气不好，重启没用，板载的WiFi依然起不来。甚至于，我用 iwconfig 命令都看不到 wlan0 设备。<br />
	于是用<span style="color:#0000ff;">dmesg</span>命令来查看一下问题（<span style="color:#b22222;">dmesg用于显示和控制内核环缓冲，可帮助用户了解系统的启动信息</span>），打印出的信息可谓是非常多，和WiFi模块相关的错误大概有下面几条（不是连在一起的）：</p>
<blockquote>
<div>
			brcmfmac: brcmf_sdio_drivestrengthinit: No SDIO Drive strength init done for chip 43430 rev 1 pmurev 24</div>
<div>
			brcmfmac_sdio mmc1:0001:1: Direct firmware load for brcm/brcmfmac43430-sdio.bin failed with error -2</div>
<div>
			brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50</div>
<div>
			brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50</div>
</blockquote>
<p>	所以这里打印出来的<span style="color:#0000ff;">brcmfmac</span>又是个什么鬼？它是用于支持基于Broadcom 802.11n芯片的WiFi设备的驱动程序的名字。<br />
	因此，我们从上面的信息，是不是能这样说：WiFi模块的驱动程序没找到？<br />
	事实上，我们并不能这样推断，因为有人在树莓派的论坛里反馈说，他们的WiFi可以完全正常使用，但dmesg还是打印出了上述信息。而我个人的实验也证实了这样的说法。<br />
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
	那么怎么办呢？树莓派论坛里有人给出了这样一种方案：<br />
	到<a href="https://github.com/RPi-Distro/firmware-nonfree/tree/master/brcm80211/brcm" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">这个Github链接</span></a>下载<span style="color:#006400;">brcmfmac43430-sdio.bin</span> 和 <span style="color:#006400;">brcmfmac43430-sdio.txt</span>这两个文件，放到系统的 <span style="color:#0000ff;">/lib/firmware/brcm/</span> 目录下&mdash;&mdash;事实上，我在下载之前查看了一下这个目录，里面确实没有这两个文件，这也是为什么我的Arch Linux ARM连iwconfig都找不到wlan0的原因了。</p>
<p>	按上面的方法做好之后，重启Arch，再安装命令行的类图形化工具dialog：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
pacman -S dialog
</pre>
<p>	启用wlan0：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
ifconfig wlan0 up
</pre>
<p>	再使用wifi-menu程序来连接WiFi：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
wifi-menu -o
</pre>
</div>
<p>这里假设在交互式设置的过程，你将WiFi的名字设置成了wlan0-NG，则下一步，就是将其设置成开机启动：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
netctl enable wlan0-NG
</pre>
<p>这将创建并启用一个随计算机启动而自动运行的 systemd 服务。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
再重启Arch试试？执行ifconfig，你会惊喜地发现WiFi连上了。<br />
另外，如果发现WiFi不稳定，可以试试把WiFi的电源管理关闭：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
iwconfig wlan0 power off
</pre>
<p>然后把这行命令添加到启动执行。等驱动更新到更稳定的版本或许能解决WiFi稳定性问题。</p>
<p>2016-09更新：</p>
<ul>
<li>
		在一次Arch Linux ARM的系统更新中，提示错误&ldquo;/usr/lib/firmware/brcm/brcmfmac43430-sdio.bin exists in filesystem&rdquo;并失败，这个提示已经存在的文件恰恰就是我放到&nbsp;/usr/lib/firmware/brcm 目录下的，因此，这似乎说明了Arch官方的更新已经支持了树莓派3上的WiFi模块，所以我立即把&nbsp;/usr/lib/firmware/brcm/brcmfmac43430-sdio.bin 文件mv到其他备份目录下，再用pacman -Syu继续更新系统，但是更新完之后WiFi就不能用了，使用wifi-menu-o命令扫描不到我的路由器的WiFi网络。我相信这个问题是可以通过一些配置解决的，只不过我暂时还没有时间折腾。</li>
<li>
		（接上）后来我发现，用我的手机创建的WiFi热点（WPA加密模式）可以让树莓派扫描到，并且可以连上，所以，我现在判断是树莓派3的WiFi模块与我的路由器的WiFi加密方式不兼容&mdash;&mdash;但这不应该啊，百思不得其解。</li>
</ul>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
<span style="background-color: rgb(0, 255, 0);">『4』</span>解决系统更新后无法使用tmux的问题<br />
用 pacman -Syu 更新系统后，重启，再执行tmux，提示错误：</p>
<blockquote>
<p>
		tmux: need UTF-8 locale (LC_CTYPE) but have ANSI_X3.4-1968</p>
</blockquote>
<p>查了一下，找到<a href="https://wiki.archlinux.org/index.php/Locale_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">这个</span></a>Arch Linux的Wiki页面，解决方法就是：</p>
<ul>
<li>
		编辑 <span style="color:#0000ff;">/etc/locale.gen</span> 文件，取消这一行的注释：</li>
</ul>
<blockquote>
<p>
		en_US.UTF-8 UTF-8</p>
</blockquote>
<ul>
<li>
		执行以下命令生成Locale：</li>
</ul>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
locale-gen
</pre>
<ul>
<li>
		执行以下命令设置整个系统的Locale：</li>
</ul>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
localectl set-locale LANG=en_US.UTF-8
</pre>
<p>之后再执行tmux命令，不再出错。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
<span style="background-color:#00ff00;">『5』</span>用<span style="color:#0000ff;">pacman -Syu</span>升级时出现&ldquo;ca-certificates-utils: /etc/ssl/certs/ca-certificates.crt exists in filesystem&rdquo;错误的解决办法<br />
如果升级时出现以下错误：</p>
<blockquote>
<div>
		error: failed to commit transaction (conflicting files)</div>
<div>
		ca-certificates-utils: /etc/ssl/certs/ca-certificates.crt exists in filesystem</div>
<div>
		Errors occurred, no packages were upgraded.</div>
</blockquote>
<div>
	可以按<a href="https://bbs.archlinux.org/viewtopic.php?id=223895" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">这个</span></a>链接的说法，用如下方法解决：</p>
<blockquote>
<div>
			pacman -Syuw</div>
<div>
			rm /etc/ssl/certs/ca-certificates.crt</div>
<div>
			pacman -Su</div>
</blockquote>
<p>	其中第1条命令是只下载package，但不安装。<br />
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
	<span style="background-color: rgb(0, 255, 0);">『6』</span>Raspbian系统默认禁用ssh连接，如何启用<br />
	有一个最最简单的办法，你用了之后一定不想去试其他的方法，那就是：把树莓派安装Rabpbian系统的TF卡拔下来，用USB适配器插到一台Ubuntu台式机上，打开其boot分区，在里面创建一个名为&ldquo;<span style="color:#ff0000;">ssh</span>&rdquo;的文件（不含引号，文件内容为空即可），然后再把TF卡插回树莓派，就会发现ssh已经神奇地启用了。<br />
	这个原理是：Raspbian启动时会在boot分区里找名为ssh的文件，如果找到了，就会启用ssh，并把该文件删除。</p>
<p>	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
	感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
		<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>
</div>

			<!--[syntaxhighlighter]-->
			<!--代码高亮，请勿编辑-->
			<script type="text/javascript" src="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/scripts/shCore.js"></script><script type="text/javascript" src="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/scripts/shBrushShell.js"></script>

			<link type="text/css" rel="stylesheet" href="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/styles/shCoreCk.css" />
			<link type="text/css" rel="stylesheet" href="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/styles/shThemeCk.css" />
			<script type="text/javascript">
			SyntaxHighlighter.defaults['class-name']	= '';
			SyntaxHighlighter.defaults['smart-tabs']	= true;
			SyntaxHighlighter.defaults['tab-size']		= 2;
			SyntaxHighlighter.defaults['gutter']		= true;
			SyntaxHighlighter.defaults['quick-code']	= true;
			SyntaxHighlighter.defaults['collapse'] 		= false;
			SyntaxHighlighter.defaults['auto-links']	= true;
			SyntaxHighlighter.defaults['toolbar']		= true;
			SyntaxHighlighter.all();
			</script>
			<!--[/syntaxhighlighter]-->]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e6%a0%91%e8%8e%93%e6%b4%be3%e4%bb%a3model-b%e4%b8%8a%e6%89%8b/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
