Some things you might have heard being thrown around in the cryptography space are encoding methods. Such encoding methods are normally used to turn binary data into text, typically so it can be used to transmit data over communication methods that do not allow raw binary data to be transmitted.
How does binary turn into Base64?
First, let’s say that we want to encode an image. We start by reading all the bits in the image, which, for this example, will result in a binary stream of 010010101101001000111111. It is important to note that most images are a lot larger than this and will contain hundreds of thousands of bits.
The encoder will first break the binary stream up into their own chunks, each containing six bits. We can do this to our example and get 010010 101101 001000 111111.
Then, we turn our binary chunks into decimals.
To do this, working right to left, we multiply each bit by 2 to the power of p, where p starts from zero and increments by one for every bit in the chunk.
For example, we can calculate 010010 by performing the expression (0 * 20) + (1 * 21) + (0 * 22) + (0 * 23) + (1 * 24) + (0 * 25). We can strip away any parts that multiply by zero, since those will always be zero. The simplified equation is (1 * 21) + (1 * 24) = 2 + 16 = 18. Therefore, 010010 is equivalent to the decimal 18.
Turning every single six-bit binary chunk into a decimal using the process shown above constitutes the numbers (in left-to-right order) 18, 45, 8, and 63.
After that, we can simply cross reference the numbers with whatever alphabet we should use. For example, the six-bit chunk 010010 turns into the decimal 18, which corresponds to S on the Base64 standard alphabet. Therefore, 010010 101101 001000 111111 turns into StI/.
How does binary turn into Base64?: fixing the padding
If the binary string is a multiple of 3, everything fits perfectly. However, if it is not, then we need to add padding to the encoded string until the string’s bit count becomes a multiple of 3.
Let’s take 010010 101101 001000 111111 01 as an example. It is 26 bits long and all full six-bit chunks encode to StI/. However, this is leaving out the two bits at the end.
To pad this, we will keep adding zeroes to the end of the string until it can become a full chunk. Thus, the final chunk, 01, becomes 010000, which corresponds to Q in the Base64 alphabet. Then, we add one padding character (typically an =) for every two bits we had to add for the string to only be made of full chunks. We add two padding characters because four (the number of bits we had to add) divided by two is two.
Thus, you would think that the padded string would be StI/Q==, right? Well, no, because that extra character adds another six bits, meaning that there are still two bits at the end. We can only stay in such a loop two times, so we need to add more zeroes. That means that the final letter is 000000, which is A.
So, the final result is StI/QA==.
How does Base64 turn into binary?
Base64 decoding is just like base64 encoding, but in reverse. First, we turn every single non-padding character into its respective index on the alphabet, then we turn every single number into its binary equivalent.
For example, let’s take our string StI/QA==. We first take every single non-padding character and turn it into a string of numbers that represents their indexes on the alphabet.
This turns our Base64-encoded string into a string of numbers, specifically 18 45 37 62 16 0 = =, since we don’t turn the padding into a number
Regular expressions (abbreviated as a “regex”) are useful tools that help easily find and match text in strings and files. They sort of function like the typical find-in-document feature you are probably used to, only more advanced. However, they can definitely be too advanced for an average person to comprehend. In this guide, I will easily explain this widely used and useful feature so you can search files like a pro.
Something Worth Noting
It is worth noting that regexes are very useful and have lots of features to utilize, but can also be very non-standardized. There are always features in other regex parsing engines that are not supported by others. The features I will be displaying in this guide are the most widely supported ones, but there are always going to be features that I won’t teach you how to use here either because they are not known or because they are defunct and not considered good practice.
Basic Matching
Regexes can match specific strings, no complex syntax needed. For example, to match the text foo in notnotnotfoonotnot, your regex would simply be foo.
This works with multiple instances too; the regex foo would match both instances of foo in notnotnotfoonotnotfoo.
Something else that you should know about basic matching is that there will be two seperate matches if the same matching string is used multiple times (together or not).
This means that the regex foo would match all three foo instances in notnotfoofoonotfoo (notice how there are separate matches for the two instances of foo, even though said instances are together).
Match Any Character
The period selects any character. Note that each character is matched separately.
For example, the regex . in the text foo will match f, o, and the second o.
Notice how in the image above, even special characters and numbers are matched.
Letter Range Match
Let’s say in the text abcdefghijklmnopqrstuvwxyz, we want to match just e, f, g, h, and i. To do this, we can select the letter range that we want (in this case, e through i) using the regex [e-i].
Note that these letter ranges do not have to be subsequent; we can have the regex [a-c] in the text azaczbca match a, a, c, b, c, and a.
Number Range Match
Let’s say in the text 019201836y7 you only want to select the numbers 0, 1, 2, the second 0, and the second 1. In other words, we want to select any number from zero to two, including themselves. We can do this using the number range match, and in this case, we can use the regex [0-2].
These letter ranges also don’t have to be consecutive.
Character Set
Now let’s say you want to match specific characters that can’t be matched with a set. For this, we will use a character set. For example, we can match car and bar in the text car,bar using a character set. Because only the beginning letters of each word change, we can use a character set to match the c and b, and then use basic matching to match the ars. To do this, we can put in the characters we want to put in the set in square brackets.
Ignored Character Set
How about if we wanted to match every character except for c and b. To do this we can use an ignored character set to get the job done. If we wanted to match only tar in the text car,bar,tar, we can use an ignored character set to ignore c and b, then use basic matching as all three words have different initials but the same of everything else. To do this, we can put the characters we want to ignore in square brackets with the character ^ coming before them.
The Asterisk
The asterisk (*), when placed outside a character indicates that said character should be matched even if it does not occur at all or occurs at least once side by side. For example, the regex a* will match at least zero of a, so aaaa will be matched in the text aaaab. This is different from basic matching, as the regex a will count every a as a separate match, while a* will keep all the as in one match as many times as needed to complete the match.
Another examples is that the asterisk is like saying the character that comes before it is optional or can occur multiple times in a row. The regex ab*c in the text abc,abbc,ac will match abc, abbc, and ac.
The Question Mark
The question mark is just like the asterisk in the sense that the character that comes before it is deemed optional, but different in the sense that it will not match characters that occur multiple times in a row. For example, the regex ab?c will match abc and ac, but not abbc.
The Plus Symbol
The plus symbol is also just like the asterisk in the sense that the character that comes before it can occur multiple times in a row, but different in the sense that it does not indicate a character is optional. If we go back to our abc example, we can see that the regex ab+c in abc,abbc,ac will match abc and abbc, but not ac.
Conclusion
And that’s it – you’re done! There are so many other regex sequences you can use, and they just won’t fit into a beginner’s guide. As you saw above, regular expressions are very useful tools, and there are many ways to apply this to your needs.
In this guide, I will be showing you how to install Arch Linux from scratch. You can do this on a physical machine, but I will be doing it on a virtual machine.
What is Arch Linux?
Arch Linux is a minimal Linux distro that is meant for power users and advanced programmers. It does not come with a built-in installer, so we will have to install it manually.
Downloading the ISO
First, head to the Arch Linux downloads page, scroll down until you find the download mirrors, and then choose a link to download, preferably from your country so you get the fastest download speed.
VM Configuration
If you are installing Arch Linux on physical hardware and you are not using a VM to install Arch, skip this section.
If you are on VirtualBox, there should be an Arch Linux preset. If you are on VMware, select Other Linux 5.x Kernel (64-bit).
Giving your VM 8 GB of RAM is a lot more than needed, but if you are going to be using Arch for power-intensive tasks and don’t mind the VM taking up all your host’s RAM, go for whatever fits for you as long as it meets the system requirements of 512 MBminimum, but 2 GB recommended for streamlined daily use.
Now, give your VM any amount of storage you feel fitting, but make sure it meets the system requirements of 1 GBminimum, but 20 GBrecommended.
If you want things to go a little faster on your Arch Linux VM, giving it two processors is recommended. One processor should be enough, though.
If you plan on installing a desktop environment, enable 3D acceleration and give a reasonable amount of VRAM to the guest OS.
And lastly, make sure the CD drive is set to read as the ISO you just downloaded.
Making a Bootable USB
If you are using a VM, skip this section.
Use a tool like Rufus to flash the Arch Linux ISO to a flash drive. Then plug it into the system you want to install Arch Linux to. This guide does not cover dual-booting and assumes you do not have an existing OS installed on your system.
Boot Priority Configuration
Make sure the hard disk is the first on the boot priority list. This is not required; it just makes the final step of the installation a lot quicker.
You can do this in the VM’s settings, the UEFI firmware settings, or the BIOS interface.
Starting the System
If you are on a VM, start it up. If you are on hardware, plug in the thumb drive that you flashed the ISO to and start the machine.
You should see an Arch Linux splash screen. Whichever entry comes first in the list is likely the one that boots to Arch (the name of the entry changes, but typically goes along the lines of “Boot Arch Linux (x86_64)”). Select Boot Arch Linux, or the entry that does so, and click Enter.
After running some tests, you should be dropped into a root Linux shell. Do not remove your thumb drive or installation media, as we have not installed Arch yet and need to do so using the thumb drive.
Accessing the Internet
Let’s check if we have connection to the internet by running the command below (“google.com” can be replaced with a website of your choice):
Bash
pinggoogle.com
You should see packets return. If you do, this means you have online access, which is a necessity for this installation. You can hit Control + C to stop pinging the website.
If you are on a Virtual Machine with no internet, try making sure that you have host internet access, and then try enabling the network adapter in the VMware or VirtualBox settings.
If you are on a physical machine without internet, try using an Ethernet cable, but below you will know how to use iwctl to connect to a Wi-Fi network.
Using iwctl to Connect to a Wi-Fi Network
This part of the guide should only be followed if you do not have Internet access and want to use a wireless internet connection instead of a wired one.
Run the command below to open the iNet Wireless Daemon CTL.
Bash
iwctl
Expected Output
[iwd]#
Now, you can list the wireless adapters using the command below.
Bash
devicelist
You should see a device called wlan0. It is best to go forward using that one, but you can select another wireless adapter if you know what you are doing. If you do not have that device, then you do not have a wireless adapter plugged into the computer, the device is connected but under a different name (which is unlikely), or the computer does not recognize it.
Use the command below to list all the wireless networks found using that device. You can replace wlan0 with the adapter you chose earlier.
Bash
stationwlan0get-networks
You should see a list of networks. Take note of the network’s SSID you want to connect to. Then, you can run the command below to connect to the wireless network, replacing “WirelessNet” with the SSID of your wireless network and wlan0 with the wireless adapter you want to connect to the network using.
Bash
stationwlan0connectWirelessNet
After typing in the Wi-Fi password (if needed), you may now connect to the network. You can test your connection by using ping google.com and waiting for packets to return. If none return, then you might have done something incorrectly when setting up the network.
Setting NTP Time
Now that we have our network up and running, we can enable network time using the command below:
Bash
timedatectlset-ntptrue
Partitioning
Now comes the tricky part. We have to partition our drives manually, so make sure to follow my steps carefully.
Run the below command to get a summary of all the partitions on your drive.
Bash
lsblk
Make sure you choose the right disk to partition, as choosing the wrong one will destroy all of your data. Run the below command to set up partitioning, replacing /dev/sda with the name of the disk you want to format and install Arch Linux on.
As for the label type, it depends what your needs are. If you are installing to a new physical system with a disk size larger than 2TB, select gpt and hit Enter. If you either don’t have a physical system to install Arch to or are installing Arch to a disk smaller than 2TB, use dos. Now, at the menu with drives listed, select the free space and click New. When asked for your partition size, enter the amount needed for your bootloader. If you will be using the GRUB bootloader, enter 128M and hit Enter. If not, specify the amount needed for your bootloader.
Now, select the newly created partition and hit B to make the selected drive bootable.
Select the free space, and click New. The size should automatically default to the remaining storage on your drive. Make the partition fill up the rest of the drive, and click Enter to create the partition. You should not make this partition bootable.
Many people prefer creating home and swap partitions but these are mostly considered redundant nowdays.
Select Write and click Enter, then select Quit and click Enter.
There is only one problem left to solve now – the drives are not in the format of ext4. To solve this, run the commands below, replacing /dev/sda1 and /dev/sda2 with the names your newly created boot and OS partitions.
Bash
mkfs.ext4/dev/sda1mkfs.ext4/dev/sda2
Mounting our Partitions
Now that we are done with arguably the hardest part of Arch installation, we need to mount our drives, which is where the preparation ends and the actual installation starts.
To begin, lets mount our root partition (the partition that is not bootable, /dev/sda2 in my case) to a mount point (this can be anything you want, but traditionally this has always been /mnt. I will be using /mnt, as I do not see any reason to stray from tradition in my case). We can do this using the command below.
Bash
mount/dev/sda2/mnt
In our mount point, let’s create a folder called boot to mount our other drive to.
Bash
mkdir/mnt/boot
Now, let’s mount our boot partition (the one that we flagged bootable earlier, /dev/sda1 in my case) to the folder we just created.
Bash
mount/dev/sda1/mnt/boot
To see if we did everything correctly, we can run the command below.
Bash
lsblk
In the output, you should be able to see partitions under the drive /dev/sda and their respective mount points.
Installing Arch Using pacstrap
Now, we can begin installing system files to Arch.
We can use pacstrap to install Arch Linux and some other packages we want pacstrap to bundle in with our Arch installation. Replace /mnt with the mount point you mounted your root drive to, and vim with some other text editor that you prefer and some other pre-installed packages you want on Arch.
Bash
pacstrap/mntbasebase-devellinuxlinux-firmwarevim
Below ae explanations of some of the packages:
Base: This package contains basic tools that you would want no matter which Linux distribution you are installing.
Base-Devel: This contains developer tools such as compilers, which are needed for some Linux components.
Linux: This is the core Linux kernel that runs everything behind the scenes.
Linux-Firmware: This contains firmware that makes Arch compatible with common hardware
Vim: This can be replaced with any text editor. There is some text editing we are going to have to do, so we need a text editor.
Once pacstrap exits, we can generate an fstab file that lists all the drives Linux could try booting from.
Generating our FSTab File
This is extremely easy to do. Run the command below, replacing /mnt with the mount point you specified earlier.
Bash
genfstab-U/mnt>>/mnt/etc/fstab
What the command should do is write a FSTab file to the drives. The -U flag makes the file reference drives by UUID instead of drive name. This is good because drive names may change in the future, which could mess up your boot configuration if you don’t reference drives by UUID, as UUID never changes.
Jumping to our Arch Installation
It is finally time to change from our installation medium to our disk. Do not remove your installation medium until the end of this guide. You might need it if something breaks.
Bash
arch-chroot/mnt/bin/bash
After this command, do not reboot yet. We still have to install our boot manager.
Installing Basic Components
Now that we are in Arch, we have access to the Pacman package manager. We can use it to install basic components like a network manager for accessing the internet, and a boot manager so we can boot into the system. I will be installing GRUB as a boot manager, but you can install something else.
Use the command below to install these components.
Bash
pacman-Snetworkmanagergrub
Configuring the Network Manager to Run on Startup
If we want internet at boot, we are going to have to enable NetworkManager’s system service. we can do this using the command below.
Bash
systemctlenableNetworkManager
Configuring the GRUB Boot Manager
Now, we have to configure what our system boots using. When we ran the Pacman command, we downloaded GRUB, but we did not install or configure it. Let’s install GRUB using the command below, replacing /dev/sda with whatever drive you are using to install Arch. We are not going to be using /dev/sda1 or /dev/sda2 because it is critical that you install it to the drive, not the drive partition.
Bash
grub-install/dev/sda
Now, we can make a GRUB configuration file using the command below.
Bash
grub-mkconfig-o/boot/grub/grub.cfg
Take a look at the output and make sure that it says both an initrd image and a Linux image were found. If it does not find these images, the most likely cause is incorrectly installing the Linux kernel using pacstrap.
Setting a Password
Now, run the command below to create a password for your root user.
Bash
passwd
Configuring Locales and Timezones
Use the command below to enter the locale configuration file, replacing vim with whatever text editor you installed earlier.
Bash
vim/etc/locale.gen
Now, use the arrow keys or the scroll wheel to scroll down to the locale you want to use. I will be using United States English, so I will scroll down to en_US and uncomment (remove the # before) both the UTF and ISO formats. If you are using Vim, you might have to hit the I key on your keyboard before you can actually type anything.
Write the file and exit your text editor. To write and exit Vim, we can hit the Escape key on our keyboard and type :wq.
Now that we have our locales configured, we have to apply the changes by generating the locales. We can do this using the command below.
Bash
locale-gen
Now, we also have to create a file called locale.conf to define our language in. Use the command below, once again replacing vim with your desired text editor.
Bash
vim/etc/locale.conf
In the file, type LANG=en-US.UTF-8, once again replacing en-US with whatever locale you are using. Exit Vim.
Now that we have the timezones prepared, we have to link them to make our system clock show the right timezone. Type ln -sf /usr/share/zoneinfo and click Tab. This will list all the broadest timezones. Keep making the directories more specific, hitting Tab to see the available options every time, and after you are done typing a city, hit Space and type /etc/localtime.
Setting Our Hostname
Now, we can set our hostname. This is the name that the Arch machine will use to communicate with other devices over your network. By default, your hostname is archiso. If you are happy with that and don’t want to change it, you can skip this section.
Use your prefered text editor to create /etc/hostname. Do not include a file extension. Type whatever you want your system hostname to be, and exit.
Unmounting Our Disk
Now, we can exit our chroot jail by using the command below.
Bash
exit
Now would be a good time to check and make sure your hard drive is first boot priority. Make sure that when you return, you are in your installation medium and not in the actual Arch installation.
Unmount our Arch installation with the command below, replacing /mnt with the mount point you specified earlier.
Bash
umount-R/mnt
Now, we can boot into our new installation of Arch Linux using the command below. Once you have booted in, you may remove the installation medium.
Did you know that ATC conversations and conversations between planes are freely available, with no encryption? It is legal to listen in on ATC conversations, and in this guide I will tell you how if you have some free time.
What You Need
RTL-SDR Stick and Antenna (x1)
This is the antenna and radio processor we will be using to get a signal from an air traffic control tower.
If it is your first time using SDR# (SDRSharp), then you must install SDR#, then install the drivers. The below guide will show you how to do so.
First, install SDR# and let the installation wizard guide you through the process.
Then, open the newly added program Zadig and you should see a screen like the one below.
A: This is where you choose the interface you want to install drivers for
B: This is where you check if a driver was installed
C: This is where you can install the drivers
Follow the steps below:
First, use dropdown A to select an interface. The interface must start with Bulk-in, Interface. If you have multiple bulk-in interfaces, repeat these steps for every one
Next, make sure textbox B tells you that there is no driver installed
Finally, click Install WCID Driver (button C)
Opening SDR#
Once all the drivers are installed, you may close out of Zadig and open SDR#. You should see a screen like the one below.
A: This is the frequency selector. This is where you can choose which frequency your antenna is supposed to be tuned to. Right now it is tuned to 120 MHz, but in the next section you will learn to find the frequency of your ATC tower
B: This is where you can choose your radio settings. For this tutorial, keep the default settings but change the radio mode to AM
C: This is where you choose the source of the radio stream. Right now you want it set to RTL-SDR USB
D: This is where you can visualize the radio waves. You can click anywhere on this to set the frequency to the location of the waves to which you clicked. You can drag the lighter waves to set the bandwidth. You want to make sure that the bandwidth is not too big otherwise you will get interference, but not too small so you only get part of the wave. I have set my bandwidth to 7.557 kHz
Reading Aerospace Vector Maps
Using a site, like SkyVector, you can find your airport and look at the frequency under it. Tune to that frequency. For place value context, think of the second segment of numbers as MHz SkyVector shows frequencies in megahertz.
Some airports, like the ones marked with a star, do not have full-time ATC, meaning that planes have to talk directly to each other.
Tune to this frequency on SDR#.
Listening to these frequencies
Look for any spikes in these frequencies. Ste the frequency to the frequency of these spikes (you can do this easily by clicking on these spikes) Adjust the bandwidth to these spikes, hovering over the top-right Zoom button and using the slider below it to zoom into the waves. Click on the top-left gear icon and adjust the setting to match the ones below:
Now, turn the volume up and listen. If you do not hear talking, experiment with the bandwidth or choose another frequency. A good frequency should be like the one below:
Done!
And that is the end of the project! Pretty easy, right? There are some caveats, though. You will only get the best signal when you live no further than 50 kilometers away from an airport with a full-time ATC, and the radio tends to disconnect a lot if not screwed in fully. Either way, it is still a super cool project, and is definitely worth trying out if you are interested in this kind of thing. Frequencies might not be exact, so experiment a little!
Before we start this project, you need to know a little bit about GPS. Satellites will send signals on their distance from the module. Once four or more satellites are connected and giving out this data, the receiver can then use the data to figure out the exact location of the user.
The receiver will then present this data in the form of NMEA sentences. This is a standard communication developed by the National Marine Electronics Association. We will be using TinyGPS++ to parse these.
Using the GPS with Arduino
For this part, you don’t need the LCD. This will show you how to log the GPS output to the serial monitor. We will then parse this data using TinyGPS++.
Preparations
First, open Arduino IDE and you will be greeted with a blank sketch.
At the top toolbar, click Ctrl + Shift + I to bring up the library manager and type “TinyGPSPlus” and install the top result.
Sign up for our newsletter!
Code
Now that we are all prepared, lets start writing the code. First, we include the library that helps us communicate with the GPS.
#include <SoftwareSerial.h>
Next, we include the library that parses NMEA sentences.
#include <TinyGPSPlus.h>
Now, declare the communication between the Arduino and the GPS and then the parser.
SoftwareSerial ss(4,3);
TinyGPSPlus gps;
After that, we go inside the void setup() function and we initiate the communication between the computer and the Arduino and the GPS and Arduino.
Serial.begin(9600);
ss.begin(9600);
Next, we go into void loop() and specify that whatever is below this line of code should only happen when the Arduino receives a signal.
while (ss.available() > 0)
Then, we encode the data in a format that the GPS can then parse.
gps.encode(ss.read());
Then, we create an if block so the serial monitor only displays our data when the data the GPS is outputting is valid.
if (gps.location.isUpdated()) {
}
Now, inside the if block, we can access all the data and print it to the serial monitor.
Serial.print("Latitude= ");
Serial.print(gps.location.lat(), 6); //6 for 6 decimal places
Serial.print("Longitude= ");
Serial.print(gps.location.lng(), 6); //6 for 6 decimal places
Your full code should look like this:
#include <SoftwareSerial.h>
#include <TinyGPSPlus.h>
SoftwareSerial ss(4,3);
TinyGPSPlus gps;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
ss.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
while (ss.available() > 0)
gps.encode(ss.read());
if (gps.location.isUpdated()) {
Serial.print("Latitude= ");
Serial.print(gps.location.lat(), 6); //6 for 6 decimal places
Serial.print("Longitude= ");
Serial.print(gps.location.lng(), 6); //6 for 6 decimal places
}
}
Wiring
The wiring is shown below:
GPS RX > Digital 4 on Arduino
GPS TX > Digital 3 on Arduino
GPS VCC > Power 3.3V on Arduino
GPS GND > Power GND on Arduino
Uploading
Now, with the Arduino IDE opened and the code ready, press Ctrl + U on your keyboard. The code will write and start outputting to the serial monitor, which you can access by pressing Ctrl + Shift + M on your keyboard or by going to the top toolbar and clicking Tools > Serial Monitor. The GPS will take a couple minutes to get its location. You may want to stick the antenna outside for this, as it will take a long time to get its location indoors.
Soon, you will be able to view the data coming in.
In this post, I will be showing you how to start feeding flight data to three services: Flightradar24, ADS-B Exchange, and FlightAware. This post may be helpful to some of you who want to run your own flight feeder, and can’t tell which is a better service to feed to.
The main benefit of running your own Raspberry Pi flight tracker is that you will get paid accounts for free. For example, you will get a free FlightAware enterprise account, a subscription valued at around $89.95 a month. FlightRadar24 will also give you a free business plan, which costs $49.99 a month. If you also want to support non-proprietary websites, you can also give flight data to ADS-B Exchange.
What you will need (hardware)
Below are the parts you will need:
Raspberry Pi 3B (x1, required)
The Raspberry Pi will be our microcontroller (This also works with other models, just not the Zero or the Pico; you can see FlightAware’s compatibility list here)
To begin the installation, we will have to first start feeding to FlightAware. To begin, first, create an account at their website, or log in at their website.
Note that you must select the correct drive, as this will erase your drive.
Configuring the ISO
If you want to enable SSH on your PiAware, or you have a wireless network configuration that you want to set (this will be typically everyone, unless you are using an ethernet cable on your Raspberry Pi), you must follow the below steps to configure the new operating system to use your configurations. You can refer to the configurations at FlightAware’s Website, or you could not set a default configuration, and once the PiAware has booted up, configure it using Bluetooth.
Booting it up
Now, you can put it all together! Connect your ADS-B antenna to your Raspberry Pi via USB, and then put the SD card through the back. Then, plug in the HDMI cable (and ethernet if you are going to be using it), and power it on.
Now, once the Raspberry Pi has booted up, you should see a screen showing the PiAware Status. If you did this correctly, it should be connected. You will also need to connect a keyboard if you do not know your PiAware’s IP address. If it asks you for credentials, the default is pi for username, and raspberry for password.
Setting up the FlightAware feeder
Now we get to the fun part! Now, we set up the feeders. Let’s start off with the FlightAware feeder. Since we flashed the custom ISO file, FlightAware is going to be installed, just not set linked to an account. Create a basic plan FlightAware account at their website if you don’t already have one, and claim your PiAware. Once that is set up, make sure you are connected to the same network as your PiAware. It will come in handy for later. Once you do that, make sure you are still on the status page on your PiAware, click Alt+F2 (or whatever key it says to press to open the terminal and run commands). If it asks you for credentials, the default is pi for username, and raspberry for the password (unless it is set otherwise, of course). Now run the following command:
BASH
hostname -I
This should return your Pi’s IP address. Now, on another device, navigate to your IP address on the SkyAware page. For example, if my Pi’s IP address is 192.168.1.1, I will navigate to the following website:
URL
http://192.168.1.1/skyaware
After that, you should see a map with all the aircraft you are tracking. You have successfully set up FlightAware! After some time, your basic account will be upgraded, and you can view your ADS-B statistics.
Setting up FlightRadar24
Now, open the terminal and run the following command:
You will then be asked some questions about antenna position, fr24 sharing key, and other things.
Now, we need to configure FlightRadar24. To begin, sign up for an account at their official website. Note that all you need to do is sign up for a free account and do not select any paid plans. This is because your account will automatically be upgraded at the end of this tutorial.
Run the following command to enter configuration:
BASH
sudo fr24feed --signup
You will be asked questions about you and the antenna that you are using. Answer the questions similar to the ones below:
Email Address: Enter the same email address you used to sign up for FlightRadar24. This is the same email address that your sharing key will be sent to, and the same email address that your account on will be upgraded.
FR24 Sharing key: If you have never set up a feeder or have never got a sharing key from FlightRadar24, leave this blank. If not, enter your FlightRadar24 sharing key.
Participating in MLAT Calculations: Answer yes, unless you know you don’t want it or need it.
Autoconfiguration for dump1090 (if asked): Yes
Latitude & Longitude: Use a website like latlong.net to find your latitude and longitude. It is best to be as accurate as possible. Enter this question in the form of XX.XXXX and XX.XXXX (leave out any extra numbers).
Altitude: This is your altitude from sea level. You can use whatismyelevation.com to find your altitude.
Receiver Selection: If you are using a DVB-T (the type I put in the parts list) stick then I strongly recommend option 1. If you encounter an error regarding dump1090 in this tutorial, restart the tutorial and click option 4. If you do not have a DVB-T stick, check out your other options.
Dump1090 Arguments (if asked): Leave this blank and hit enter.
Raw Data Feed: No, unless you know what you are doing.
Basestation Data feed: No unless you know what you are doing.
Logfile Mode: 48-hour, 24 rotation.
Logfile Path: This will be the path that the log file is saved to. If you want to use a custom path for logs, put it here. If not, stick with the default and hit enter.
FlightRadar24’s configuration should return that everything is correctly set up. The program should also give you a sharing key. Save this key as you may need it later in the future.
To begin feeding ADS-B data to FlightRadar24, enter the command below. Note that MLAT or general feeding might take some time to show up. For me, it took 30 minutes before the feeder was actively sending data to FlightRadar24:
BASH
sudo systemctl restart fr24feed
You can go to the data page and view your feeder statistics. If you want to access the web UI for FlightRadar24, then go to your Raspberry Pi’s IP address (remember, you can access it with sudo hostname -I), and access it via a web browser on port 8754, unless set otherwise. For example, my Raspberry Pi’s IP address is 192.168.1.252, so I access it by using http://192.168.1.252:8754.
Also, it is important to note that it may take some time for the receiver to start working and sending data. For me, it took 30 minutes before flight data was sent to the services I was feeding to.
Setting up MLAT for FlightAware
If you want to set up MLAT configurations on FlightAware (we highly recommend doing so, it can increase the amount of positions seen), then follow our steps.
First, go to your FlightAware data sharing page and clcik the gear icon next to the nearest airport, labeled in orange.
Then, enable MLAT and Mode S Alliteration. Put in the same details as you did for FlightRadar24, or new details if you have to.
Setting up ADS-B Exchange
First, we need to download ADS-B Exchange. You can do that with the following command:
You will be asked a couple questions. For the first one, type in a random username, but note that this username will be public. Next, enter the details it asks for, and it will begin configuring. Note that this may take a while.
The script should output a sharing key. You can use this to view your feeder statistics at the official website of ADS-B Exchange. You should also be able to access your web interface on the adsbx page. This will be your Raspberry Pi’s IP address, with /adsbx at the end. For me, the URL was http://192.168.1.252/adsbx.
In the last post, I covered how to make bash aliases. However, creating bash aliases with the alias command only lets you create bash aliases for the current session. For example, if I were to use alias hi="echo hi" to make a bash alias that connects hi with the command echo hi, and then exited the terminal session, all the bash aliases would reset. However, there is a way to make them permanent.
Creating Permanent Bash aliases
To make Bash aliases permanent, you will need to add lines to the ~/.bash_profile or ~/.bashrc file. Once you find out that file, open it with the text editor of your choice. I prefer nano.
Make sure to run the below command after you are done modifying those files:
BASH SHELL
source ~/.bash_profile
The below commands are how you get into the file.
BASH SHELL
cd ~
nano .bashrc
Then add your aliases.
BASH CONFIGURATION
# Aliases
# alias alias_name="command_to_run"
# If you are new to the shell, note that the Linux system ignores lines that start with '#' so this line does not mean anything to Linux
# Long format list
alias ll="ls -la"
# Print my public IP
alias myip="curl ipinfo.io/ip"
# That 'hi' example from earlier
alias hi="echo hi"
Now when you reboot your Linux system, the Bash aliases should still work.
Bash aliases with command arguments (Bash functions)
Sometimes you may need to create a Bash alias that will change depending on certain values or will accept arguments. The syntax for Bash functions is relatively easy. They can be declared in two separate formats. It is preferred to declare functions using the ~/.bashrc file.
TIP: If you want your .bashrc file to be more modular, you can store your aliases in a separate folder. Some distributions of Linux like Ubuntu or Debian include a separate .bash_aliases file.
The syntax is below. Way 1 is the preferred way and the most used one.
Way 2 uses the keyword of function, and then the function name, and after that the commands to run. The code below demonstrates way 2 (multi-line):
BASH CONFIGURATION
function function_name {
commandsToRun
}
Way 2 (Single-Line):
BASH CONFIGURATION
function function_name { commandsToRun; }
A few things that are nice to know:
The commands that the function will run are between the curly braces ({}). This is called the body of the function. The curly braces must be separated from the body by newlines or spaces. In this case, function A {commandsToRun;} or A () {commandsToRun;} will not work, but something like function A { commandsToRun; } or A () { commandsToRun; } which has spaces separating the body of the function from the function data will.
Simply defining a function will not execute it. If you want to invoke or execute a bash function simply use the name of the function. The body of the function is executed when you invoke it in the shell script.
You must define the function before calling or executing it.
You can pass any number of arguments in a function. If you want to call a Bash function right after the function’s name, separated by a space. The passed parameters can be referenced with $1, $2, $3, $4, etc., corresponding to the position of the argument after the name of the function when it is executed. Below is a simple bash function that will create a directory and then navigate into it:
Same as aliases, make sure to add the Bash functions in the ~/.bashrc file and run source ~/.bash_profile to make the changes take effect.
Now instead of having to make a directory using mkdir and then move into that directory using cd, you can simply use our mkcd function:
BASH SHELL
mkcd testDirectory
A few things that you need to know:
The -- makes sure that Linux does not get confused and parse the folder name as an argument. If you have a folder that starts with -, Linux might parse it as an argument.
The && ensures that the second command runs only if the first one is successful.
Final Note
By now you should have a good understanding of how Bash aliases and functions work. This should help you be more productive on the command line.
If you have any questions or feedback, feel free to leave a comment on this post.
Now, download this and extract it. You should get an ISO file in return.
Now, open Etcher and select your drive in the “STEP 2: SELECT DRIVE” area.
Select the ISO in the “STEP 1: SELECT IMAGE” area.
Click “FLASH”
Step 3: Final Step
Now, insert the essentials (Display, keyboard, etc. (NOT THE POWER CORD)), as well as the sd card. Now you can go ahead and plug in the power cord. Wait for a few seconds. If you see the green LED labeled “ACT” flash for a second, power on your monitor. The setup will guide you. Follow the setup wizard.
Step 4: Done!
You are done! Here are some commands you should run in the terminal. You don’t have to, but I recommend you do.