Skip to content
This repository was archived by the owner on May 18, 2024. It is now read-only.

Commit

Permalink
Removed the step by step and added second methods of installation
Browse files Browse the repository at this point in the history
  • Loading branch information
riffnshred authored Mar 2, 2021
1 parent 4301e7f commit 077920f
Showing 1 changed file with 7 additions and 309 deletions.
316 changes: 7 additions & 309 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,318 +102,16 @@ If you create an issue because you are having trouble running your setup and you

## Software Installation

### Step 1 - Raspberry Pi OS Lite
### Method 1 - Using the nhl-led-scoreboard-img (Recommended)
You can now install, connect, configure and run the scoreboard using the new [nhl-led-scoreboard-img](https://github.com/falkyre/nhl-led-scoreboard-img)
PLEASE READ THE DOCUMENTATION AND TAKE YOUR TIME TO GO THROUGH THE PROCESS.

To be sure that you have the best performance possible, this project requires Raspberry Pi OS Lite.
**Note that this images is generated AFTER I release a new update. keep an eye on the Badges at the top of the page or on the repository it self to see when the new image comes out**

This version does not have a GUI which allows the Pi to dedicate as much resource as possible to the scoreboard.
### Method 2 - Standard installation and setup (For Dev and Modders).
This is the classic way to install and configure the scoreboard. If you want to do your own thing and add or modify components to your scoreboard, I recommend fallowing this guide to install, configure and run your scoreboard.


![scoreboard demo](assets/images/raspberrypi_OS_lite.png)



Follow these instructions to install Raspberry Pi OS Lite on your Raspberry Pi and once you are up and running comeback to

this page.


[Raspbian Buster Lite Installation](https://medium.com/@danidudas/install-raspbian-jessie-lite-and-setup-wi-fi-without-access-to-command-line-or-using-the-network-97f065af722e)


### Step 2 - Time Zones

Before you start installing anything, make sure your raspberry pi is set to your local time zone. Usually, you do so when you install Raspian, but if you think you skipped that part, you can change it by running `sudo raspi-config`



### Step 3 - Installing Git

You will need to install Git on your raspberry pi in order to download the software. To do so, run this command.

`sudo apt install git`



### Step 4 - Installing the NHL scoreboard software

This installation process might take some time because it will install all the dependencies.

```
git clone --recursive https://github.com/riffnshred/nhl-led-scoreboard
cd nhl-led-scoreboard/
chmod +x scripts/install.sh
./scripts/install.sh
```


#### *Important Step after installation.*
If it's a first install of the software, there is no config.json only a config.json.sample. This is normal. You need to configure your scoreboard. Follow the steps in the [Configuration](#configuration) section of this documentation.

#### *Updating your software.*

```
git reset --hard
git checkout master
git pull
chmod +x scripts/install.sh
./scripts/install.sh
```

If you face any issue after updating, rerun the install and it should fix it. otherwise check the issue section to see if a solution as been found for your problem. If not open an issue and I'll find a solution.

#### *Removing/uninstalling the software*
Sometimes, the only way to fix the issues after an update is to delete and reinstall. From the nhl-led-scoreboard folder, run these commands
```
cd
sudo rm -R nhl-led-scoreboard
```

Than run the installation commands above.
### Step 5 - Configuring your scoreboard.

**note** Since V1.1.2, you won't need to reconfigure your board everytime you update, **UNLESS** we add a major feature or we make a major update. There is 2 way to configure you board:


#### Using the nhl_setup app (recommended)

![nhl setup](assets/images/nhl_setup.png)



From the root of the `nhl-led-scoreboard`, run this command: `./nhl_setup`. Please take a look at the documentation here: [src/nhl_setup/README.md](https://github.com/riffnshred/nhl-led-scoreboard/tree/master/src/nhl_setup)



**New with v1.5.0**

You can now edit your current file instead of creating a new one.



#### Configuring manualy.

If you have no issue working with json files in a prompt, you can still configure manualy.

FIRST, you will need to make a copy of the config.json.sample and rename it config.json. Then open it and modify the options.

If it's a first install of the software, there is no config.json only a config.json.sample. This is normal. You need to configure your scoreboard. Fallow the steps in the [Configuration](#configuration) section of this documentation.



### Step 6 - Testing and Optimization

If you have been using a Led matrix on a raspberry pi before and know how to run it properly skip this part.



If you just bought your Led matrix and want to run this software right away, first thank you. Second, don't get too excited just yet.

Depending on your setup, you will need to configure the scoreboard using specific command flags when you run it.



To do so, start by disabling the audio of the raspberry pi (this is a must to run the led matrix properly).

From the root of the pi open the boot config file like so.

```
sudo nano /boot/config.txt
```



Find `dtparam=audio=on` and change it to `dtparam=audio=off`.



Save and close the file like so

```
Press Control-x
Press y
Press [enter]
```

reboot the pi

```
sudo reboot now
```

Now let's show something on the screen. Get to the matrix submodule and run some samples.
```
cd nhl-led-scoreboard/submodules/matrix/bindings/python/samples
sudo python3 runtext.py --led-rows=32 --led-cols=64 --led-gpio-mapping=adafruit-hat --led-brightness=60
```

**If you've done the anti-flickering mod**, use this flag instead `--led-gpio-mapping=adafruit-hat-pwm`

You should see "Hello World" scroll on screen.

Reference the [rpi-rgb-led-matrix library](https://github.com/hzeller/rpi-rgb-led-matrix/). Check out the section that uses the python bindings and run some of their examples on your screen. For sure you will face some issues at first, but don't worry, more than likely there's a solution you can find in their troubleshooting section.

Once you found out how to make it run smoothly, come back here and do what's next.

### Flags

This is a list of Flags you can use to optimize your screen's performance. For more details check out the [rpi-rgb-led-matrix library](https://github.com/hzeller/rpi-rgb-led-matrix/).

```
--led-rows Display rows. 16 for 16x32, 32 for 32x32 and 64x32. (Default: 32)
--led-cols Panel columns. Typically 32 or 64. (Default: 32)
--led-chain Daisy-chained boards. (Default: 1)
--led-parallel For Plus-models or RPi2: parallel chains. 1..3. (Default: 1)
--led-pwm-bits Bits used for PWM. Range 1..11. (Default: 11)
--led-brightness Sets brightness level. Range: 1..100. (Default: 100)
--led-gpio-mapping Hardware Mapping: regular, adafruit-hat, adafruit-hat-pwm
--led-scan-mode Progressive or interlaced scan. 0 = Progressive, 1 = Interlaced. (Default: 1)
--led-pwm-lsb-nanosecond Base time-unit for the on-time in the lowest significant bit in nanoseconds. (Default: 130)
--led-show-refresh Shows the current refresh rate of the LED panel.
--led-slowdown-gpio Slow down writing to GPIO. Range: 0..4. (Default: 1)
--led-no-hardware-pulse Don't use hardware pin-pulse generation.
--led-rgb-sequence Switch if your matrix has led colors swapped. (Default: RGB)
--led-pixel-mapper Apply pixel mappers. e.g Rotate:90, U-mapper
--led-row-addr-type 0 = default; 1 = AB-addressed panels. (Default: 0)
--led-multiplexing Multiplexing type: 0 = direct; 1 = strip; 2 = checker; 3 = spiral; 4 = Z-strip; 5 = ZnMirrorZStripe; 6 = coreman; 7 = Kaler2Scan; 8 = ZStripeUneven. (Default: 0)
```

### Best Performance

Using either a raspberry Zero, 3B+, 3A+ and 4B with an Adafruit HAT or Bonnet, here's what I did to run my board properly.

- Do the hardware mod found in the [Improving flicker section](https://github.com/hzeller/rpi-rgb-led-matrix#improving-flicker).

- Disable the onboard sound. You can find how to do it from the [Troubleshooting sections](https://github.com/hzeller/rpi-rgb-led-matrix#troubleshooting)

- From the same section, run the command that removes the Bluetooth firmware, Unless you use any Bluetooth device with your Pi.

Finally, these are the flag I use. (ONLY USE THESE FLAGS IF YOU'VE DONE THE HARDWARD ANTI-FLICKERING

MOD. If not, replace the first flag with --led-gpio-mapping=adafruit-hat).

```
--led-gpio-mapping=adafruit-hat-pwm --led-brightness=60 --led-slowdown-gpio=2
```

Once you are done optimizing your setup and configuring the software, you are ready to go.

Start by running your board and see if it runs properly. If you use the typical Pi 3b+ and HAT/Bonnet setup, here's the command I use.

If you've done the anti-flickering mod, change the `--led-gpio-mapping=adafruit-hat` for `--led-gpio-mapping=adafruit-hat-pwm`
```
sudo python3 src/main.py --led-gpio-mapping=adafruit-hat --led-brightness=60 --led-slowdown-gpio=2
```

### Step 7 - NOW TO RUN IT

Once you know it runs well, turn off your command prompt. **SURPRISE !!!** the screen stop! That's because the SSH connection is interrupted and so the
python script stopped.

There are multiple ways to run the Scoreboard on it's own. I'm going to cover 2 ways. One that's a bit more hand's on, and the other will run the
board automatically (and even restart in case of a crash).

#### Method 1 Using Supervisor

<img width="900" src="https://raw.githubusercontent.com/riffnshred/nhl-led-scoreboard/master/assets/images/supervisor.PNG">

Supervisor is a Process Control System. Once installed and configured it will run the scoreboard for you and restart it
in case of a crash. What's even better is that you can also control the board from your phone !!!!

To install Supervisor, run this installation command in your terminal.
```
sudo apt-get install supervisor
```

Once the process done, open the supervisor config file,
```
sudo nano /etc/supervisor/supervisord.conf
```
and add those two lines at the bottom of the file.
```
[inet_http_server]
port=*:9001
```
Close and save the file.
```
Press Control-x
Press y
Press [enter]
```

Now lets create a new file called scoreboard.conf into the conf.d directory of supervisor, by running this command,
```
sudo nano /etc/supervisor/conf.d/scoreboard.conf
```
In this new file copy and past these line.
```
[program:scoreboard]
command=[SCOREBOARD COMMAND]
directory=[LOCATION OF THE SCOREBOARD DIRECTORY]
autostart=true
autorestart=true
```
Than fill in the missing information. For the `command`, insert the command that worked for you when you tested the scoreboard. If
you used the same as mine then this line should look like, `command=sudo python3 src/main.py --led-gpio-mapping=adafruit-hat-pwm --led-brightness=60 --led-slowdown-gpio=2`.
Lastly, for the `directory`, insert the location of the scoreboard directory. It should be something like `/home/{user}/nhl-led-scoreboard`. If you use the base account "pi" then
the `{user}` will be `pi`.

Now, reboot the raspberry pi. It should run the scoreboard automatically. Open a browser and enter the ip address of your raspberry pi in the address bar
fallowing of `:9001`. It should look similar to this `192.168.2.19:9001`. You will see the supervisor dashboard with the scoreboard process running.
If you see the dashboard but no process, reboot the pi and refresh the page.

You should be up and running now. From the supervison dashboard, you can control the process of the scoreboard (e.g start, restart, stop).

To troubleshoot the scoreboard using supervision, you can click on the name of the process to see the latest log of the scoreboard. This is really useful to know what the scoreboard
is doing in case of a problem.

#### Method 2 Using Terminal Multiplexer
To make sure it keeps running you will need a Terminal Multiplexer like. [Screen](https://linuxize.com/post/how-to-use-linux-screen/).
This allows you to run the scoreboard manually in a terminal and
To install Screen, run the fallowing in your terminal.
```
sudo apt install screen
```

Then start a screen session like so
```
screen
```

Now run the scoreboard. Once it's up and running do `Ctrl+a` then `d`. This will detach the screen session from your terminal.
NOW ! close the terminal. VOILA !!! The scoreboard now runs on it's own.

To go back and stop the scoreboard, open your terminal again and ssh to your Pi. Once you are in, do `screen -r`. This will bring the screen session up on your terminal.
This is useful if the scoreboard stop working for some reason, you can find out the error it returns and uses that to find a solution.

#### Terminal Mode

Maybe you want to debug, or you have a small screen nearby that you want to use instead. You can run this in the terminal using:

`sudo python3 src/main.py --terminal-mode=true`

Note:

* If you want to run this straight from a raspberry pi, you will need to install a GUI and a terminal emulator that has all the colors
* If you are using a touchscreen instead of an HDMI output, make sure the [proper drivers are installed](https://github.com/goodtft/LCD-show)
[Step by step installation guide](https://github.com/riffnshred/nhl-led-scoreboard/wiki/Step-by-step-guide.)


## Shout-out
Expand Down

0 comments on commit 077920f

Please sign in to comment.