Raspberry Pi Setup (Depreciated)
We will now walk you through on how you can setup your Raspberry Pi to save money on cloud services such as EC2 or Lambda for when you update card images to the S3 Bucket or scheduling scrapers with Cron.
What you will need
-
Raspberry Pi
- SD Card (16 GB+)
- SD Card Reader
- Ethernet Cable (Optional)
- Spare Monitor (Optional)
- Spare Keyboard (Optional)
OS Installation
First, connect your SD card into your workstation and reformat its disk storage to Fat32. Next, download the Raspberry Pi Imager from the Raspberry Pi official website.
In the imager software, select your Raspberry Pi model, version of Linux, and your SD card storage.
We recommend choosing Ubuntu Server 22.04 LTS for your operating system. If you’re using a Pi 4 or newer with at least 2 GB of RAM you can choose the 64 bit version.
You will then have the option to apply the following in the advanced options configurations.
-
Toggle
Use password authentication
to enable SSH. -
Set username and password of the user.
-
(Optional) If you’re not connecting using an ethernet, configure the wireless LAN. Enter your WIFI network name in the SSID field and your network password accordingly.
Click write and wait for the download to finish. Once the OS is installed, insert the SD card into your Raspberry Pi and power it on.
SSH
You will need to obtain your Raspberry Pi’s IP address in order to SSH from your workstation. If you have a spare monitor and keyboard to plug into, you can login with your credentials from the advanced options step and enter the following command to get your IP address you will be SSH’ing into:
hostname -I
Otherwise, you can download an IP scanner tool such as Angry IP Scanner to get your Raspberry Pi’s IP Address. If the Pi is connected over WIFI make sure you are also connected to the same WIFI network. Click on the IP
dropdown box in Angry IP Scanner and select your network adaptor/controller and run the scanner. After the scan is complete you can sort your results by the Ping
column. You will notice one of the rows will have Raspberry Pi
labeled under the MAC Vendor
column alongside the device’s IP in the IP
column.
Open your terminal and enter the following command alongside your username you setup when installing the OS and the Pi’s IP address (You may have to run your terminal as an administrator):
SSH [username]@[Pi IP Adress]
Now enter the user’s password and you will have successfully connected to your Pi remotely.
OS Updates and Repo Cloning
After successfully SSH’ing into your server upon initial setup you should run any necessary updates with the following command:
sudo apt-get update
Next you can download Snapcasters backend code where the scraper scripts and image processing software for our CDN are located.
git clone [git HTTPS URL]
You will then be prompted to enter your Github account password but this has been removed as a feature in recent years. Instead, you will have to enter your Github personal access token if you want to clone the repo. To setup your access token, follow these steps:
-
Login to Github in a browser.
-
Click your profile icon in the top right.
-
Settings
-
Developer settings
-
Personal access tokens
-
Tokens (classic)
-
Generate new token
-
Select
generate new token (classic)
-
Provide a token description in the note textbox
-
Specify the token expiration date
-
Under
Select Scopes
toggle therepo
checkbox -
Click generate token.
Copy and paste the token generated when prompted for the password when cloning the repo from your Pi and you will have successfully downloaded the latest back-end scripts.
Additional Notes
If you are running the Image processing software, it is recommended to configure your Pi through ethernet and not WIFI for more reliable and faster network speeds. This software involves downloading/mapping thousands if not tens of thousands of new and outdated images into Snapcaster’s CDN which stores these images into an S3 Bucket.