<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: S. Shahriar</title>
    <description>The latest articles on Forem by S. Shahriar (@shadowshahriar).</description>
    <link>https://forem.com/shadowshahriar</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2697289%2Fc702c6e0-99e6-4fa9-9eeb-414e6d8c997a.jpg</url>
      <title>Forem: S. Shahriar</title>
      <link>https://forem.com/shadowshahriar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/shadowshahriar"/>
    <language>en</language>
    <item>
      <title>3 Things to Look Out for when working with the Raspberry Pi OS</title>
      <dc:creator>S. Shahriar</dc:creator>
      <pubDate>Tue, 25 Mar 2025 20:41:42 +0000</pubDate>
      <link>https://forem.com/shadowshahriar/3-things-to-look-out-for-when-working-with-the-raspberry-pi-os-5bli</link>
      <guid>https://forem.com/shadowshahriar/3-things-to-look-out-for-when-working-with-the-raspberry-pi-os-5bli</guid>
      <description>&lt;p&gt;In the previous post, we learned to write our first line of code on a Raspberry Pi 5. I bought my Raspberry Pi 5 last year and didn't touch it until recently. While planning to use this Raspberry Pi to build some cool robotics and networking projects, I soon started facing some obstacles with the operating system itself.&lt;/p&gt;

&lt;p&gt;So, in this post, I want to share an overview of the challenges I've faced while working on the Raspberry Pi 5, along with solutions that have worked for me. I hope this will also help anyone who is struggling with their own Raspberry Pi 5 programming.&lt;/p&gt;




&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  The Raspberry Pi OS

&lt;ul&gt;
&lt;li&gt;  X11 and Wayland
&lt;/li&gt;
&lt;li&gt;  Identifying whether your Raspberry Pi OS is running X11 or Wayland
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;  Taking screenshots on the Raspberry Pi OS
&lt;/li&gt;

&lt;li&gt;  Screen Blanking
&lt;/li&gt;

&lt;li&gt;  Text-only Boot
&lt;/li&gt;

&lt;li&gt;  Closing Thoughts
&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Raspberry Pi OS
&lt;/h2&gt;

&lt;p&gt;Now before addressing the challenges, we must understand a few key aspects of the operating system itself.&lt;/p&gt;

&lt;p&gt;Raspberry Pi OS is a free and open-source, &lt;strong&gt;Linux-based operating system&lt;/strong&gt;, a port of &lt;a href="https://en.wikipedia.org/wiki/Debian" rel="noopener noreferrer"&gt;&lt;strong&gt;Debian&lt;/strong&gt;&lt;/a&gt; designed to run on a &lt;strong&gt;Raspberry Pi SBC&lt;/strong&gt;. The version of Pi OS I am running on my Raspberry Pi is based on &lt;strong&gt;Debian 12&lt;/strong&gt; which I can confirm by typing the following command in a terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    hostnamectl | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s2"&gt;"Operating System|Kernel|Architecture"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which will output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Operating System: Debian GNU/Linux 12 &lt;span class="o"&gt;(&lt;/span&gt;bookworm&lt;span class="o"&gt;)&lt;/span&gt;
          Kernel: Linux 6.6.74+rpt-rpi-2712
    Architecture: arm64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the release of Bookworm in 2023, &lt;a href="https://en.wikipedia.org/wiki/X_Window_System" rel="noopener noreferrer"&gt;&lt;strong&gt;X11&lt;/strong&gt;&lt;/a&gt; was replaced by &lt;a href="https://en.wikipedia.org/wiki/Wayland_(protocol)" rel="noopener noreferrer"&gt;&lt;strong&gt;Wayland&lt;/strong&gt;&lt;/a&gt;, which became the default operating mode for Raspberry Pi 4 and 5.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"With the release of Bookworm in 2023, we replaced mutter with a new dedicated Wayland compositor called wayfire and made Wayland the default mode of operation for Raspberry Pi 4 and 5, while continuing to run X on lower-powered models."&lt;/p&gt;

&lt;p&gt;— &lt;a href="https://www.raspberrypi.com/news/author/simon-long" rel="noopener noreferrer"&gt;Simon Long&lt;/a&gt; from &lt;a href="https://www.raspberrypi.com/news/a-new-release-of-raspberry-pi-os/" rel="noopener noreferrer"&gt;&lt;strong&gt;"A new release of Raspberry Pi OS"&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  X11 and Wayland
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;X Window System&lt;/strong&gt; or &lt;a href="https://en.wikipedia.org/wiki/X_Window_System" rel="noopener noreferrer"&gt;&lt;strong&gt;X11&lt;/strong&gt;&lt;/a&gt; for short, is the traditional display server protocol that has been used on Linux for decades. On the other hand, &lt;a href="https://en.wikipedia.org/wiki/Wayland_(protocol)" rel="noopener noreferrer"&gt;&lt;strong&gt;Wayland&lt;/strong&gt;&lt;/a&gt; is a modern display server protocol that was designed to replace X11. Wayland also aimed to be to more efficient, secure, and easier to develop and maintain than X11.&lt;/p&gt;

&lt;p&gt;In contrast to X11, Wayland employs uses a &lt;strong&gt;compositor-based model&lt;/strong&gt; where the compositor controls the entire display, including rendering windows and graphics. This results in a layer of incompatibility among application packages.&lt;/p&gt;

&lt;h3&gt;
  
  
  Identifying whether your Raspberry Pi OS is running X11 or Wayland
&lt;/h3&gt;

&lt;p&gt;As mentioned earlier, some X11 applications and utilities are incompatible with the Wayland protocol, and the same is true in reverse. When working on a project that directly uses system commands, it is essential to know whether we are using X11 or Wayland to ensure our code is compatible across different environments.&lt;/p&gt;

&lt;p&gt;Now, we can use our trusty &lt;code&gt;grep&lt;/code&gt; command to search for the session type in the environment variables. To do so, open a new terminal from your desktop and type the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    &lt;span class="nb"&gt;env&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"XDG_SESSION_TYPE"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you are using &lt;strong&gt;Wayland&lt;/strong&gt;, this will yield,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    &lt;span class="nv"&gt;XDG_SESSION_TYPE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;wayland
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you are using &lt;strong&gt;X11&lt;/strong&gt;, you will see,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    &lt;span class="nv"&gt;XDG_SESSION_TYPE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;x11
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Taking screenshots on the Raspberry Pi OS
&lt;/h2&gt;

&lt;p&gt;Raspberry Pi OS offers two distinct command-line tools to take screenshots. One is called &lt;code&gt;grim&lt;/code&gt; and the other is called &lt;code&gt;scrot&lt;/code&gt;. &lt;code&gt;grim&lt;/code&gt; is only compatible with a Wayland environment as it was designed to capture images from a Wayland compositor.&lt;/p&gt;

&lt;p&gt;On the other hand, &lt;code&gt;scrot&lt;/code&gt; is only compatible with an X11 environment. So if we try to use the &lt;code&gt;scrot&lt;/code&gt; command in a Wayland environment, it will produce a completely black image! 😯&lt;/p&gt;

&lt;p&gt;I was completely clueless why the &lt;code&gt;scrot&lt;/code&gt; was not working. Then I realized my Pi OS is running on the Wayland environment 🙈 My suspicion became true when I used the &lt;strong&gt;Print Screen&lt;/strong&gt; key on my keyboard.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Print Screen&lt;/strong&gt; key (&lt;strong&gt;PrtScn&lt;/strong&gt; for short) is found on full-size keyboards and is used to take screenshots on all operating systems. But in the case of the Raspberry Pi OS, it's configured to execute &lt;code&gt;grim&lt;/code&gt; or &lt;code&gt;scrot&lt;/code&gt; command depending on the environment we are using.&lt;/p&gt;

&lt;p&gt;Both &lt;code&gt;grim&lt;/code&gt; or &lt;code&gt;scrot&lt;/code&gt; produce PNG images with a date timestamp filename by default. But there is a major difference between &lt;code&gt;grim&lt;/code&gt; or &lt;code&gt;scrot&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;When these two commands are executed without arguments, the &lt;code&gt;scrot&lt;/code&gt; command will create the image in &lt;code&gt;/home/pi/&lt;/code&gt; directory. But in the case of &lt;code&gt;grim&lt;/code&gt;, it will create the image in &lt;code&gt;/home/pi/Pictures/&lt;/code&gt; directory. It is always good to specify the output location when using these two tools.&lt;/p&gt;

&lt;p&gt;Specifying output location for &lt;code&gt;grim&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    grim path/to/your/image.png
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Specifying output location for &lt;code&gt;scrot&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    scrot path/to/your/image.png
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Screen Blanking
&lt;/h2&gt;

&lt;p&gt;Oh, this is a big one! I screamed when my Raspberry Pi's screen suddenly turned black and the fan started running violently. I was almost certain I had bricked the Pi 😥&lt;/p&gt;

&lt;p&gt;I unplugged the Raspberry Pi's power supply to turn it off. When I tried to boot the Pi up, it surprisingly booted.&lt;/p&gt;

&lt;p&gt;After about &lt;strong&gt;10 minutes&lt;/strong&gt;, its screen turned black again. After doing some research, I learned that all I had to do was turn off &lt;strong&gt;Screen Blanking&lt;/strong&gt; in the &lt;strong&gt;Raspberry Pi Configuration&lt;/strong&gt; 😯&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F02-3-things-to-look-out-for-when-working-with-the-raspberry-pi-os%2Fimages%2Fscreen-blanking.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F02-3-things-to-look-out-for-when-working-with-the-raspberry-pi-os%2Fimages%2Fscreen-blanking.png" alt="Raspberry Pi Screen Blanking" width="783" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Screen Blanking&lt;/strong&gt; acts like a screensaver, turning off video output after a period of inactivity.&lt;/p&gt;

&lt;p&gt;Here is how I disabled &lt;strong&gt;Screen Blanking&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open the applications menu by clicking the Raspberry Pi icon in the taskbar.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Go to &lt;strong&gt;Preferences&lt;/strong&gt; &amp;gt; &lt;strong&gt;Raspberry Pi Configuration&lt;/strong&gt;. Under the &lt;strong&gt;Display&lt;/strong&gt; tab, toggle &lt;strong&gt;Screen Blanking&lt;/strong&gt; off.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you intend to use your Raspberry Pi as a standalone device that may remain inactive for long periods, you should disable &lt;strong&gt;Screen Blanking&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Text-only Boot
&lt;/h2&gt;

&lt;p&gt;Yesterday, I was testing the performance of my Raspberry Pi by performing daily tasks such as web browsing, coding, and video streaming. However, when I tried to turn the Pi off, it got stuck in the splash screen. It took forever to shut down, so I unplugged the power supply and started investigating.&lt;/p&gt;

&lt;p&gt;Some forum posts suggested that the SD card might be corrupted. They recommended reimaging Raspberry Pi OS on a new SD card to resolve the problem. However, since I am using an SSD, I was quite skeptical about the possibility of storage corruption. Nevertheless, I decided to reimage the Raspberry Pi OS using the &lt;strong&gt;Raspberry Pi Imager&lt;/strong&gt; and then booted the Pi.&lt;/p&gt;

&lt;p&gt;After using the freshly installed OS, I decided to reboot to see if everything was okay. Now, it got stuck again in the splash screen.&lt;/p&gt;

&lt;p&gt;I noticed when I shutdown, there is a text &lt;code&gt;plymouth-poweroff.service&lt;/code&gt; at the bottom-left of the screen. When I tried to reboot, the text read &lt;code&gt;plymouth-reboot.service&lt;/code&gt;. A quick Google search suggested it could be possible that the &lt;strong&gt;plymouth&lt;/strong&gt; service was corrupted, and reinstalling it might fix the problem. So, I began purging it using the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt purge plymouth &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I reinstalled &lt;code&gt;plymouth&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;plymouth
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But the problem was still there. Then I came across another forum post suggesting that the Raspberry Pi might have trouble shutting down all its services, which could cause it to get stuck 🤔&lt;/p&gt;

&lt;p&gt;When the splash screen is turned off, we will be able to see which services are blocking the Pi from rebooting or shutting down. There is an option to disable the traditional splash screen boot. Here is how to do that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open a new terminal and type &lt;code&gt;sudo raspi-config&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Navigate to &lt;strong&gt;System Options&lt;/strong&gt; &amp;gt; &lt;strong&gt;Splash Screen&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;You will be prompted whether you want to enable the splash screen, click &lt;strong&gt;No&lt;/strong&gt;. This will enable text-only boot.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Ok&lt;/strong&gt;, then &lt;strong&gt;Finish&lt;/strong&gt;. You will be prompted to reboot. Click &lt;strong&gt;Yes&lt;/strong&gt; as the changes will take effect after a reboot.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Soon the issue was found. In my previous post, I enabled &lt;strong&gt;VNC&lt;/strong&gt; on the Raspberry Pi for remote desktop access, but the &lt;strong&gt;WayVNC&lt;/strong&gt; service was running continuously, preventing reboot and shutdown. Disabling &lt;strong&gt;VNC&lt;/strong&gt; resolved the problem.&lt;/p&gt;

&lt;p&gt;Text-only Boot is extremely helpful for debugging such scenarios.&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing Thoughts
&lt;/h2&gt;

&lt;p&gt;These are the three challenges I faced and learned from. I hope this post helps anyone going through the same struggles. I have summarized many details to keep this article to the point. Please feel free to ask any questions regarding the article.&lt;/p&gt;

&lt;p&gt;Will write soon ✨&lt;/p&gt;

&lt;center&gt;
&lt;a href="https://codepen.io/ShadowShahriar" rel="noopener noreferrer"&gt;&lt;b&gt;CodePen&lt;/b&gt;&lt;/a&gt; | &lt;a href="https://www.threads.net/@shadowshahriar" rel="noopener noreferrer"&gt;&lt;b&gt;Threads&lt;/b&gt;&lt;/a&gt; | &lt;a href="https://wokwi.com/makers/shadowshahriar" rel="noopener noreferrer"&gt;&lt;b&gt;Wokwi&lt;/b&gt;&lt;/a&gt; | &lt;a href="https://dev.to/shadowshahriar"&gt;&lt;b&gt;Dev Community&lt;/b&gt;&lt;/a&gt;
&lt;/center&gt;

</description>
      <category>raspberrypi</category>
      <category>programming</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>Getting my hands on the Raspberry Pi 5!</title>
      <dc:creator>S. Shahriar</dc:creator>
      <pubDate>Sun, 23 Mar 2025 21:28:09 +0000</pubDate>
      <link>https://forem.com/shadowshahriar/getting-my-hands-on-the-raspberry-pi-5-31g7</link>
      <guid>https://forem.com/shadowshahriar/getting-my-hands-on-the-raspberry-pi-5-31g7</guid>
      <description>&lt;p&gt;As someone who's been always passionate about computers and electronics. I was closely following the release of &lt;strong&gt;Raspberry Pi 5&lt;/strong&gt;. Last year, I purchased my first &lt;strong&gt;Raspberry Pi 5&lt;/strong&gt;, but it has been sitting unused on my shelf ever since.&lt;/p&gt;

&lt;p&gt;While I was excited to write my first program on a Pi, I was also afraid of destroying it 😓 Luckily, I have become comfortable handling microcontrollers and SBCs, so I decided to give the Pi a try ✨&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Fgetting-started-01.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Fgetting-started-01.jpg" alt="Photo of a person holding a Raspberry Pi 5" width="800" height="1066"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this post, I will give a step-by-step walkthrough of working with a Raspberry Pi, from assembling the components to writing the first &lt;code&gt;Hello World!&lt;/code&gt; program.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; There is a lot of documentation and great resources about Raspberry Pi on the Internet. But I wanted to write my own for future reference.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  Prerequisite
&lt;/li&gt;
&lt;li&gt;  Choosing a Storage Device
&lt;/li&gt;
&lt;li&gt;  Installing the Raspberry Pi OS
&lt;/li&gt;
&lt;li&gt;  Hardware Connections
&lt;/li&gt;
&lt;li&gt;  Running the Raspberry Pi for the First Time
&lt;/li&gt;
&lt;li&gt;  Installing Visual Studio Code on the Pi

&lt;ul&gt;
&lt;li&gt;  Investigating the Problem
&lt;/li&gt;
&lt;li&gt;  Installing the Extensions
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;  Installing Additional Software
&lt;/li&gt;

&lt;li&gt;  Running the First Line of Code
&lt;/li&gt;

&lt;li&gt;  Benchmarks
&lt;/li&gt;

&lt;li&gt;  Accessing the Pi Remotely
&lt;/li&gt;

&lt;li&gt;  What's Next?
&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Prerequisite
&lt;/h2&gt;

&lt;p&gt;I picked up my &lt;a href="https://store.roboticsbd.com/raspberry-pi/2440-raspberry-pi-5-8gb-complete-set-robotics-bangladesh.html" rel="noopener noreferrer"&gt;Raspberry Pi 8GB complete set from &lt;strong&gt;Roboticsbd&lt;/strong&gt;&lt;/a&gt;, which had all the required accessories. But if you are purchasing the hardware separately, here is everything you need:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://store.roboticsbd.com/raspberry-pi/2439-raspberry-pi-5-8gb-robotics-bangladesh.html" rel="noopener noreferrer"&gt;Raspberry Pi 5 (&lt;strong&gt;4GB/8GB/16GB variant&lt;/strong&gt;)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://store.roboticsbd.com/raspberry-pi/1081-raspberry-pi-5-active-cooler-robotics-bangladesh.html" rel="noopener noreferrer"&gt;Active Cooler&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://store.roboticsbd.com/raspberry-pi/1082-official-27w-usb-c-pd-power-supply-for-raspberry-pi-5-white-robotics-bangladesh.html" rel="noopener noreferrer"&gt;Official 27W 5A USB-C Power Supply&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://store.roboticsbd.com/raspberry-pi/1145-micro-hdmi-male-to-hdmi-male-cable-for-pi-4-or-5-robotics-bangladesh.html" rel="noopener noreferrer"&gt;Micro HDMI to HDMI cable&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.raspberrypi.com/products/raspberry-pi-5-case/" rel="noopener noreferrer"&gt;Raspberry Pi Case (&lt;strong&gt;optional&lt;/strong&gt;)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.ryans.com/transcend-300s-64gb-microsdxc-sdhc-uhs-i-u1-memory-card" rel="noopener noreferrer"&gt;Micro SD Card (or SSD)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.ryans.com/aula-ac308-black-wireless-keyboard-and-mouse-combo" rel="noopener noreferrer"&gt;Wireless Mouse and Keyboard Combo&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I followed &lt;a href="https://www.youtube.com/watch?v=go6safw8uQU&amp;amp;t=10s" rel="noopener noreferrer"&gt;&lt;strong&gt;this video from DIY Engineers&lt;/strong&gt;&lt;/a&gt; to install the active cooler on the Raspberry Pi.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choosing a Storage Device
&lt;/h2&gt;

&lt;p&gt;Interestingly, Raspberry Pi now supports M.2 NVME SSDs. But I don't have an &lt;strong&gt;M.2 HAT+&lt;/strong&gt;, so, I had to use a &lt;strong&gt;micro SD card&lt;/strong&gt; instead.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7bl5ps9rbx28ytpiyim0.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7bl5ps9rbx28ytpiyim0.jpg" alt="A person holding a micro SD card" width="800" height="1066"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, after running some &lt;strong&gt;benchmarks&lt;/strong&gt;, I found the micro SD card's performance was terrible. I looked up on Google and found out we can use an external USB SSD to boot up the Pi. I followed &lt;a href="https://www.youtube.com/watch?v=xsSgJo7SRaA" rel="noopener noreferrer"&gt;&lt;strong&gt;this video from Bytes N Bits&lt;/strong&gt;&lt;/a&gt; and made the necessary preparations.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftwt6arelfpxbjae26j7i.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftwt6arelfpxbjae26j7i.jpg" alt="A person holding a pendrive-shaped SSD" width="800" height="1066"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I had this pendrive-shaped &lt;a href="https://www.ryans.com/transcend-esd310c-256gb-usb-type-a-and-type-c-otg-black-portable-ssd" rel="noopener noreferrer"&gt;&lt;strong&gt;SSD from Trancend&lt;/strong&gt;&lt;/a&gt;, where I installed the &lt;strong&gt;Pi OS&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing the Raspberry Pi OS
&lt;/h2&gt;

&lt;p&gt;Unlike microcontrollers, Raspberry Pi is a single-board computer (&lt;strong&gt;SBC&lt;/strong&gt;), which can run full-blown operating systems such as &lt;strong&gt;Linux&lt;/strong&gt;. To install an operating system on our Pi, we can use the &lt;a href="https://www.raspberrypi.com/software/" rel="noopener noreferrer"&gt;&lt;strong&gt;Raspberry Pi Imager&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Install and open the &lt;strong&gt;Raspberry Pi Imager&lt;/strong&gt; on your main computer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the Pi Imager window, select your &lt;strong&gt;Raspberry Pi Device&lt;/strong&gt;. Since I have a Raspberry Pi 5, I will choose that from the list.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Fimager-01.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Fimager-01.png" alt="Choose the preferred Pi device from the list" width="682" height="482"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now select the &lt;strong&gt;Operating System&lt;/strong&gt;. I am going to choose the &lt;strong&gt;64-bit&lt;/strong&gt; version.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Fimager-02.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Fimager-02.png" alt="Choose the preferred Pi OS from the list" width="682" height="482"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Connect the micro SD card or SDD and select the &lt;strong&gt;Storage Device&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Fimager-03.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Fimager-03.png" alt="Choose the storage device from the list" width="682" height="482"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After you click &lt;strong&gt;Next&lt;/strong&gt;, you will receive a prompt asking if you would like to apply OS customization settings. This step is optional, and you can click &lt;strong&gt;No&lt;/strong&gt; to skip it. Since I &lt;em&gt;want&lt;/em&gt; to customize some of the settings, I will click &lt;strong&gt;Edit Settings&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Fimager-04.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Fimager-04.png" alt="Image of the OS customization prompt" width="682" height="482"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I will set the &lt;strong&gt;hostname&lt;/strong&gt;, &lt;strong&gt;username&lt;/strong&gt;, and &lt;strong&gt;password&lt;/strong&gt; to &lt;strong&gt;access the Pi remotely&lt;/strong&gt;. I will also set the WiFi SSID and password so that whenever the Pi boots up, it will automatically connect to my home WiFi.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Fimager-05.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Fimager-05.png" alt="Image of the OS customization window" width="541" height="662"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Having done that, we are finally ready to install the Pi OS on the micro SD card or SSD. The installation process may take some time, depending on the device's speed and WiFi connection.&lt;/p&gt;

&lt;p&gt;Unplug the micro SD card or SSD once the installation is complete.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hardware Connections
&lt;/h2&gt;

&lt;p&gt;I have created a YouTube video that you can follow along:&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/uxGKJFrnxT0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;If you're using a micro SD card, insert it into the Raspberry Pi's SD card slot. If you're using an external SSD like I am, connect the SSD to one of the &lt;strong&gt;USB 3.0 ports&lt;/strong&gt; (the blue ones).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Connect the USB dongle for the mouse and keyboard combo to one of the &lt;strong&gt;USB 2.0 ports&lt;/strong&gt; (the black ones).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Connect the micro HDMI cable to one of the Raspberry Pi's micro HDMI ports and the HDMI end to a monitor.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Connect the power supply to the Raspberry Pi's USB Type-C port.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We will soon see the LED next to the power button, turn green, indicating that the Raspberry Pi is powered on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Running the Raspberry Pi for the First Time
&lt;/h2&gt;

&lt;p&gt;The Raspberry Pi will restart multiple times when booted for the first time. This happens only when we turn on the Raspberry Pi for the first time because it prepares all the services and peripherals under the hood.&lt;/p&gt;

&lt;p&gt;There should be a welcome screen. However, I did not see one since I customized the OS in the previous step.&lt;/p&gt;

&lt;p&gt;Once the Raspberry Pi has successfully booted up, we will be greeted by the desktop.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Fdesktop.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Fdesktop.jpg" alt="The Raspberry Pi desktop" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; If you experience any issues during the boot session ( such as a blank screen), you should check the HDMI and micro HDMI connections. The micro HDMI ports on the Raspberry Pi are fragile enough and can be easily damaged if not handled carefully. Also, ensure that your Raspberry Pi is receiving enough power from the power supply.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Installing Visual Studio Code on the Pi
&lt;/h2&gt;

&lt;p&gt;I wanted to write my first line of code in JavaScript. Since I'm &lt;em&gt;already&lt;/em&gt; familiar with the Visual Studio Code interface, I thought it would be a good idea to use VSCode. The installation process is straightforward and only takes a few clicks.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Finstalling-vscode.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Finstalling-vscode.png" alt="Installing Visual Studio Code" width="800" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the applications menu by clicking the Raspberry Pi button on the left corner.&lt;/li&gt;
&lt;li&gt;Head over to &lt;strong&gt;Preferences&lt;/strong&gt;, click &lt;strong&gt;Recommended Software&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Under the &lt;strong&gt;Programming&lt;/strong&gt; section, check &lt;strong&gt;Visual Studio Code&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Apply&lt;/strong&gt; and wait for a few minutes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This could have ended here. However, I soon encountered an obstacle when VSCode crashed within 5 seconds 😶&lt;/p&gt;

&lt;h3&gt;
  
  
  Investigating the Problem
&lt;/h3&gt;

&lt;p&gt;After some research, I discovered that others are facing the same issue. I found &lt;a href="https://dev.toFORUM-REPLY"&gt;&lt;strong&gt;this forum post&lt;/strong&gt;&lt;/a&gt; where the OP manually installed an older version (&lt;strong&gt;v1.86.2&lt;/strong&gt;) of VSCode, which resolved the problem. Here's how we can do the same:&lt;/p&gt;

&lt;p&gt;Open the terminal and type the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget https://update.code.visualstudio.com/1.86.2/linux-deb-arm64/stable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy the file name and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;dpkg &lt;span class="nt"&gt;-i&lt;/span&gt; code_1.86.2-1707853305_arm64.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This was actually a simple fix, but it took quite a while to figure it out 😓&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; Make sure to uninstall the previously installed version of Visual Studio Code, before running the above commands.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Installing the Extensions
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Finstalling-extensions.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Finstalling-extensions.png" alt="Installing the extensions" width="800" height="375"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the applications menu by clicking the Raspberry Pi button on the left corner.&lt;/li&gt;
&lt;li&gt;Head over to &lt;strong&gt;Programming&lt;/strong&gt; and click &lt;strong&gt;Visual Studio Code&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Press &lt;strong&gt;Ctrl + Shift + X&lt;/strong&gt; to open the &lt;strong&gt;Extensions&lt;/strong&gt; sidebar.&lt;/li&gt;
&lt;li&gt;Search for &lt;strong&gt;ESLint&lt;/strong&gt; and install the one provided by &lt;strong&gt;Microsoft&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For this project, we only need to install one extension. However, we may install more extensions in a future project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Additional Software
&lt;/h2&gt;

&lt;p&gt;To run our JavaScript code, we need a runtime environment like &lt;a href="https://nodejs.org/en" rel="noopener noreferrer"&gt;&lt;strong&gt;Node.js&lt;/strong&gt;&lt;/a&gt;. While we could install it manually, I chose to use &lt;a href="https://pi-apps.io/" rel="noopener noreferrer"&gt;&lt;strong&gt;Pi-Apps&lt;/strong&gt;&lt;/a&gt; to make things easier. You can think of &lt;strong&gt;Pi-Apps&lt;/strong&gt; as a Google Play Store for Raspberry Pi. Here is the installation code from their &lt;a href="https://pi-apps.io/install/" rel="noopener noreferrer"&gt;&lt;strong&gt;official website&lt;/strong&gt;&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget &lt;span class="nt"&gt;-qO-&lt;/span&gt; https://raw.githubusercontent.com/Botspot/pi-apps/master/install | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Having done that, open &lt;strong&gt;Pi-Apps&lt;/strong&gt; by either typing &lt;code&gt;pi-apps&lt;/code&gt; in the terminal or by clicking the desktop shortcut.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Finstalling-nodejs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Finstalling-nodejs.png" alt="Installing Node.js using Pi-Apps" width="800" height="342"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Tools&lt;/strong&gt;, then &lt;strong&gt;Node.js&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Install&lt;/strong&gt; and wait for a few minutes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Installing &lt;strong&gt;Node.js&lt;/strong&gt; through &lt;strong&gt;Pi-Apps&lt;/strong&gt; also installs Node Version Manager (&lt;strong&gt;NVM&lt;/strong&gt;), which is beneficial for managing multiple versions of Node.js for various projects. I will cover NVM and its applications in a future post.&lt;/p&gt;

&lt;h2&gt;
  
  
  Running the First Line of Code
&lt;/h2&gt;

&lt;p&gt;Phew! After much preparation, we are finally ready to write our first line of code on a Raspberry Pi! 🙈&lt;/p&gt;

&lt;p&gt;Go to the Visual Studio Code window and follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;From the menubar, go to &lt;strong&gt;File&lt;/strong&gt; &amp;gt; &lt;strong&gt;Open Folder...&lt;/strong&gt;. Create a new folder named &lt;code&gt;test&lt;/code&gt; in the home directory.&lt;/li&gt;
&lt;li&gt;Create a new file named &lt;code&gt;index.js&lt;/code&gt; in the Explorer.&lt;/li&gt;
&lt;li&gt;From the menubar, click &lt;strong&gt;Terminal&lt;/strong&gt; &amp;gt; &lt;strong&gt;New Terminal&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Verify the installation of &lt;strong&gt;Node.js&lt;/strong&gt; by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Write the following JavaScript code into &lt;code&gt;index.js&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello World&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If everything is okay, we should see &lt;strong&gt;Hello World&lt;/strong&gt; printed in our terminal. Congrats! We just wrote our first JavaScript on a &lt;strong&gt;Raspberry Pi&lt;/strong&gt; 🎉&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Ffirst-line-of-code.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Ffirst-line-of-code.png" alt="First line of code in Raspberry Pi" width="800" height="273"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Benchmarks
&lt;/h2&gt;

&lt;p&gt;I used the built-in &lt;strong&gt;Raspberry Pi Diagonistics&lt;/strong&gt; tool to perform a speed test in both micro SD card and SSD. Here are the results:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Comparsion&lt;/th&gt;
&lt;th&gt;Micro SD Card&lt;/th&gt;
&lt;th&gt;External USB SSD&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Sequential write speed&lt;/td&gt;
&lt;td&gt;26.828 MB/sec&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;335.517 MB/sec&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Random write speed&lt;/td&gt;
&lt;td&gt;1249 IOPS&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;33098 IOPS&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Random read speed&lt;/td&gt;
&lt;td&gt;3356 IOPS&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;36963 IOPS&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;As we can see, the speed of an external SSD dramatically surpasses that of a micro SD card. Now, some of you might think the test isn't fair as I am comparing a &lt;strong&gt;64GB&lt;/strong&gt; micro SD card with a &lt;strong&gt;256GB&lt;/strong&gt; SSD.&lt;/p&gt;

&lt;p&gt;However, the theoretical maximum speed of a USB 3.0 device is &lt;strong&gt;625 MB/s&lt;/strong&gt;, which exceeds the maximum speed of a micro SD card, typically around &lt;strong&gt;104 MB/s&lt;/strong&gt;. Also, micro SD cards aren't designed for continuous data rewrites. So, they tend to get corrupt in a Raspberry Pi sooner than an external SSD.&lt;/p&gt;

&lt;p&gt;Taking everything into account, opting for an external SSD seems like a good decision.&lt;/p&gt;

&lt;h2&gt;
  
  
  Accessing the Pi Remotely
&lt;/h2&gt;

&lt;p&gt;There are times when we might want to run the Raspberry Pi without a monitor. We can do this over our local WiFi by using remote access software like &lt;a href="https://www.realvnc.com/en/connect/download/viewer/" rel="noopener noreferrer"&gt;&lt;strong&gt;RealVNC Viewer&lt;/strong&gt;&lt;/a&gt;. Here's how to set it up:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Enable VNC on the &lt;strong&gt;Raspberry Pi&lt;/strong&gt; by opening the applications menu, &lt;strong&gt;Preferences&lt;/strong&gt; &amp;gt; &lt;strong&gt;Raspberry Pi Configuration&lt;/strong&gt;. Head over to &lt;strong&gt;Interfaces&lt;/strong&gt; and toggle &lt;strong&gt;VNC&lt;/strong&gt; on.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Fenable-vnc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Fenable-vnc.png" alt="Enable VNC on the Raspberry Pi" width="800" height="321"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Download and install the &lt;a href="https://www.realvnc.com/en/connect/download/viewer/" rel="noopener noreferrer"&gt;&lt;strong&gt;RealVNC Viewer&lt;/strong&gt;&lt;/a&gt; on your main computer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run the &lt;strong&gt;RealVNC Viewer&lt;/strong&gt; executable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Go to &lt;strong&gt;File&lt;/strong&gt; &amp;gt; &lt;strong&gt;New Connection...&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update the text field &lt;strong&gt;VNC Server&lt;/strong&gt; to the hostname of your Raspberry Pi.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Frealvnc-01.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Frealvnc-01.png" alt="Type VNC server hostname to connect" width="800" height="571"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Type the &lt;strong&gt;username&lt;/strong&gt; and &lt;strong&gt;password&lt;/strong&gt; in the dialog box.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Frealvnc-02.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Frealvnc-02.png" alt="Type the username and password of the Raspberry Pi" width="800" height="571"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If everything goes right, we should see the desktop of our Raspberry Pi on our main computer 🎉&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Frealvnc-03.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshadowshahriar.github.io%2FDEV%2F01-getting-my-hands-on-the-raspberry-pi-5%2Fimages%2Frealvnc-03.png" alt="Desktop view of Raspberry Pi through RealVNC" width="800" height="467"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;Setting up a Raspberry Pi 5 for the first time to run JavaScript code on it has been a great experience. I have done my best to cover all the basics so that any beginner can follow along. This is also the first post in the &lt;strong&gt;"Raspberry Pi Programming"&lt;/strong&gt; series here on Dev Community 🚀&lt;/p&gt;

&lt;p&gt;We both learned a lot in this journey. Feel free to ask any questions about the post or chat in the comments. See you soon! 🙈✨&lt;/p&gt;

&lt;center&gt;
&lt;a href="https://codepen.io/ShadowShahriar" rel="noopener noreferrer"&gt;&lt;b&gt;CodePen&lt;/b&gt;&lt;/a&gt; | &lt;a href="https://www.threads.net/@shadowshahriar" rel="noopener noreferrer"&gt;&lt;b&gt;Threads&lt;/b&gt;&lt;/a&gt; | &lt;a href="https://wokwi.com/makers/shadowshahriar" rel="noopener noreferrer"&gt;&lt;b&gt;Wokwi&lt;/b&gt;&lt;/a&gt; | &lt;a href="https://dev.to/shadowshahriar"&gt;&lt;b&gt;Dev Community&lt;/b&gt;&lt;/a&gt;
&lt;/center&gt;

</description>
      <category>raspberrypi</category>
      <category>programming</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
