<?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>BeagleBone Black Archives | Paul Bupe Jr, PhD</title>
	<atom:link href="https://paulbupejr.com/category/tutorials/beaglebone-black/feed/" rel="self" type="application/rss+xml" />
	<link>https://paulbupejr.com/category/tutorials/beaglebone-black/</link>
	<description>Hardware, software, and everything in between</description>
	<lastBuildDate>Tue, 02 Feb 2021 16:52:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://paulbupejr.com/wp-content/uploads/2019/07/cropped-paul_logo@2x-32x32.png</url>
	<title>BeagleBone Black Archives | Paul Bupe Jr, PhD</title>
	<link>https://paulbupejr.com/category/tutorials/beaglebone-black/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Adding Swap Memory to the Beaglebone Black</title>
		<link>https://paulbupejr.com/adding-swap-memory-to-the-beaglebone-black/</link>
					<comments>https://paulbupejr.com/adding-swap-memory-to-the-beaglebone-black/#comments</comments>
		
		<dc:creator><![CDATA[paulbupe]]></dc:creator>
		<pubDate>Mon, 31 Dec 2018 22:48:37 +0000</pubDate>
				<category><![CDATA[BeagleBone Black]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[beaglebone]]></category>
		<category><![CDATA[beaglebone black]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">http://paulbupejr.com/?p=336</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 2</span> <span class="rt-label rt-postfix">minutes</span></span>I recently needed to build Python 3.6 from source on the BeagleBone Black for a robotics project and discovered that the build would always fail after running out of memory. Who could have figured that 512MB of RAM wasn&#8217;t enough to build Python from source?! While I could have set up cross-compilation and performed the &#8230; <a href="https://paulbupejr.com/adding-swap-memory-to-the-beaglebone-black/" class="more-link">Continue reading <span class="screen-reader-text">Adding Swap Memory to the Beaglebone Black</span></a></p>
<p>The post <a href="https://paulbupejr.com/adding-swap-memory-to-the-beaglebone-black/">Adding Swap Memory to the Beaglebone Black</a> appeared first on <a href="https://paulbupejr.com">Paul Bupe Jr, PhD</a>.</p>
]]></description>
										<content:encoded><![CDATA[<span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 2</span> <span class="rt-label rt-postfix">minutes</span></span>
<p>I recently needed to build Python 3.6 from source on the BeagleBone Black for a robotics project and discovered that the build would always fail after running out of memory. Who could have figured that 512MB of RAM wasn&#8217;t enough to build Python from source?! While I could have set up cross-compilation and performed the heavy lifting on my computer with more resources, I figured this was a perfect problem to solve by adding swap memory to the BeagleBone Black.</p>



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



<h2 class="wp-block-heading">What is a swap space?</h2>



<p>At a very high level, a swap space (usually in the form of a partition) allows the system to move some of the &#8220;lower priority&#8221; memory pages (blocks of memory) to the partition or file so that higher priority tasks can use the memory. The combined size of the physical memory and swap space is called <em>virtual memory</em>. Gary Sims has a great primer on swap spaces over at <a href="https://www.linux.com/news/all-about-linux-swap-space">linux.com</a></p>



<p>In this case, the BeagleBone Black only has 512MB of RAM so I&#8217;ll be adding ~1GB of swap space to my SD card in the form of a swap file. This will allow it to perform more memory-intensive tasks without running out of memory (at a cost of slower access times).</p>



<h2 class="wp-block-heading">Creating a swap file</h2>



<p>Creating a swap space is a fairly simple process that involves creating a file (and filling it with zeros) then telling the system to use that file as a swap space. Finally, the system has to be configured to load that file on startup.</p>



<h5 class="wp-block-heading">Check if you already have a swap file</h5>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudo swapon -s</pre></div>



<div class="wp-block-image"><figure class="aligncenter"><img fetchpriority="high" decoding="async" width="670" height="77" src="http://paulbupejr.com/wp-content/uploads/2018/12/swapon.png" alt="" class="wp-image-343" srcset="https://paulbupejr.com/wp-content/uploads/2018/12/swapon.png 670w, https://paulbupejr.com/wp-content/uploads/2018/12/swapon-300x34.png 300w" sizes="(max-width: 670px) 100vw, 670px" /></figure></div>



<p>In my case I already created the file so it&#8217;s shown. The assumptions is that you&#8217;re performing these steps because you don&#8217;t have a swap space.</p>



<h5 class="wp-block-heading">Create the swap file</h5>



<p>Use the <code>dd </code>utility to create a file with a fixed size and fill it with &#8220;zeroes&#8221;. In this case I&#8217;m moving 1000 &#8220;zeroes&#8221; from <code>/dev/zero</code> in block sizes of 1024k (1MB) into my file at&nbsp;<code>/var/cache/swap/swapfile</code>. This will result in a swap file of around 1 gigabyte. <em>Keep in mind that the swap file is actually named &#8220;swapfile&#8221; with no extension</em>.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudo dd if=/dev/zero of=/var/cache/swap/swapfile bs=1024k count=1000</pre></div>



<p>use <code>chmod </code>to change the file permissions of the new swap file.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudo chmod 0600 /var/cache/swap/swapfile</pre></div>



<p>Use the <code>mkswap&nbsp; </code>command to create the swap area using our newly created swap file.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudo mkswap /var/cache/swap/swapfile</pre></div>



<p>Finally, enable the swap area with the <code>swapon </code>command</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudo swapon /var/cache/swap/swapfile</pre></div>



<h5 class="wp-block-heading">Configure the swap file to automatically mount on boot</h5>



<p>Open up the <code>/etc/fstab</code> file with the <code>nano </code>editor.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudo nano /etc/fstab</pre></div>



<p>Append the following line to the file:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">/var/cache/swap/swapfile    none   swap   sw   0   0</pre></div>



<p>That is all there is to it for this specific case &#8211; adding swap memory to the BeagleBone Black is pretty straightforward! </p>



<div class="wp-block-image wp-image-344 size-full"><figure class="aligncenter"><img decoding="async" width="689" height="227" src="http://paulbupejr.com/wp-content/uploads/2018/12/top2.png" alt="" class="wp-image-344" srcset="https://paulbupejr.com/wp-content/uploads/2018/12/top2.png 689w, https://paulbupejr.com/wp-content/uploads/2018/12/top2-300x99.png 300w" sizes="(max-width: 689px) 100vw, 689px" /><figcaption>The newly created swap space being heavily during building</figcaption></figure></div>
<p>The post <a href="https://paulbupejr.com/adding-swap-memory-to-the-beaglebone-black/">Adding Swap Memory to the Beaglebone Black</a> appeared first on <a href="https://paulbupejr.com">Paul Bupe Jr, PhD</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://paulbupejr.com/adding-swap-memory-to-the-beaglebone-black/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Change the Default Cloud9 Workspace on the BeagleBone Black</title>
		<link>https://paulbupejr.com/change-cloud9-workspace/</link>
					<comments>https://paulbupejr.com/change-cloud9-workspace/#comments</comments>
		
		<dc:creator><![CDATA[paulbupe]]></dc:creator>
		<pubDate>Sat, 29 Dec 2018 00:53:17 +0000</pubDate>
				<category><![CDATA[BeagleBone Black]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[beaglebone]]></category>
		<category><![CDATA[beaglebone black]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">http://paulbupejr.com/?p=298</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 2</span> <span class="rt-label rt-postfix">minutes</span></span>The BeagleBone Black ships with a really great browser-based IDE called Cloud9, which is accessed by going to your BBB IP address at port 3000. While I don&#8217;t use Cloud9 for heavy development, it&#8217;s handy for debugging and quick changes to scripts. It also has a built-in terminal which means I can do everything in &#8230; <a href="https://paulbupejr.com/change-cloud9-workspace/" class="more-link">Continue reading <span class="screen-reader-text">Change the Default Cloud9 Workspace on the BeagleBone Black</span></a></p>
<p>The post <a href="https://paulbupejr.com/change-cloud9-workspace/">Change the Default Cloud9 Workspace on the BeagleBone Black</a> appeared first on <a href="https://paulbupejr.com">Paul Bupe Jr, PhD</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 2</span> <span class="rt-label rt-postfix">minutes</span></span>The BeagleBone Black ships with a really great browser-based IDE called <a href="http://beagleboard.org/Support/bone101/#cloud9">Cloud9</a>, which is accessed by going to your BBB IP address at port 3000. While I don&#8217;t use Cloud9 for heavy development, it&#8217;s handy for debugging and quick changes to scripts. It also has a built-in terminal which means I can do everything in the browser.</p>
<p>By default Cloud9 launches a workspace at<code> /usr/lib/cloud9</code>, which has useful examples and scripts for all sorts of applications. I want it to point, instead, to my personal projects folder so I&#8217;ll change the default Cloud9 workspace on the BeagleBone Black to <code>/home/debian/projects</code>.</p>
<p><span id="more-298"></span></p>
<h2>Override systemd Service</h2>
<p>Cloud9 is launched by <code>/lib/systemd/system/cloud.service</code> which explicitly starts the server pointing to <code>/var/ib/cloud9</code>.</p>
<p><figure id="attachment_305" aria-describedby="caption-attachment-305" style="width: 681px" class="wp-caption aligncenter"><img decoding="async" class="size-full wp-image-305" src="http://paulbupejr.com/wp-content/uploads/2018/12/Service.png" alt="Cloud9 Service" width="681" height="226" srcset="https://paulbupejr.com/wp-content/uploads/2018/12/Service.png 681w, https://paulbupejr.com/wp-content/uploads/2018/12/Service-300x100.png 300w" sizes="(max-width: 681px) 100vw, 681px" /><figcaption id="caption-attachment-305" class="wp-caption-text">Original Cloud9 Service</figcaption></figure></p>
<p>In order to change this, we simply need to override the service with one that points to our desired directory. Packages generally install services in <code>/lib/systemd/system</code> while our new override will reside in <code>/etc/systemd/system</code>.</p>
<h4>Step 1:</h4>
<pre>systemctl edit cloud9</pre>
<p>This creates our override in <code>/etc/systemd/system/cloud9.service.d/override.conf</code> and opens up the file for editing. Then we simply clear ExecStart (since it is additive) and provide the new directory in that file.</p>
<pre>[Service]
ExecStart=
ExecStart=/usr/bin/nodejs server.js --packed -w /home/debian/projects</pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-304" src="http://paulbupejr.com/wp-content/uploads/2018/12/Override.png" alt="" width="695" height="135" srcset="https://paulbupejr.com/wp-content/uploads/2018/12/Override.png 695w, https://paulbupejr.com/wp-content/uploads/2018/12/Override-300x58.png 300w" sizes="auto, (max-width: 695px) 100vw, 695px" /></p>
<h4>Step 2:</h4>
<p>Perform a daemon reload and restart the cloud9 service</p>
<pre>systemctl daemon-reload
systemctl restart cloud9
</pre>
<h4>Step 3:</h4>
<p>Restart the browser. The new folder should now be the default workspace!</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-303" src="http://paulbupejr.com/wp-content/uploads/2018/12/final.png" alt="" width="820" height="410" srcset="https://paulbupejr.com/wp-content/uploads/2018/12/final.png 820w, https://paulbupejr.com/wp-content/uploads/2018/12/final-300x150.png 300w, https://paulbupejr.com/wp-content/uploads/2018/12/final-768x384.png 768w" sizes="auto, (max-width: 820px) 100vw, 820px" /></p>
<hr />
<p>View my tutorial on setting up <a href="http://paulbupejr.com/beaglebone-black-internet-over-usb/">internet over USB on the BeagleBone Black</a>.</p>
<p>The post <a href="https://paulbupejr.com/change-cloud9-workspace/">Change the Default Cloud9 Workspace on the BeagleBone Black</a> appeared first on <a href="https://paulbupejr.com">Paul Bupe Jr, PhD</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://paulbupejr.com/change-cloud9-workspace/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Connecting a BeagleBone Black to the Internet over USB</title>
		<link>https://paulbupejr.com/beaglebone-black-internet-over-usb/</link>
					<comments>https://paulbupejr.com/beaglebone-black-internet-over-usb/#comments</comments>
		
		<dc:creator><![CDATA[paulbupe]]></dc:creator>
		<pubDate>Fri, 28 Dec 2018 20:22:41 +0000</pubDate>
				<category><![CDATA[BeagleBone Black]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[beaglebone]]></category>
		<category><![CDATA[beaglebone black]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">http://paulbupejr.com/?p=258</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 4</span> <span class="rt-label rt-postfix">minutes</span></span>Connecting a BeagleBone Black (BBB) to the internet over USB is a simple process thanks to the internet sharing capabilities of Windows. This is extremely convenient when developing because it allows your BeagleBone Black to have an internet connection as long as your computer or laptop has one, no matter the network, and SSH access &#8230; <a href="https://paulbupejr.com/beaglebone-black-internet-over-usb/" class="more-link">Continue reading <span class="screen-reader-text">Connecting a BeagleBone Black to the Internet over USB</span></a></p>
<p>The post <a href="https://paulbupejr.com/beaglebone-black-internet-over-usb/">Connecting a BeagleBone Black to the Internet over USB</a> appeared first on <a href="https://paulbupejr.com">Paul Bupe Jr, PhD</a>.</p>
]]></description>
										<content:encoded><![CDATA[<span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 4</span> <span class="rt-label rt-postfix">minutes</span></span>
<p>Connecting a BeagleBone Black (BBB) to the internet over USB is a simple process thanks to the internet sharing capabilities of Windows. This is extremely convenient when developing because it allows your BeagleBone Black to have an internet connection as long as your computer or laptop has one, no matter the network, and SSH access over a single USB cable.</p>



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



<h2 class="wp-block-heading">Windows Configuration</h2>



<p>These instructions assume you have already installed an image on your BBB and can connect to the web interface. If not, the <a href="http://beagleboard.org/getting-started">official documentation</a> is extremely thorough and easy to follow.</p>



<h4 class="wp-block-heading">Step 1: Configure your primary network interface for sharing.</h4>



<p>Open the Run prompt <code>(Win+R)</code> and enter <code>ncpa.cpl</code> to open Network Connections.</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="399" height="206" src="http://paulbupejr.com/wp-content/uploads/2018/12/Run.png" alt="" class="wp-image-273" srcset="https://paulbupejr.com/wp-content/uploads/2018/12/Run.png 399w, https://paulbupejr.com/wp-content/uploads/2018/12/Run-300x155.png 300w" sizes="auto, (max-width: 399px) 100vw, 399px" /></figure></div>



<p>You should see (in addition to your regular network connection) a new connection with a description that starts with &#8220;Linux USB Ethernet&#8221; or something similar. This is your BBB&#8217;s connection.</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="733" height="407" src="http://paulbupejr.com/wp-content/uploads/2018/12/Network-Connections.png" alt="" class="wp-image-267" srcset="https://paulbupejr.com/wp-content/uploads/2018/12/Network-Connections.png 733w, https://paulbupejr.com/wp-content/uploads/2018/12/Network-Connections-300x167.png 300w" sizes="auto, (max-width: 733px) 100vw, 733px" /></figure></div>



<p>Right click on the internet connection your want to share (not on the BBB connection) and click on <em>Properties</em>. In the properties window click on the <em>Sharing </em>tab and check the box that says <em>Allow other network users to connect through this computer&#8217;s Internet connection</em>. Select the BBB&#8217;s connection under the <em>Home networking connection:</em> dropdown then click <em>OK</em> to save.</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="363" height="468" src="http://paulbupejr.com/wp-content/uploads/2018/12/Properties.png" alt="" class="wp-image-269" srcset="https://paulbupejr.com/wp-content/uploads/2018/12/Properties.png 363w, https://paulbupejr.com/wp-content/uploads/2018/12/Properties-233x300.png 233w" sizes="auto, (max-width: 363px) 100vw, 363px" /></figure></div>



<p>Double click on the BBB&#8217;s connection and click on <em>Internet Protocol Version 4 (TCP/IPv4)</em> to highlight it then click on Properties. Alternatively you can just double click on the text (not the checkbox).</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="363" height="468" src="http://paulbupejr.com/wp-content/uploads/2018/12/USB-Properties.png" alt="" class="wp-image-274" srcset="https://paulbupejr.com/wp-content/uploads/2018/12/USB-Properties.png 363w, https://paulbupejr.com/wp-content/uploads/2018/12/USB-Properties-233x300.png 233w" sizes="auto, (max-width: 363px) 100vw, 363px" /></figure></div>



<p>Fill in the IP address and DNS information as shown in the image. The BBB will expect the computer to have an IP address of <code>192.168.7.1</code> and it will use the computer as a <em>gateway</em> to the internet.</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="400" height="455" src="http://paulbupejr.com/wp-content/uploads/2018/12/IP.png" alt="" class="wp-image-266" srcset="https://paulbupejr.com/wp-content/uploads/2018/12/IP.png 400w, https://paulbupejr.com/wp-content/uploads/2018/12/IP-264x300.png 264w" sizes="auto, (max-width: 400px) 100vw, 400px" /></figure></div>



<p>That&#8217;s all the setup needed on the Windows machine!</p>



<h4 class="wp-block-heading">Step 2: BeagleBone Black Configuration</h4>



<p>All of the configuration needed on the BBB is in a single file. Interestingly, all the tutorials I&#8217;ve seen on this topic don&#8217;t show the proper way of configuring the network so that the changes are persistent.</p>



<h5 class="wp-block-heading">SSH Access</h5>



<p>The first step is to connect to the BBB via SSH. <a href="https://www.putty.org/">PuTTY</a> is the de facto SSH client on Windows and I highly recommend it. Open up PuTTy and enter the BBB&#8217;s default IP address (<code>192.169.7.2</code>) then press <em>Open</em>. You may see a warning sign pop up if it&#8217;s the first time connecting to the IP but just click <em>Yes</em> and continue.</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="452" height="442" src="http://paulbupejr.com/wp-content/uploads/2018/12/Putty-Start.png" alt="" class="wp-image-271" srcset="https://paulbupejr.com/wp-content/uploads/2018/12/Putty-Start.png 452w, https://paulbupejr.com/wp-content/uploads/2018/12/Putty-Start-300x293.png 300w" sizes="auto, (max-width: 452px) 100vw, 452px" /></figure></div>



<p>You&#8217;ll be asked for a login. The default credentials are:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">login: debian
pass: temppwd</pre></div>



<p>Be sure to change the password!</p>



<p><em><strong>Note: When typing in the password, you will not see anything happening. That&#8217;s a security feature &#8212; just press enter when you enter the full password.&nbsp;</strong></em></p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="661" height="162" src="http://paulbupejr.com/wp-content/uploads/2018/12/Putty-Login.png" alt="" class="wp-image-270" srcset="https://paulbupejr.com/wp-content/uploads/2018/12/Putty-Login.png 661w, https://paulbupejr.com/wp-content/uploads/2018/12/Putty-Login-300x74.png 300w" sizes="auto, (max-width: 661px) 100vw, 661px" /></figure></div>



<h5 class="wp-block-heading">Configuration</h5>



<p>We will be editing the <em>interfaces</em> file, which is used to configure the network interfaces on the system as the name suggests. Enter the following command to open up the file for editing:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudo nano /etc/network/interfaces</pre></div>



<p><code>sudo </code>( originally called &#8220;superuser do&#8221;) temporarily elevates the security privileges of the <em>debian</em> user to the superuser so that it can modify system files. You will be asked to enter the user password which is <em>temppwd</em> in the default case. <code>nano</code> is a simple text editor that&#8217;s present on most Linux systems.</p>



<p>Once in the file, use the down arrow key or <em>Page Down</em> key to go to the bottom of the file where you should see entries for the usb0 interface. Enter the following information:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">iface usb0 inet static
    address 192.168.7.2
    netmask 255.255.255.252
    network 192.168.7.0
    gateway 192.168.7.1
    dns-nameservers 8.8.8.8
    post-up route add default gw 192.168.7.1</pre></div>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="661" height="450" src="http://paulbupejr.com/wp-content/uploads/2018/12/IF-Configure.png" alt="" class="wp-image-265" srcset="https://paulbupejr.com/wp-content/uploads/2018/12/IF-Configure.png 661w, https://paulbupejr.com/wp-content/uploads/2018/12/IF-Configure-300x204.png 300w" sizes="auto, (max-width: 661px) 100vw, 661px" /></figure></div>



<p>When the system starts up, the system runs a configuration script located at <code>/opt/scripts/boot/autoconfigure_usb0.sh</code><br>that reads this <code>/etc/network/interfaces</code> file and sets the IP address and netmask for the usb0 interface.</p>



<p>The configuration script also reads the <em>dns-nameservers</em> value and writes it to <em>/etc/resolv.conf</em>. Lastly, the script executes the <em>post-up</em> value line after the network interface is up (thus the name) in order to add the default gateway (which is the IP address we set on the Windows machine) to the route.</p>



<p>After making the changes, press <code>CTRL+O</code> to save the changes then <code>CTRL+X</code> to close the file. Reboot the system with:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudo reboot</pre></div>



<p>After the reboot is complete, connect to the system again (you can just right-click anywhere on the PuTTy window and click on <em>Restart session</em>).</p>



<p>The route command will show you if the gateway is set.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">route</pre></div>



<p>The <em>/etc/resolv.conf</em> file should also contain the nameserver entry.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">cat /etc/resolv.conf</pre></div>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="733" height="402" src="http://paulbupejr.com/wp-content/uploads/2018/12/route.png" alt="" class="wp-image-272" srcset="https://paulbupejr.com/wp-content/uploads/2018/12/route.png 733w, https://paulbupejr.com/wp-content/uploads/2018/12/route-300x165.png 300w" sizes="auto, (max-width: 733px) 100vw, 733px" /></figure></div>



<p>That&#8217;s all the configuration needed to get internet over USB working! You can test it out by pinging Google with <code>ping google.com</code>. You can press <code>CTRL+C</code> to stop the ping command.</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="733" height="402" src="http://paulbupejr.com/wp-content/uploads/2018/12/Ping.png" alt="" class="wp-image-268" srcset="https://paulbupejr.com/wp-content/uploads/2018/12/Ping.png 733w, https://paulbupejr.com/wp-content/uploads/2018/12/Ping-300x165.png 300w" sizes="auto, (max-width: 733px) 100vw, 733px" /></figure></div>
<p>The post <a href="https://paulbupejr.com/beaglebone-black-internet-over-usb/">Connecting a BeagleBone Black to the Internet over USB</a> appeared first on <a href="https://paulbupejr.com">Paul Bupe Jr, PhD</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://paulbupejr.com/beaglebone-black-internet-over-usb/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)

Served from: paulbupejr.com @ 2026-04-15 13:15:52 by W3 Total Cache
-->