<?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>Tutorials Archives | Paul Bupe Jr, PhD</title>
	<atom:link href="https://paulbupejr.com/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>https://paulbupejr.com/category/tutorials/</link>
	<description>Hardware, software, and everything in between</description>
	<lastBuildDate>Wed, 20 Dec 2023 00:42:41 +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>Tutorials Archives | Paul Bupe Jr, PhD</title>
	<link>https://paulbupejr.com/category/tutorials/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Disable TP-Link Tapo Camera IR LEDs</title>
		<link>https://paulbupejr.com/disable-tp-link-tapo-camera-ir-leds/</link>
					<comments>https://paulbupejr.com/disable-tp-link-tapo-camera-ir-leds/#comments</comments>
		
		<dc:creator><![CDATA[paulbupe]]></dc:creator>
		<pubDate>Wed, 20 Dec 2023 00:32:59 +0000</pubDate>
				<category><![CDATA[Repairs]]></category>
		<category><![CDATA[TP-Link]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ir led]]></category>
		<category><![CDATA[security camera]]></category>
		<category><![CDATA[soldering]]></category>
		<category><![CDATA[streaming]]></category>
		<category><![CDATA[tapo c110]]></category>
		<category><![CDATA[tp-link tapo]]></category>
		<guid isPermaLink="false">https://paulbupejr.com/?p=858</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"> 3</span> <span class="rt-label rt-postfix">minutes</span></span>This post quickly covers how I disabled (removed) the IR LEDs on several Tapo C110 cameras I own. This was to use them behind a window without the IR LEDs&#8217; glare ruining the video. The Tapo C110 is an excellent small WiFi security camera, boasting up to 2K resolution, local continuous SD card recording, and &#8230; <a href="https://paulbupejr.com/disable-tp-link-tapo-camera-ir-leds/" class="more-link">Continue reading <span class="screen-reader-text">Disable TP-Link Tapo Camera IR LEDs</span></a></p>
<p>The post <a href="https://paulbupejr.com/disable-tp-link-tapo-camera-ir-leds/">Disable TP-Link Tapo Camera IR LEDs</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"> 3</span> <span class="rt-label rt-postfix">minutes</span></span>
<p>This post quickly covers how I disabled (removed) the IR LEDs on several Tapo C110 cameras I own. This was to use them behind a window without the IR LEDs&#8217; glare ruining the video. The Tapo C110 is an excellent small WiFi security camera, boasting up to 2K resolution, local continuous SD card recording, and two local RSTP streams. Most importantly, it works perfectly fine without an internet connection once configured, fitting my use-case. A significant drawback of the camera is the need to completely disable the night vision mode to turn off the IR LEDs. This means you can&#8217;t use the night vision mode while the camera is behind a window. Thankfully its easy to disable Tapo camera IR LEDs!</p>



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



<h2 class="wp-block-heading has-medium-font-size">The Official (lack of a) Solution</h2>



<p>A <a href="https://community.tp-link.com/en/smart-home/forum/topic/256060">discussion has been ongoing</a> since 2021 on the TP-Link forum regarding this issue. The official TP-Link support recommends disabling night vision mode entirely. Meanwhile, the most popular suggestion among forum users involves covering the LEDs with tape. However, this is often ineffective due to light leaking around and through the tape since the LEDs are inset. <strong><em>My guess for why this hasn&#8217;t been addressed with a straightforward firmware update is that the camera&#8217;s design links the digital output controlling the IR filter to the IR LEDs.</em></strong> As a result, they cannot be independently deactivated, representing a significant design flaw if true!</p>



<h2 class="wp-block-heading has-medium-font-size">Opening the Camera</h2>



<p>Opening the camera is just a matter of using a prying tool along the front edge of the camera and the front plate will pop off &#8212; there are four clips, one along each side. It&#8217;s okay to use a bit of force, you won&#8217;t break it (don&#8217;t quote me on that). Conveniently, the LEDs are on a daughter board that connects to the PCB.</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="618" src="https://paulbupejr.com/wp-content/uploads/2023/12/tapo-1-1-1024x618.jpg" alt="" class="wp-image-871" srcset="https://paulbupejr.com/wp-content/uploads/2023/12/tapo-1-1-1024x618.jpg 1024w, https://paulbupejr.com/wp-content/uploads/2023/12/tapo-1-1-300x181.jpg 300w, https://paulbupejr.com/wp-content/uploads/2023/12/tapo-1-1-768x464.jpg 768w, https://paulbupejr.com/wp-content/uploads/2023/12/tapo-1-1-1536x928.jpg 1536w, https://paulbupejr.com/wp-content/uploads/2023/12/tapo-1-1-2048x1237.jpg 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading has-medium-font-size">The Simple (slightly broken) Solution to Disable Tapo Camera IR LEDs</h2>



<p><strong><em>If you don&#8217;t mind losing the microphone and indicator LED</em></strong> you can simply remove the daughter board PCB entirely and the camera will still function. This allows the use of night vision mode without the IR LEDs causing reflections on the glass.</p>



<h2 class="wp-block-heading has-medium-font-size">The Less Simple (more functional) Solution to Disable Tapo Camera IR LEDs</h2>



<p>A more comprehensive approach involves desoldering the IR LEDs. This is relatively straightforward with tools like a hot air tool, heat gun, toaster oven, or even a stove and pan. I wouldn&#8217;t recommend using a soldering iron; the PCB&#8217;s heat sink properties mean that the LEDs may be damaged before the solder melts enough. I used a hot air tool on the PCB&#8217;s rear, directly behind an LED, and gently pulled on the LED with tweezers. The LEDs detached after a few seconds of heating.<strong> KEEP THE LEDs</strong>!</p>



<p>There are two hardware versions of the C110. Version 1 has three LEDs, while version 2 has two. I have one of each version, and found the LEDs in both easy to remove.</p>



<h2 class="wp-block-heading has-medium-font-size">Reversing the Changes</h2>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="621" src="https://paulbupejr.com/wp-content/uploads/2023/12/tapo-3-1-1024x621.jpg" alt="" class="wp-image-873" srcset="https://paulbupejr.com/wp-content/uploads/2023/12/tapo-3-1-1024x621.jpg 1024w, https://paulbupejr.com/wp-content/uploads/2023/12/tapo-3-1-300x182.jpg 300w, https://paulbupejr.com/wp-content/uploads/2023/12/tapo-3-1-768x465.jpg 768w, https://paulbupejr.com/wp-content/uploads/2023/12/tapo-3-1-1536x931.jpg 1536w, https://paulbupejr.com/wp-content/uploads/2023/12/tapo-3-1-2048x1241.jpg 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>If you decide to reverse these modifications, you can easily solder the LEDs back on or reattach the PCB. I ultimately reversed this change for all my cameras once they were no longer needed for window surveillance. Resoldering the LEDs is doable without extra solder, but I suggest using at least a bit of flux for better results. I personally applied a small dab of solder paste. For the resoldering process, I used a hot plate. It&#8217;s crucial to align the pads on the PCB with that on the LED by size to ensure correct polarity.</p>
<p>The post <a href="https://paulbupejr.com/disable-tp-link-tapo-camera-ir-leds/">Disable TP-Link Tapo Camera IR LEDs</a> appeared first on <a href="https://paulbupejr.com">Paul Bupe Jr, PhD</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://paulbupejr.com/disable-tp-link-tapo-camera-ir-leds/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
			</item>
		<item>
		<title>Easy Raspberry Pi Pico Microcontroller C / C++ Programming on Windows</title>
		<link>https://paulbupejr.com/raspberry-pi-pico-windows-development/</link>
					<comments>https://paulbupejr.com/raspberry-pi-pico-windows-development/#comments</comments>
		
		<dc:creator><![CDATA[paulbupe]]></dc:creator>
		<pubDate>Tue, 02 Feb 2021 01:06:35 +0000</pubDate>
				<category><![CDATA[Raspberry Pi Pico]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[encoder]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[pico pio]]></category>
		<category><![CDATA[raspberry pi pico]]></category>
		<category><![CDATA[visual studio code]]></category>
		<guid isPermaLink="false">http://paulbupejr.com/?p=734</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"> 6</span> <span class="rt-label rt-postfix">minutes</span></span>This tutorial covers setting up a pretty painless Raspberry Pi Pico C / C++ SDK development workflow on Windows using the Windows Subsystem for Linux (WSL) and Visual Studio Code (VS Code) with IntelliSense code completion! With the Raspberry Pi Pico microcontroller being so new the current C / C++ SDK development process on Windows &#8230; <a href="https://paulbupejr.com/raspberry-pi-pico-windows-development/" class="more-link">Continue reading <span class="screen-reader-text">Easy Raspberry Pi Pico Microcontroller C / C++ Programming on Windows</span></a></p>
<p>The post <a href="https://paulbupejr.com/raspberry-pi-pico-windows-development/">Easy Raspberry Pi Pico Microcontroller C / C++ Programming on Windows</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"> 6</span> <span class="rt-label rt-postfix">minutes</span></span>
<p>This tutorial covers setting up a pretty painless Raspberry Pi Pico C / C++ SDK development workflow on Windows using the Windows Subsystem for Linux (WSL) and Visual Studio Code (VS Code) with IntelliSense code completion!  </p>



<p>With the Raspberry Pi Pico microcontroller being so new the current C / C++ SDK development process on Windows <a href="https://datasheets.raspberrypi.org/pico/getting-started-with-pico.pdf" target="_blank" rel="noreferrer noopener">is a bit cumbersome</a>. This tutorial should hopefully give you some ideas on how to go about programming the Raspberry Pi Pico the easy way with WSL and VS Code.</p>



<p><strong><em>Note: This is not a beginner tutorial and assumes some minimal development experience.</em></strong></p>



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



<p>The Raspberry Pi Pico is an exciting new microcontroller board <a href="https://www.raspberrypi.org/blog/raspberry-pi-silicon-pico-now-on-sale/" target="_blank" rel="noreferrer noopener">launched on January 21, 2021</a>. It&#8217;s based on the RP2040 microcontroller (by the Raspberry Pi Foundation) sporting a <strong>dual-core</strong> ARM Cortex-M0+ running at 133 MHz. The most exciting feature is the Programmable I/O, or PIO, that has 8 independent processors (simple state machines). This is huge for robotics where there&#8217;s a need to ingest real-time sensor data in the background while performing other tasks. <em>Keep an eye out for my tutorial on reading multiple DC motor quadrature encoders at the same time without messing with lots of timers and interrupts using the PIO!</em></p>



<h2 class="wp-block-heading">Prerequisites</h2>



<ol class="wp-block-list"><li>Enable <a href="https://docs.microsoft.com/windows/wsl/install-win10" target="_blank" rel="noreferrer noopener"><strong>Windows Subsystem for Linux</strong></a> and install the latest Ubuntu image (20); follow the &#8220;Manual Installation&#8221; steps. WSL is a built-in feature of Windows 10 and brings most of the power of developing on a Linux machine natively into Windows! Be sure to install Windows Terminal for an even better experience (instructions towards the end of the link above). </li><li>Install <strong><a href="https://code.visualstudio.com/download" target="_blank" rel="noreferrer noopener">Visual Studio Code</a></strong> and install the following extensions:<a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl" target="_blank" rel="noreferrer noopener"> Remote &#8211; WSL</a>, <a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools" target="_blank" rel="noreferrer noopener">C/C++</a>, and <a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools" target="_blank" rel="noreferrer noopener">CMake Tools</a>. You can search for these extensions by name directly in VS Code. </li></ol>



<h2 class="wp-block-heading" id="configurewsl">Configure WSL</h2>



<h5 class="wp-block-heading">Setup Script</h5>



<p>If you are in a bit of a rush I&#8217;ve created a setup script that will perform all the WSL configuration tasks for you. Just open up WSL, run the following commands, then <a href="#configurecode">skip to setting up Visual Studio Code</a>! </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;}">cd ~
git clone https://github.com/74ls04/pico-wsl-setup.git
cd pico-wsl-setup
./pico_wsl_setup.sh</pre></div>



<p><strong>This script will install the SDK in <code>~/pico</code></strong> and also installs a few Pico extras from the Raspberry Pi Pico repos. </p>



<h5 class="wp-block-heading">Install Dependencies</h5>



<p><em>Note: I&#8217;m using Ubuntu 18 for this demo but if you&#8217;re starting from scratch use 20 to avoid issues with CMake compatibility.</em></p>



<p>First, open up the WSL Ubuntu terminal and go to the home directory.</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;}">cd ~</pre></div>



<p> Then install the required build dependencies </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 apt update
sudo apt install git cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential</pre></div>



<p>That&#8217;s all there is for dependencies!</p>



<h5 class="wp-block-heading" id="sdkinstall">Install the Raspberry Pi Pico C / C++ SDK</h5>



<p>While still in the home directory create a directory called <code>pico</code> and go into the <code>pico</code> directory</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;}">mkdir pico
cd pico</pre></div>



<p>After that clone the SDK and examples git repositories.</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;}">git clone -b master https://github.com/raspberrypi/pico-sdk.git
cd pico-sdk
git submodule update --init
cd ..
git clone -b master https://github.com/raspberrypi/pico-examples.git</pre></div>



<p><em>The <code>git submodule</code> command basically pulls in a separate Raspberry Pi repository from <code>https://github.com/raspberrypi/tinyusb.git</code> and downloads those files.</em></p>



<p>Here is what all the commands look like after execution.</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img decoding="async" width="906" height="575" src="https://paulbupejr.com/wp-content/uploads/2021/01/sdk_install.png" alt="Raspberry Pi Pico Toolchain" class="wp-image-750" srcset="https://paulbupejr.com/wp-content/uploads/2021/01/sdk_install.png 906w, https://paulbupejr.com/wp-content/uploads/2021/01/sdk_install-300x190.png 300w, https://paulbupejr.com/wp-content/uploads/2021/01/sdk_install-768x487.png 768w" sizes="(max-width: 906px) 100vw, 906px" /></figure></div>



<h2 class="wp-block-heading" id="configurecode">Configure and Build with Visual Studio Code</h2>



<p>Now we&#8217;re going to configure VS Code and build the following &#8220;blink&#8221; example. </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;clike&quot;,&quot;mime&quot;:&quot;text/x-c++src&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;C++&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;cpp&quot;}">#include &quot;pico/stdlib.h&quot;

int main() {
    const uint LED_PIN = 25;
    gpio_init(LED_PIN);
    gpio_set_dir(LED_PIN, GPIO_OUT);
    while (true) {
        gpio_put(LED_PIN, 1);
        sleep_ms(250);
        gpio_put(LED_PIN, 0);
        sleep_ms(250);
    }
}</pre></div>



<p>So far you should have the following directories:</p>



<pre class="wp-block-code"><code>~/pico
~/pico/pico-sdk
~/pico/pico-examples</code></pre>



<p>Move into the <code>pico-examples</code> directory</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;}">cd pico-examples</pre></div>



<p>Now here is where the integration of VS Code and WSL really shines. Open VS Code into this directory </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;}">code .</pre></div>



<p>This command will launch VS Code and automatically link it to the WSL instance. You should see a green connection label in the bottom left. This process also creates a hidden .vscode sub-directory that will hold the VS Code configuration for this workspace.</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="584" height="63" src="https://paulbupejr.com/wp-content/uploads/2021/01/green-connected.png" alt="" class="wp-image-751" srcset="https://paulbupejr.com/wp-content/uploads/2021/01/green-connected.png 584w, https://paulbupejr.com/wp-content/uploads/2021/01/green-connected-300x32.png 300w" sizes="auto, (max-width: 584px) 100vw, 584px" /></figure></div>



<p></p>



<p>If this is your first time using VS Code with WSL <a href="https://code.visualstudio.com/docs/remote/wsl#_managing-extensions" target="_blank" rel="noreferrer noopener">follow these quick instructions</a> to make sure the three extensions mentioned at the top are also installed in WSL. At this point you may see a notification asking if you would like to configure the project &#8212; click on &#8220;Not now&#8221; as we need to set up a few things first.</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="582" height="207" src="https://paulbupejr.com/wp-content/uploads/2021/01/configure_project.png" alt="" class="wp-image-752" srcset="https://paulbupejr.com/wp-content/uploads/2021/01/configure_project.png 582w, https://paulbupejr.com/wp-content/uploads/2021/01/configure_project-300x107.png 300w" sizes="auto, (max-width: 582px) 100vw, 582px" /></figure></div>



<h5 class="wp-block-heading">Configure CMake Extension</h5>



<p>Click the gear icon in the bottom left and select <code>Settings</code>.</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="390" src="https://paulbupejr.com/wp-content/uploads/2021/01/settings.png" alt="" class="wp-image-753" srcset="https://paulbupejr.com/wp-content/uploads/2021/01/settings.png 1024w, https://paulbupejr.com/wp-content/uploads/2021/01/settings-300x114.png 300w, https://paulbupejr.com/wp-content/uploads/2021/01/settings-768x293.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure></div>



<p></p>



<p>Expand the Extensions tree, select CMake Tools configuration, and then click <code>Add Item</code> under &#8220;<em>Cmake: Build Environment</em>&#8221; to add the SDK path as shown below. If you followed the directory structure in this tutorial your <code>PICO_SDK_PATH</code> will be <code>/home/$USER/pico/pico-sdk</code> where <strong><span class="has-inline-color has-medium-pink-color">$USER is your WSL username</span></strong>. In this case my tutorial username is &#8220;main.&#8221;</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="844" height="530" src="https://paulbupejr.com/wp-content/uploads/2021/01/sdk_path.png" alt="Raspberry Pi Pico SDK Path" class="wp-image-754" srcset="https://paulbupejr.com/wp-content/uploads/2021/01/sdk_path.png 844w, https://paulbupejr.com/wp-content/uploads/2021/01/sdk_path-300x188.png 300w, https://paulbupejr.com/wp-content/uploads/2021/01/sdk_path-768x482.png 768w" sizes="auto, (max-width: 844px) 100vw, 844px" /></figure></div>



<h5 class="wp-block-heading">Configure IntelliSense (Code Completions)</h5>



<p>Open the Command Palette, <code><span class="has-inline-color has-medium-pink-color">Ctrl+Shift+P</span></code>, and start typing &#8220;C/C++&#8221; then select <strong>C/C++: Edit Configurations (JSON)</strong>. </p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="890" height="363" src="https://paulbupejr.com/wp-content/uploads/2021/01/cpp.png" alt="" class="wp-image-756" srcset="https://paulbupejr.com/wp-content/uploads/2021/01/cpp.png 890w, https://paulbupejr.com/wp-content/uploads/2021/01/cpp-300x122.png 300w, https://paulbupejr.com/wp-content/uploads/2021/01/cpp-768x313.png 768w" sizes="auto, (max-width: 890px) 100vw, 890px" /></figure></div>



<p>This will create the following 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;}"> /home/$USER/pico/pico-examples/.vscode/c_cpp_properties.json</pre></div>



<p>Change the file to match the following settings. <strong>Keep in mind that these settings are purely for code-completion and have nothing to do with the actual compiling</strong>.</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;javascript&quot;,&quot;mime&quot;:&quot;application/json&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;JSON&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;json&quot;}">{
    &quot;configurations&quot;: [
        {
            &quot;name&quot;: &quot;Linux&quot;,
            &quot;includePath&quot;: [
                &quot;${workspaceFolder}/**&quot;,
                &quot;/home/$USER/projects/pico/pico-sdk/**&quot;,
                &quot;/usr/lib/gcc/arm-none-eabi/**&quot;
            ],
            &quot;defines&quot;: [],
            &quot;compilerPath&quot;: &quot;arm-none-eabi-gcc&quot;,
            &quot;cStandard&quot;: &quot;c11&quot;,
            &quot;cppStandard&quot;: &quot;c++17&quot;,
            &quot;intelliSenseMode&quot;: &quot;gcc-arm&quot;,
            &quot;configurationProvider&quot;: &quot;ms-vscode.cmake-tools&quot;
        }
    ],
    &quot;version&quot;: 4
}</pre></div>



<p class="has-text-align-center"><span class="has-inline-color has-medium-pink-color"><strong>Replace $USER with your WSL username under &#8220;includePath&#8221;!</strong></span></p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="947" height="523" src="https://paulbupejr.com/wp-content/uploads/2021/01/completion_settings.png" alt="Raspberry Pi Pico Intellisense" class="wp-image-755" srcset="https://paulbupejr.com/wp-content/uploads/2021/01/completion_settings.png 947w, https://paulbupejr.com/wp-content/uploads/2021/01/completion_settings-300x166.png 300w, https://paulbupejr.com/wp-content/uploads/2021/01/completion_settings-768x424.png 768w" sizes="auto, (max-width: 947px) 100vw, 947px" /></figure></div>



<p></p>



<p>Close VS Code and relaunch it again from the terminal 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;}">code .</pre></div>



<p>This time when CMake asks whether you&#8217;d like to configure the project select &#8220;Yes&#8221; and wait for it to finish configuring.</p>



<h5 class="wp-block-heading">Configure Compiler and Build</h5>



<p>Tell VS Code which compiler to use by clicking the &#8220;<em>No Kit Selected</em>&#8221; text at the bottom </p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="671" height="37" src="https://paulbupejr.com/wp-content/uploads/2021/02/compiler-sel.png" alt="Raspberry Pi Pico Compiler Select" class="wp-image-768" srcset="https://paulbupejr.com/wp-content/uploads/2021/02/compiler-sel.png 671w, https://paulbupejr.com/wp-content/uploads/2021/02/compiler-sel-300x17.png 300w" sizes="auto, (max-width: 671px) 100vw, 671px" /></figure></div>



<p>Then selecting <code>GCC for arm-none-eabi...</code> If using Ubuntu 20 your compiler version will be different since I&#8217;m using 18. </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="724" height="405" src="https://paulbupejr.com/wp-content/uploads/2021/02/compiler.png" alt="Raspberry Pi Pico Compiler Menu" class="wp-image-769" srcset="https://paulbupejr.com/wp-content/uploads/2021/02/compiler.png 724w, https://paulbupejr.com/wp-content/uploads/2021/02/compiler-300x168.png 300w" sizes="auto, (max-width: 724px) 100vw, 724px" /></figure>



<p></p>



<p>Open up the &#8220;blink.c&#8221; example file using the explorer menu on the left, <code><span class="has-inline-color has-medium-pink-color">CTRL+SHIFT+E</span></code>. You should see no errors highlighted in the file and code hints should be working as well. </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="694" height="425" src="https://paulbupejr.com/wp-content/uploads/2021/02/codehint.png" alt="Raspberry Pi Pico Code Completion" class="wp-image-770" srcset="https://paulbupejr.com/wp-content/uploads/2021/02/codehint.png 694w, https://paulbupejr.com/wp-content/uploads/2021/02/codehint-300x184.png 300w" sizes="auto, (max-width: 694px) 100vw, 694px" /></figure>



<p></p>



<p>Tell CMake which project to build by clicking on <code>[all]</code> at the bottom</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="671" height="37" src="https://paulbupejr.com/wp-content/uploads/2021/02/build-sel.png" alt="Raspberry Pi Pico Project Select" class="wp-image-771" srcset="https://paulbupejr.com/wp-content/uploads/2021/02/build-sel.png 671w, https://paulbupejr.com/wp-content/uploads/2021/02/build-sel-300x17.png 300w" sizes="auto, (max-width: 671px) 100vw, 671px" /></figure>



<p></p>



<p>Then scroll until you see &#8220;blink.&#8221;</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="667" height="432" src="https://paulbupejr.com/wp-content/uploads/2021/02/project-sel.png" alt="Raspberry Pi Pico Project Select Menu" class="wp-image-772" srcset="https://paulbupejr.com/wp-content/uploads/2021/02/project-sel.png 667w, https://paulbupejr.com/wp-content/uploads/2021/02/project-sel-300x194.png 300w" sizes="auto, (max-width: 667px) 100vw, 667px" /></figure>



<p></p>



<p>You should now see <code>[blink]</code> instead of <code>[all]</code>. Click on &#8220;Build&#8221; to build the project!</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="757" height="37" src="https://paulbupejr.com/wp-content/uploads/2021/02/build.png" alt="Raspberry Pi Pico Build Select" class="wp-image-774" srcset="https://paulbupejr.com/wp-content/uploads/2021/02/build.png 757w, https://paulbupejr.com/wp-content/uploads/2021/02/build-300x15.png 300w" sizes="auto, (max-width: 757px) 100vw, 757px" /></figure>



<p></p>



<p>VS Code will automatically create a build directory and spit out the project binaries into that directory. </p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="720" height="464" src="https://paulbupejr.com/wp-content/uploads/2021/02/build-done.png" alt="Raspberry Pi Pico Build" class="wp-image-775" srcset="https://paulbupejr.com/wp-content/uploads/2021/02/build-done.png 720w, https://paulbupejr.com/wp-content/uploads/2021/02/build-done-300x193.png 300w" sizes="auto, (max-width: 720px) 100vw, 720px" /></figure></div>



<p><em>Keep in mind this built the debug configuration, you can change it to release by clicking on <code>CMake: [Debug]: Ready</code> at the bottom.</em></p>



<h5 class="wp-block-heading">Upload to Raspberry Pi Pico</h5>



<p>Uploading the binary to the Pico is just a matter of dragging the <code>.uf2</code> file into the folder that opens when you plug in the Pico while holding down the <code>BOOTSEL</code> button.</p>



<p>The file to transfer is:</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;}">/home/main/pico/pico-examples/build/blink/blink.uf2</pre></div>



<p>To open the directory you can either right clock on the directory name in VS Code then click &#8220;Reveal in Explorer&#8221; or just type </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;}">explorer.exe .</pre></div>



<p>in the WSL terminal to open that directory in Windows Explorer. <em>That&#8217;s one of the most useful WSL commands!</em></p>



<p>Plug in the Raspberry Pi Pico while holding down the <code>BOOTSEL</code> button and then drag over the <code>.uf2</code> file to the Pico folder. </p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="https://paulbupejr.com/wp-content/uploads/2021/02/transfer.png" alt="Raspberry Pi Pico Upload" class="wp-image-776" width="728" height="331" srcset="https://paulbupejr.com/wp-content/uploads/2021/02/transfer.png 970w, https://paulbupejr.com/wp-content/uploads/2021/02/transfer-300x136.png 300w, https://paulbupejr.com/wp-content/uploads/2021/02/transfer-768x349.png 768w" sizes="auto, (max-width: 728px) 100vw, 728px" /></figure>



<p>It will automatically disconnect after transferring and immediately start running the program! </p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://paulbupejr.com/wp-content/uploads/2021/02/pico-2-1024x696.jpg" alt="Raspberry Pi Pico" class="wp-image-781" width="512" height="348" srcset="https://paulbupejr.com/wp-content/uploads/2021/02/pico-2-1024x696.jpg 1024w, https://paulbupejr.com/wp-content/uploads/2021/02/pico-2-300x204.jpg 300w, https://paulbupejr.com/wp-content/uploads/2021/02/pico-2-768x522.jpg 768w, https://paulbupejr.com/wp-content/uploads/2021/02/pico-2-1536x1044.jpg 1536w, https://paulbupejr.com/wp-content/uploads/2021/02/pico-2-2048x1392.jpg 2048w" sizes="auto, (max-width: 512px) 100vw, 512px" /></figure></div>



<p>It&#8217;s also pretty easy to configure VS Code to automatically move the file after building but for the sake of keeping this short I&#8217;ll save that for another time.</p>



<h2 class="wp-block-heading">More to come!</h2>



<p>This should hopefully give you an idea of how the current development process is for the Raspberry Pi Pico. My goal is to create another robotics-focused Pico tutorial in the coming months starting from scratch and using the PIO &#8212; maybe in conjunction with a <a href="https://paulbupejr.com/raspberry-pi-serial-console/">Raspberry</a> <a href="https://paulbupejr.com/autonomous-robot-design/">Pi</a>!</p>



<p>Feel free to ask any questions or offer suggestions in the comments!</p>



<p>Updated: 2/11/2021</p>
<p>The post <a href="https://paulbupejr.com/raspberry-pi-pico-windows-development/">Easy Raspberry Pi Pico Microcontroller C / C++ Programming on Windows</a> appeared first on <a href="https://paulbupejr.com">Paul Bupe Jr, PhD</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://paulbupejr.com/raspberry-pi-pico-windows-development/feed/</wfw:commentRss>
			<slash:comments>28</slash:comments>
		
		
			</item>
		<item>
		<title>Raspberry Pi Headless Access Using Built-in Serial Console</title>
		<link>https://paulbupejr.com/raspberry-pi-serial-console/</link>
					<comments>https://paulbupejr.com/raspberry-pi-serial-console/#comments</comments>
		
		<dc:creator><![CDATA[paulbupe]]></dc:creator>
		<pubDate>Sun, 24 Jan 2021 18:14:51 +0000</pubDate>
				<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[raspberry pi]]></category>
		<category><![CDATA[Serial]]></category>
		<guid isPermaLink="false">http://paulbupejr.com/?p=706</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"> 3</span> <span class="rt-label rt-postfix">minutes</span></span>It&#8217;s not very well known that the Raspberry Pi has a built-in serial console that provides a fully working Linux terminal over serial. This allows for network-free headless access, including the absolutely necessary tab auto-complete! This feature is extremely useful for those projects that don&#8217;t use a screen or need network access. It&#8217;s also quite &#8230; <a href="https://paulbupejr.com/raspberry-pi-serial-console/" class="more-link">Continue reading <span class="screen-reader-text">Raspberry Pi Headless Access Using Built-in Serial Console</span></a></p>
<p>The post <a href="https://paulbupejr.com/raspberry-pi-serial-console/">Raspberry Pi Headless Access Using Built-in Serial Console</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"> 3</span> <span class="rt-label rt-postfix">minutes</span></span>
<p>It&#8217;s not very well known that the Raspberry Pi has a built-in serial console that provides a fully working Linux terminal over serial. This allows for network-free headless access, including the absolutely necessary tab auto-complete! This feature is extremely useful for those projects that don&#8217;t use a screen or need network access. It&#8217;s also quite necessary when you are using a Pi as a wireless access point for a LAN without internet sharing.</p>



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



<p>Quick disclaimer: This article assumes basic familiarity with the Raspberry Pi and the basics of interfacing with serial devices. I&#8217;m using Windows to demonstrate but this works equally well on Linux and Mac. </p>



<h2 class="wp-block-heading">Hardware</h2>



<p>You&#8217;ll need a Raspberry Pi (of course) and a USB -to-Serial device (<a href="https://www.adafruit.com/product/954" target="_blank" rel="noreferrer noopener">like this one from Adafruit</a>).</p>



<p>Firstly, connect the RX of the USB-to-Serial device to <code><span class="has-inline-color has-purple-color">Pin 8</span></code> of the Pi (physical <code><span class="has-inline-color has-purple-color">Pin 8</span></code>, not the GPIO pin number) and TX of the USB-to-Serial device to <code><span class="has-inline-color has-purple-color">Pin 10</span></code> of the Pi. </p>



<p>Remember, for UART communication you do not match up TX &lt;&#8211;&gt; TX and RX &lt;&#8211;&gt; RX, it&#8217;s the opposite (TX &#8211;&gt; RX and RX &lt;&#8211; TX) since one device transmits and the other receives. </p>



<div class="wp-block-image"><figure class="aligncenter size-medium"><img loading="lazy" decoding="async" width="297" height="300" src="https://paulbupejr.com/wp-content/uploads/2021/01/Pinout-297x300.png" alt="Raspberry Pi Pinout" class="wp-image-717" srcset="https://paulbupejr.com/wp-content/uploads/2021/01/Pinout-297x300.png 297w, https://paulbupejr.com/wp-content/uploads/2021/01/Pinout-45x45.png 45w, https://paulbupejr.com/wp-content/uploads/2021/01/Pinout.png 731w" sizes="auto, (max-width: 297px) 100vw, 297px" /><figcaption>https://pinout.xyz/pinout/uart#</figcaption></figure></div>



<p></p>



<p>Finally, connect the ground of the USB-to-Serial device to <span class="has-inline-color has-purple-color"><code>Pin 6</code></span> of the Pi (ground).</p>



<p><strong><span class="has-inline-color has-medium-pink-color">NOTE: Do NOT connect the 5V power wire from the USB-to-Serial adapter to the 5V power pin of the Pi.</span></strong> <a href="https://raspberrypi.stackexchange.com/questions/28310/whats-the-problem-with-backfeeding" target="_blank" rel="noreferrer noopener">This can backpower the Pi and destroy it</a>. All that&#8217;s necessary is that the USB-to-Serial adapter and Pi share the same ground reference. Using the<a href="https://www.adafruit.com/product/954" target="_blank" rel="noreferrer noopener"> Adafruit adapter</a>, the connections look like the picture at the top of the page.</p>



<h2 class="wp-block-heading">Software</h2>



<p>To enable the serial console just add the line:</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;}">enable_uart=1</pre></div>



<p>to <code>/boot/config.txt</code> on the Pi.  <code>/boot/</code> is also mounted automatically on Windows so you can do this on a fresh image immediately after burning to the SD card (you may need to take it out and re-insert it first). </p>



<p>After connecting the USB-to-Serial adapter you can figure out the serial COM port using device manager.</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="582" height="429" src="https://paulbupejr.com/wp-content/uploads/2021/01/piserial-2.jpg" alt="Device manager" class="wp-image-722" srcset="https://paulbupejr.com/wp-content/uploads/2021/01/piserial-2.jpg 582w, https://paulbupejr.com/wp-content/uploads/2021/01/piserial-2-300x221.jpg 300w" sizes="auto, (max-width: 582px) 100vw, 582px" /></figure></div>



<p></p>



<p>The serial port needs to be configured with the settings below. Generally everything below but the baud rate are the default on most systems so that&#8217;s all you need to specify. </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;}">    Speed (baud rate): 115200
    Bits: 8
    Parity: None
    Stop Bits: 1
    Flow Control: None</pre></div>



<p>In this case I&#8217;m using PuTTY to connect to the Pi as shown:</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="452" height="442" src="https://paulbupejr.com/wp-content/uploads/2021/01/piserial-3.jpg" alt="Putty" class="wp-image-723" srcset="https://paulbupejr.com/wp-content/uploads/2021/01/piserial-3.jpg 452w, https://paulbupejr.com/wp-content/uploads/2021/01/piserial-3-300x293.jpg 300w, https://paulbupejr.com/wp-content/uploads/2021/01/piserial-3-45x45.jpg 45w" sizes="auto, (max-width: 452px) 100vw, 452px" /></figure></div>



<p></p>



<p>After connecting you should be met with a blank screen, simply press <code>ENTER</code> to send a character and you&#8217;ll see the familiar login prompt. Enter the login credentials and you&#8217;re in, just like you SSH&#8217;d in!</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="661" height="418" src="https://paulbupejr.com/wp-content/uploads/2021/01/piserial-4.jpg" alt="Raspberry Pi Login" class="wp-image-725" srcset="https://paulbupejr.com/wp-content/uploads/2021/01/piserial-4.jpg 661w, https://paulbupejr.com/wp-content/uploads/2021/01/piserial-4-300x190.jpg 300w" sizes="auto, (max-width: 661px) 100vw, 661px" /></figure>



<p></p>



<p>To demonstrate that this is a fully working terminal you can even launch the &#8220;graphical&#8221; <code>raspi-config</code> utility.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="661" height="418" src="https://paulbupejr.com/wp-content/uploads/2021/01/piserial-5.jpg" alt="" class="wp-image-726" srcset="https://paulbupejr.com/wp-content/uploads/2021/01/piserial-5.jpg 661w, https://paulbupejr.com/wp-content/uploads/2021/01/piserial-5-300x190.jpg 300w" sizes="auto, (max-width: 661px) 100vw, 661px" /></figure>



<h2 class="wp-block-heading">That&#8217;s it!</h2>



<p>This should hopefully be a useful bit of info for the more advanced projects that don&#8217;t use the Pi with a screen and mouse/keyboard connected. </p>
<p>The post <a href="https://paulbupejr.com/raspberry-pi-serial-console/">Raspberry Pi Headless Access Using Built-in Serial Console</a> appeared first on <a href="https://paulbupejr.com">Paul Bupe Jr, PhD</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://paulbupejr.com/raspberry-pi-serial-console/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<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 loading="lazy" 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="auto, (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 loading="lazy" 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="auto, (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 loading="lazy" 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="auto, (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:16:33 by W3 Total Cache
-->