Skip to content

How to install

Mathieu Jacomy edited this page Nov 28, 2020 · 4 revisions

Main steps

  1. Get a fresh Raspberry Pi and install it
  2. Install the script on it

The script will run by itself when the Raspberry Pi boots.

Follow the steps below for a full install on a Raspberry Pi from a laptop (headless). If you can plug a keyboard, mouse and screen on the Raspberry Pi, it is much simpler. I assume here that you have no specific knowledge on how a Raspberry Pi or Linux work. This has been tested on a Raspberry Pi 4 model B, using a laptop (headless install).

1. Get a fresh Raspberry Pi install

Skip this section if you have one ready to use.

1.1. Install the Raspberry Pi

Build a fresh image of the default Raspbian distribution on the micro SD card.

More info: https://www.raspberrypi.org/documentation/installation/installing-images/

1.2. Headless install

Skip this subsection if you can just plug a keyboard, mouse and monitor.

These steps are relevant if you want to control the Raspberry headless, from another computer. If you prefer plugging in a keyboard, mouse and screen, do it since it is much easier. In short, we enable SSH and connect via command line to setup a VNC connection, from which we can see and control the desktop from another computer. We have a few things to do on the Micro SD card before passing it to the Raspberry Pi.

1.2.1. Enable the Wifi

Create a valid wpa_supplicant.conf file on the Micro SD card. It contains the information the Raspberry needs to connect to your Wifi. Follow the instructions from this resource: https://www.raspberrypi.org/documentation/configuration/wireless/headless.md

1.2.2. Enable SSH

Creatie a file just named SSH in the boot folder (in the Micro SD card).

More info: https://www.tomshardware.com/reviews/raspberry-pi-headless-setup-how-to,6028.html

1.2.3. Put the Micro SD card into the Raspberry Pi, switch it on (i.e. power it via the USB-C port), and wait until it connects your wifi

If it fails, you have to restart from step 2.a.

1.2.4. Find the Rapsberry's IP, you will need it

I found the easiest way to be the FING app on a smartphone, but there are many ways. Check this: https://howchoo.com/pi/find-your-raspberry-pis-ip-address

1.2.5. Get a SSH client it you don't have one already

On Windows, I use Putty.

1.2.6. Connect to your Raspberry via SSH

For instance, using Putty. Enter the IP address and connect to it. The login is "pi" and the password "raspberry".

1.2.7. Configure the Raspberry Pi.

There is a built-in tool to configure most things from SSH. Our goal from there is to configure a VNC connection that we can use to see the Raspberry Pi's user interface from another computer.

  • Enter sudo raspi-config to enter the config interface.
  • Select 5 Interfacing options
  • Select P3 VNC
  • Select <YES> and hit ENTER
  • Navigate to <FINISH> and hit ENTER

VNC is now enabled on the Raspberry. More info: https://www.tomshardware.com/reviews/raspberry-pi-headless-setup-how-to,6028.html

1.2.8. Download and install VNC on your computer.

Then create a new connection using the Raspberry's IP address (that's all you need).

In case of screen issue

When I tried this, VNC could not display the screen of the Raspberry. There is a fix to that. We can change the resolution in the config tool, and then we will see the screen.

  • Again, enter sudo raspi-config from the SSH connection.
  • Select 7 Advanced options
  • Select A5 Resolution
  • Select DMT Mode 82 1920x1080 60Hz 16:9 (or try another one)
  • Select <FINISH> and hit ENTER
  • When asked Would you like to reboot now? chose <YES>
  • ...wait until it reboots and reconnects to the wifi...
  • Now it should work.

1.3. Since this is your first connection, the Raspberry needs a number of things

These things are language configuration, updates etc. Just follow the steps. Nothing unusual, you don't have much to do. It's long, though. Just a warning: if you change the password and then try to connect from VNC, think of updating the password in VNC too.

2. Install EDO-PI

2.1. Clone this repository

Open a terminal, and clone the repository from GitHub by using this line:

git clone https://github.com/jacomyma/edo-pi-lpx.git

(or whatever the URL of this repository is). This will install the code in a repository located at /home/pi/edo-pi-lpx.

2.2. Install dependencies

Install mido:

pip3 install mido

Install rt-midi:

pip3 install python-rtmidi

2.3. Make the script run on boot

In a nutshell, we add a line of code to execute the script on boot. But since it's the first time we run crontab it's going to configure.

2.3.1. Open the CRON table

Type in a terminal:

crontab -e

Since it's the first time, it asks which editor to use. Pick the first one.

2.3.2. Add the following line at the end of the file:

@reboot sleep 12 && cd /home/pi/edo-pi-lpx && python3 run.py

Note: if you have used another path, update the line above.

2.3.3. Exit the editor, save when prompted to.

The script is now installed, you can shut the Raspberry Pi down.

👉 How to use