# 1. General First steps ↓

Update and upgrade the system (if you haven't done already so):

```
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt update && sudo apt full-upgrade -y
sudo apt autoremove
sudo reboot now
```

> Note: If you are in China, you might need to install a VPN in your raspbian to have quick handshakes with GitHub later. Recommendation for an easy to use cli base VPN would be [**express-vpn**](https://www.expressvpn.com/support/vpn-setup/app-for-raspberry-pi/)**.** 🤨

Next is to Install git:

```bash
sudo apt-get install git -y
```

Create a safer `git up` alias:

You might ask why? It's because, later we would be using our UI to get latest version of the cloned firmware. Manually if we have to do it we would use, `git pull`   in the cloned repository. But this time we would be using the UI script and it is not recommended to use git pull from a script.&#x20;

Explanation: [here](https://stackoverflow.com/questions/63754134/how-to-check-if-git-pull-is-successful-from-process-exitcode) and [here](https://stackoverflow.com/questions/17099564/make-a-shell-script-to-update-3-git-repos)  &#x20;

```bash
git config --global alias.up '!git remote update -p; git merge --ff-only @{u}'
```

***\[TBD] Configure git to save your credentials:***

***\[TBD] Setup in organisation's git account, ssh keys off all the pi's we want to install these on***

### Add a sourcing .bashrc&#x20;

```
sudo nano ~/.bashrc
```

Append to the end of the file:

```
alias brc='source ~/.bashrc'
```

### Now check python3 installation and install pip3:

> If it is not installed, update to Python3

```bash
which python3
# /<PATH to Python3>/python3
```

On a first fresh install, if you run:

```bash
which pip3
# nothing
```

So install pip3 and setup-tools:

```bash
sudo apt-get install python3-pip -y
python3 -m pip install --upgrade pip
sudo pip3 install --upgrade setuptools
```

To have serial port access from scripts that are run by the current user, in linux, you need to add that user to `dialout` group:

```bash
sudo usermod -a -G dialout <USER>
# example: My usr is defualt pi
sudo usermod -a -G dialout pi
```

Finally:

```bash
sudo reboot
```

System is ready for next steps. 🤓

### Install yq:

```bash
wget https://github.com/mikefarah/yq/releases/download/<$version>/yq_linux_arm.tar.gz
tar -xvzf yq_linux_arm.tar.gz
mv yq_linux_arm.tar.gz yq
sudo chmod +x yq
sudo cp yq /usr/local/bin/yq
```

### Install some dependencies, may be required by PIL (Python Imaging Library) later:

```
sudo apt-get install libjpeg-dev -y
sudo apt-get install zlib1g-dev -y
sudo apt-get install libfreetype6-dev -y
sudo apt-get install liblcms1-dev -y
sudo apt-get install libopenjp2-7 -y
sudo apt-get install libtiff5 -y
sudo apt-get install build-essential -y
```

### Enable Serial on pi

```
sudo raspi-config
```

Disable Console over HW serial

Enable HW serial

![](https://1066543514-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfWo0O3YNI1XV9DRwwL-887967055%2Fuploads%2FDDJqjpX8sapXQsgO5dWJ%2Fraspi-config.gif?alt=media\&token=818f84b5-f30b-4e0f-b535-aa4494916725)

##
