Tag: guide

Flashing an Image to a MicroSD Card

In this guide, I’ll be showing you how to flash an image to an SD card using Etcher. The reason we need to do this for a Raspberry Pi is because the Raspberry Pi itself does not contain an operating system. You need to flash a system image to the microSD card for the Pi to be useful. You can use network booting in certain situations, but that is beyond the scope of this guide.

Depending on what you are wanting to do, you will need a different image file to flash. Say that you are wanting to start a webserver, the image that I start out with is Raspbian Lite. If you want to make a Pi in to a retro gaming console, then you are going to want to download RetroPi. It’s up to you to find the correct image to flash.

I will be assuming that you are using Windows to complete this process.

Flashing the image to the MicroSD card:

So the first thing to do is to download the image of the system you want to use and Etcher. Etcher is an easy to use image flashing program that makes it rather foolproof to mess up your operating system accidentally.

Once you have your image downloaded, insert your MicroSD card in to your computer and open Etcher. You should be greeted with a window like the image belowto the right.

Click on the “Select Image” button and then select either the zip file of your image or if you have already extracted the image, you can select the .iso file.

When you have the image and correct device to flash the image to (Etcher is good about selecting the device you want. It selects removable storage first before listing any extra internal drives you have. It will not let you flash and overwrite your computers file system.) selected, simply hit the “Flash!” button and let Etcher do its magic.

While flashing, Windows will shoot out a warning saying that there is a drive connected with an unrecognized format, simply just close this window or click on “Cancel”. DO NOT FORMAT THE DRIVE!

Now, safely eject your microSD card and plug it back in to the computer so that you are able to see the boot drive. You will see the error again about there being an unformatted drive. Simply close the window or click on “Cancel”.

Create a wpa_supplicant.conf and ssh files:

Now that you have the file system flashed, you need to be able for it to connect to the internet so that you can SSH in to it and install the rest of the components you need to run our own website. To do this, you need to create a wpa_supplicant and ssh file on the root folder of the boot drive. Lets start with the wpa_supplicant.

Note: If you are using a hard wire connection on say a Raspberry Pi 3B+, you can skip the supplicant part. You will still need to create the SSH file.
I have made a tool on Codepen that will allow you to enter in your WiFi info and download a properly configured wpa_supplicant.conf file. Simply put in the info, click on “Download wpa_supplicant.conf” button, and move that file to the root folder of the boot drive.

If you are looking to do this yourself and are using WPA/WPA2 security on your WiFi (If you enter in a password, you most likely are), you can download a blank supplicant and edit the file in your favorite text editor as long as its NOT Notepad or Wordpad built in to windows or any of the Office suite (Word) as they do not support unix line breaks. Notepad++ is the most popular free solution.

To make the SSH file, you need to create a blank file called ssh. To do this, you are going to need to be able to edit file extensions. To turn this feature on, please follow this guide. Now, create a new file on the root folder, and name it just plain ssh. No file extension or anything. The way I do this is when I rename the file, I hit Ctrl + A and type s-s-h (without the dashes) and hit Enter. Windows will warn you about changing the file extension, press the yes button. Alternatively, you can download and unzip the file to the root directory of the boot drive.

Now that you have the SSH or both the files that you need to connect the Pi to the network, can can now safely eject the microSD card, plug it in to our Pi, and plug in the Pi to let it boot. This might take a couple of minutes for the first boot.

Find the IP address of the Pi

So this is going to be the hard part because the process is going to be different for everybody. Basically you need to log in to your router, find a list of attached devices, and find the IP address associated with your Raspberry Pi. Really, my only suggestion is to find the model name of your router and google how to list the devices connected your router. When you get to the list of devices, you are looking for the IP address of the device named “RASPBERRYPI”. It should look something along the line of this:

In my case, the IP I am looking for is “”. Remember this, write it down, because you will be needing this.

Use SSH to remote in to the Pi

Now that you have the hard part done, let’s get to installing everything.

Open up PuTTY. Remember that number that I said to remember/write down earlier? Well this is where you get to use it. Type that number in to the “Host Name” box. In the port box to the right, type in 22. For the connection type, make sure “SSH” is selected.

If you want to save this info, you can input a name in the “Saved Sessions” box under all that and click on the “Save” button. This way, whenever you need to connect to your server, you can just double click on the name to connect instead of having to remember the IP address.

On the bottom of the screen, click on the “Open” button. This will bring up a console looking window. It should ask you for a username and password.

The default information is:
Username: pi
Password: raspberry
While typing in the password, it will remain blank even while typing. This is normal. Is is just a security feature to prevent wandering eyes from getting your password.

After logging in, you will get a message that says:
“SSH is enabled and the default password for the ‘pi’ user has not been changed. This is a security risk – please login as the ‘pi’ user and type ‘passwd’ to set a new password.”

So lets set a new password. This is one that you need to be able to remember. Type passwd and hit Enter. You should get a screen asking you for the current password. Type in raspberry and hit enter. The next line will ask you for the new password. Enter in the password you would like it to use (case sensitive) and hit Enter. It will then ask you to confirm the password. Enter in your new password again and hit Enter. You should then get a prompt that says “passwd: password updated successfully”.

After a new password has been set, you want to update the system. To do this, enter in the following lines hitting the Enter key after every line:

sudo apt update
sudo apt upgrade -y

Correcting Crossed Connections

If you are using a connector system on your projects, a good thing to always check is to make sure that your connections are correctly polarized. The good news is, if your connections are not correct, it is usually very easy to switch them around and fix them. In this guide, I will be using 20 gauge silicone JST connectors.

Amazon Associate Program:
As an Amazon Associate I earn from qualifying purchases through my links. There is no extra cost to you.

If your connections are crossed, it is usually as easy as pushing in a couple of pins and sliding the wires out and back in to the correct places.

Find and push the pins

Typically on the male end of the connector, you should see an opening for each pin of the connector.

Push the tabs down

Find something to push down the tabs. I used a pair of tweezers. While doing this, pull on the corosponding wire and use the tweezers to push the tab.

Pull the wire out of the connector

Simply pull the wire out of the connector. Repeat the previous step as many times as necessary.

Make sure pins are reset

You may have to carefully bend the tab back up so that the connection will hold when inserting the pin back in to the connector. You don’t need much, just enough to securely hold the pin.

Push pins back in

Push the pins back in to the connector in the correct order.

Soldering an Inline DC Buck Converter/Voltage Regulator

The LM2596 DC voltage regulator/buck converter is able to take up to 40v and convert it down to as low as 1.5v. This is useful for many projects such as powering a Raspberry Pi or LED lights off a 3D printers power supply. This guide will cover how to wire one together. I will be using the eBoot buck converters in this guide but the premise should be the same no matter what buck converter you use.

How to set up a web server on a Raspberry Pi

Getting your own web server can be very easy to set up. Unlike the old days where you had to work to get all the parts of the server to talk to each other, you can now have a fully functioning server in about 15 minutes and a few commands. Of course, there are advantages and disadvantages of running your own web server. Advantages are that you have complete control of how things are set up, you don’t have to pay for your own hosting which cuts way down on costs, and you can choose other services to run like NPM or NodeJS. But, you also need to keep up on security, backups, and know and follow all applicable laws about internet privacy and such.

I started out running my web server on a Raspberry Pi Zero W with a 16GB MicroSD card. This setup will work great for a small server but as popularity of your site (if you choose to have a public one) grows, it will start to struggle. I eventually upgraded to a Raspberry Pi 3B+ and 32GB MicroSD card for more storage. I did this because the 3B+ is able to handle more traffic, has faster loading times, and an ethernet port so I can hardwire it to make pages load even faster. But ultimately, you do you for your situation.