-
Notifications
You must be signed in to change notification settings - Fork 2
Raspberry Pi Instructions
The Raspberry Pi MUST be arm64(Pi 3/4) with a Linux OS that is 64 bit Installed for this walkthrough of setting up Master-Bot on a Pi I'm using Raspberry OS, but the gist is the same
let's start by checking for updates and install them
cd ~
sudo apt-get -y update
sudo apt-get -y upgrade
cd ~
node -v
Most likely v10.x read more to update this
cd ~
npm -v
Most likely v6.x
cd ~
git --version
should output 2.20.1
install command
sudo apt-get install -y git
if you already have NodeJS v16.x or higher, these steps can be skipped
cd ~
curl -sL https://deb.nodesource.com/setup_16.x | sudo bash -
sudo apt-get install -y nodejs
let's check the version with
node -v
this should output 16.15.0 if done correctly
For the versions of NodeJS. If you need a different version, just change https://deb.nodesource.com/setup_16.x
to what ever version is needed, example https://deb.nodesource.com/setup_15.x
in the curl
command
wget https://adoptopenjdk.jfrog.io/artifactory/deb/pool/main/a/adoptopenjdk-13-hotspot/adoptopenjdk-13-hotspot_13+33-2_arm64.deb
sudo dpkg -i adoptopenjdk-13-hotspot_13+33-2_arm64.deb
there may be a "missing dependencies" warning, run sudo apt-get install -f
to install them
cd ~
sudo mkdir Bot
cd Bot
git clone https://github.com/galnir/Master-Bot.git
this step is not strictly necessary as you can follow the README.md on how to use Heroku, but can it be done locally. Since Raspberry OS is based on Debian we can use the instructions on the PostgresSQL website
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install postgresql
sudo -u postgres createdb masterBot
for this example, I'm going with the username of "DBUser"
sudo adduser DBUser
Login to the db with the user we created earlier with sudo -u DBUser psql
we want to run the following and give it a password, for this example I'm going with "MySuperSecretPassword"
alter user DBUser with encrypted password 'MySuperSecretPassword';
Run \q
to exit, you are done with Postgres....
When creating your .env
file as stated in the README.md, we want to add our newly created database info into .env
DATABASE_URL="postgresql://DBUser:MySuperSecretPassword@localhost:5432/masterBot?schema=public"
you can now follow the README.md and run the bot on a PI!!!! .......simple right? <3