<?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>Raspberry Pi &#8211; acm&#039;s blog</title>
	<atom:link href="https://blog.acm.idv.tw/tag/raspberry-pi/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.acm.idv.tw</link>
	<description>技術與生活隨筆</description>
	<lastBuildDate>Sun, 21 May 2023 12:19:01 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>

<image>
	<url>https://blog.acm.idv.tw/wp-content/uploads/2022/06/cropped-logo_kaffa9-3-32x32.png</url>
	<title>Raspberry Pi &#8211; acm&#039;s blog</title>
	<link>https://blog.acm.idv.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>樹莓派4B的OpenWRT初體驗</title>
		<link>https://blog.acm.idv.tw/2023/05/21/%e6%a8%b9%e8%8e%93%e6%b4%be4b%e7%9a%84openwrt%e5%88%9d%e9%ab%94%e9%a9%97/</link>
					<comments>https://blog.acm.idv.tw/2023/05/21/%e6%a8%b9%e8%8e%93%e6%b4%be4b%e7%9a%84openwrt%e5%88%9d%e9%ab%94%e9%a9%97/#respond</comments>
		
		<dc:creator><![CDATA[kaffa9]]></dc:creator>
		<pubDate>Sun, 21 May 2023 12:19:01 +0000</pubDate>
				<category><![CDATA[技術]]></category>
		<category><![CDATA[硬體]]></category>
		<category><![CDATA[OpenWRT]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[軟路由]]></category>
		<guid isPermaLink="false">https://kaffa9.com/?p=755</guid>

					<description><![CDATA[最近琢磨著將家中寬頻升級到100M之上的速率（應該會是300M），然而家中目前肩負連外重任的路由器是刷成DD-WRT的D-Link DIR-632，僅有100M...<p class="read-more"><a class="btn btn-default" href="https://blog.acm.idv.tw/2023/05/21/%e6%a8%b9%e8%8e%93%e6%b4%be4b%e7%9a%84openwrt%e5%88%9d%e9%ab%94%e9%a9%97/"> Read More<span class="screen-reader-text">  Read More</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>最近琢磨著將家中寬頻升級到100M之上的速率（應該會是300M），然而家中目前肩負連外重任的路由器是刷成DD-WRT的D-Link DIR-632，僅有100Mbps的Fast Ethernet網孔，寬頻升速後，勢必連帶要更換新的路由器，否則300M/100M最多也只能跑成100M/100M，於是又想起前不久才剛認識的新朋友──軟路由。</p>



<span id="more-755"></span>



<p>其實從今年初開始，就一直在關注迷你主機和軟路由領域，軟路由在對岸可以說是紅紅火火，咱們這邊顯得有點冷清，呈現兩樣情。也因此，在網上調查了許久，發現較適合做為軟路由的袖珍型硬體主要都是大陸廠商在設計製造，例如今年搭配Intel N95/N100處理器的小主機們：</p>



<ul class="wp-block-list">
<li>零刻：S12 Mini、EQ12</li>



<li>暢網：P12</li>



<li>摩方：M8S</li>
</ul>



<p>雖說4月我也入手了一台摩方S500+，具備2.5Gbps、1Gbps網孔各一，也算是滿足做為軟路由的基本要求了，但是搭載AMD Ryzen 5 5600H處理器（我還裝上了32G DDR4-3200記憶體和1TB NVMe SSD），只拿來跑OpenWRT實在是太浪費了。</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img fetchpriority="high" decoding="async" width="1024" height="577" src="https://kaffa9.com/wp-content/uploads/2023/05/DSC_1298-中-1-1024x577.jpg" alt="" class="wp-image-758" srcset="https://blog.acm.idv.tw/wp-content/uploads/2023/05/DSC_1298-中-1-1024x577.jpg 1024w, https://blog.acm.idv.tw/wp-content/uploads/2023/05/DSC_1298-中-1-300x169.jpg 300w, https://blog.acm.idv.tw/wp-content/uploads/2023/05/DSC_1298-中-1-768x433.jpg 768w, https://blog.acm.idv.tw/wp-content/uploads/2023/05/DSC_1298-中-1-479x270.jpg 479w, https://blog.acm.idv.tw/wp-content/uploads/2023/05/DSC_1298-中-1.jpg 1363w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Morefine S500+</figcaption></figure></div>


<p>正巧手邊有塊被我嫌棄、打入冷宮的樹苺派4B，也可以跑OpenWRT，不如就拿來試試吧！ </p>



<p>進行完第一輪調查，我來到 <a rel="noreferrer noopener" href="https://github.com/SuLingGG/OpenWrt-Rpi" target="_blank">https://github.com/SuLingGG/OpenWrt-Rpi</a> ，可是專案已經是archived狀態，最後釋出日期也停在2021年11月，於是我再向上溯源，來到 <a rel="noreferrer noopener" href="https://github.com/immortalwrt/immortalwrt" target="_blank">https://github.com/immortalwrt/immortalwrt</a> ，這是對岸牛人從OpenWRT fork出來的版本，針對大陸使用環境做了些優化，於是我立馬將image燒進SD卡，將PC網路線改接到樹莓派上，並以瀏覽器開啟 http://192.168.1.1 。</p>



<p>樹莓派內建的網路介面只有二個：一個是1Gbps有線網卡 (eth0)，另一個則是 Wi-Fi 5 無線網卡 (wlan0)。為了讓樹莓派做個稱職的軟路由，我拿了綠聯USB網卡接上，這是使用 ASIX 方案的 100Mbps 網卡，在OpenWRT的syslog可以看到有被識別到，但OpenWRT Web GUI的Interface頁面卻始終找不到這個網卡（何解呢？）</p>



<p>搞了老半天，我還是沒搞明白immortalwrt怎麼操作，連修改個網段成192.168.128.0/24都有問題，想說這也太難整了，於是我又跑去抓取OpenWRT image重燒。一連入Web GUI……哎喲我去！這不是長得一樣嗎？<img src="https://s.w.org/images/core/emoji/15.1.0/72x72/1f644.png" alt="🙄" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<p>想了許久，我決定divide and conquer，首先解決沒有WAN端的問題！既然USB網卡沒辦法用，那就暫時用Wi-Fi來當WAN吧！設定完成後，發現網路已通，但是DNS有問題，查了老半天，猜測是LAN網段和上層網段都是192.168.1.0/24導致的，所以決定來解決第二個問題：網段設定。</p>



<p>網段設定成192.168.128.0/24一樣會設定失敗，由於耐心值急速下降，在查出真相前，我決定用172.16.1.0/24網段嘗試看看，沒想到竟然可以了？嗯？Why？工程師總是在「為什麼不會動？」和「為什麼會動？」之間矒圈。まぁ……能動，可以上網就好了。不如，還是來解決一下第三個問題：USB網卡如何驅動。</p>



<p>於是我又去Google爬文，這次總算瞭解到OpenWRT有個opkg的套件庫，像這種外接硬體的驅動程式，是需要安裝套件的。用ASIX作為關鍵字，將搜尋到的套件安裝完後……Ta-da! 總算長出eth1！後面將eth1拿來當作WAN做PPPoE撥號上網的測試就不贅述了。</p>



<p>這次OpenWRT初體驗學到不少經驗，但如果真要使用樹莓派做軟路由，耐用性和穩定性還是個未知數，也許還得再多爬文或看看有沒有大牛發布相關測試影片。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.acm.idv.tw/2023/05/21/%e6%a8%b9%e8%8e%93%e6%b4%be4b%e7%9a%84openwrt%e5%88%9d%e9%ab%94%e9%a9%97/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>apt更換mirror站台後遭遇GPG NO_PUBKEY問題</title>
		<link>https://blog.acm.idv.tw/2022/07/17/apt%e6%9b%b4%e6%8f%9bmirror%e7%ab%99%e5%8f%b0%e5%be%8c%e9%81%ad%e9%81%87gpg-no_pubkey%e5%95%8f%e9%a1%8c/</link>
					<comments>https://blog.acm.idv.tw/2022/07/17/apt%e6%9b%b4%e6%8f%9bmirror%e7%ab%99%e5%8f%b0%e5%be%8c%e9%81%ad%e9%81%87gpg-no_pubkey%e5%95%8f%e9%a1%8c/#respond</comments>
		
		<dc:creator><![CDATA[kaffa9]]></dc:creator>
		<pubDate>Sun, 17 Jul 2022 07:28:49 +0000</pubDate>
				<category><![CDATA[系統維運]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Raspbian]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">https://kaffa9.com/?p=172</guid>

					<description><![CDATA[前一陣子購入了一批Raspberry Pi Desktop Kit，隨附的記憶卡中已經預先裝載好Raspbian，沒想到近日在更新套件時，頻頻遇到某某套件無法更...<p class="read-more"><a class="btn btn-default" href="https://blog.acm.idv.tw/2022/07/17/apt%e6%9b%b4%e6%8f%9bmirror%e7%ab%99%e5%8f%b0%e5%be%8c%e9%81%ad%e9%81%87gpg-no_pubkey%e5%95%8f%e9%a1%8c/"> Read More<span class="screen-reader-text">  Read More</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>前一陣子購入了一批Raspberry Pi Desktop Kit，隨附的記憶卡中已經預先裝載好Raspbian，沒想到近日在更新套件時，頻頻遇到某某套件無法更新的問題，apt錯誤訊息建議使用&#8211;fix-missing參數，實際執行完全無法解決問題。重新下了apt-get upgrade觀察了一下，發現更新失敗幾乎都是連不上某台伺服器（所以無法下載套件）造成的，於是心生一計──修改apt source list裡的URL，改為指向mirror site試試。</p>



<span id="more-172"></span>



<p>修改完後，想不到下了apt update直接告訴我GPG Error，這次是NO_PUBKEY的訊息。拜完谷歌大神，很快就得到答案：</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><a href="https://askubuntu.com/questions/13065/how-do-i-fix-the-gpg-error-no-pubkey">https://askubuntu.com/questions/13065/how-do-i-fix-the-gpg-error-no-pubkey</a></p></blockquote>



<p>方法1：</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys &lt;PUBKEY>
# &lt;PUBKEY> 為apt回應的NO_PUBKEY錯誤訊息中的金鑰值</pre>



<p>方法2：</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">sudo gpg --keyserver pgpkeys.mit.edu --recv-key  &lt;PUBKEY>
# &lt;PUBKEY> 為apt回應的NO_PUBKEY錯誤訊息中的金鑰值
sudo gpg -a --export &lt;PUBKEY> | sudo apt-key add -
sudo apt-get update</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.acm.idv.tw/2022/07/17/apt%e6%9b%b4%e6%8f%9bmirror%e7%ab%99%e5%8f%b0%e5%be%8c%e9%81%ad%e9%81%87gpg-no_pubkey%e5%95%8f%e9%a1%8c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Raspberry Pi Headless Setup</title>
		<link>https://blog.acm.idv.tw/2020/09/06/raspberry-pi-headless-setup/</link>
					<comments>https://blog.acm.idv.tw/2020/09/06/raspberry-pi-headless-setup/#respond</comments>
		
		<dc:creator><![CDATA[kaffa9]]></dc:creator>
		<pubDate>Sun, 06 Sep 2020 14:11:00 +0000</pubDate>
				<category><![CDATA[技術]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[樹莓派]]></category>
		<guid isPermaLink="false"></guid>

					<description><![CDATA[最近又把 Raspberry Pi 3B 拿出來鼓搗一番，但是為了 Video &#38; Ethernet 接線實在太麻煩，請教 Google 大神後，沒想到...<p class="read-more"><a class="btn btn-default" href="https://blog.acm.idv.tw/2020/09/06/raspberry-pi-headless-setup/"> Read More<span class="screen-reader-text">  Read More</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>最近又把 Raspberry Pi 3B 拿出來鼓搗一番，但是為了 Video &amp; Ethernet 接線實在太麻煩，請教 Google 大神後，沒想到有所謂的「Headless Setup」途徑，可以預先啟用 SSH 連線以及設定 Wi-Fi 連線，我的方法如下。</p>



<ol class="wp-block-list"><li>先以工具（如：Rufus）將 Raspberry Pi OS (Raspbian) 映像燒入 SD card 中</li><li>在電腦讀取此張 SD card</li><li>在根目錄置入名為 &#8220;ssh&#8221; 的空白檔案，即可啟用 openssh-server</li><li>在根目錄置入名為 &#8220;wpa_supplicant.conf&#8221; 的檔案，檔案內容參考如下：</li></ol>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=TW

network={
    scan_ssid=1
    ssid="MYSSID"
    psk="MYPASSWORD"
}
</pre>



<p>Have fun!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.acm.idv.tw/2020/09/06/raspberry-pi-headless-setup/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
