riffnshred / nhl-led-scoreboard Goto Github PK
View Code? Open in Web Editor NEW🚨 Display NHL live score, stats, and more of your favorite teams, on a Raspberry Pi driven RGB LED matrix. 🚨
License: GNU General Public License v3.0
🚨 Display NHL live score, stats, and more of your favorite teams, on a Raspberry Pi driven RGB LED matrix. 🚨
License: GNU General Public License v3.0
In src/renderer/main.py - Picking up the home and the away team's scores on lines 154 and 159 need to occur regardless of whether the "if" tests two lines above them are true or false.
The fix is to move line 154 to 152, and move line 159 to 157. This will guarantee that a new goal from either team will be recorded, regardless of whether that team is in your favorite list.
Create boards for these playoff related features:
Preferred Series summary :
something in this fashion (https://drive.google.com/file/d/1qoKsLH3KkMlPGnrOaL2A-a34hHac-uUD/view?usp=sharing) but the teams a bit more tho the left and the games won on the right.
Trophies with teams logo or Players name and number (Create pixelated version of the trophies)
More to come.
Currently can show Standings by Conference and by Division. The data module already provide the information, just need to program the rendering.
Find a reliable source (preferably an API, otherwise a web page we could scrape the info) and then show the Top prospect rank in a list with their nationality as a small banner like the teams abbreviation on the Standing board.
For when the main event (live game) go into shootout, change the layout and instead of the 2 logos and score, have the table with the team name in the first column and then 5 columns to fill depending if the team score or not.
I come from a house with a Blues fan (roll eyes) a Bruins fan (ugh) and a Wild fan (me.) Is there some way to a momentary switch that would allow the program to move to the next "favorite" team. I.E. It is displaying the Wild game now displays the Blues, < push again> displays Bruins< push again> back to the Wild.
Don't know if it is even possible.
Also is there a way to use a monitor and not the LED matrix?
I'm installing the Beta and got this error. Any suggestions
pi@scoreboard:~nhl-led-scoreboard $ sudo python3 src/main.py --led-gpio-mapping=adafruit-hat-pwm --led-brightness=60 --led-slowdown-gpio=2
Traceback (most recent call last):
File "src/main.py", line 9, in
from dimmer import Dimmer
File "/hom/pi/nhl-led-scoreboard/src/dimmer.py", line 1, in
import ephem
ModuleNotFoundError: No module named 'ephem'
Last night after the Blues game ended, the Team Summary board displayed their point total before the game (88), while the wild_card standings board updated with their new point total (90).
An hour or so later, the Stars game ended, and the same thing happened. The team summary point total stayed the same, while the wild_card board point total reflected the one point they earned during the game.
I didn't think the point total for either board updated until the next day, so I had been restarting the board a few minutes after the games end to see updated point totals. Glad it's kinda/sorta working, though.
Greetings,
First, great work on this project! I was super interested in what you have done and wanted to try it out myself, but also saw opportunity to make some improvements. Ordinarily, I'd just submit pull requests as I make changes, but as you seem to be working on a big update, I had this question instead:
Would it be possible to work on your update in the open, perhaps in a separate branch on this public repo? This way, I (and others) could contribute to the new version, or test out the new features. As it stands, changes to the master branch may be irrelevant or cause major merge conflicts when your private work is ready to be released.
Thanks!
Feature enhancement request: Instead of saying "No Game Today" -- show when the next game is and against who... similar to the "Pre-Game State", but just add the date of the upcoming game... the "No Game Today" is sad...
I used to use nohup
and &
to detach the process from my terminal and run it in the background, but I would notice that sometimes the process would just fail and I'd have to log back in and run the process again.
I would suggest using something like Supervisor to monitor the process and restart it automatically if it stops. This is the config file that I am currently running:
[program:nhl]
command=python3 /home/pi/nhl-board-dev/src/main.py --led-gpio-mapping=adafruit-hat-pwm --led-brightness=30 --led-slowdown-gpio=2
autostart=true
autorestart=true
stderr_logfile=/var/log/nhl.err.log
stdout_logfile=/var/log/nhl.out.log
I'm new to this. Do I have to completely remove the previous version?
Great project! Thanks for doing this. I have everything setup and I'm really liking it.
One thing I noticed when initially wanting to run the main.py file, I would initially get an error
ImportError: No module named requests
I had to run pip install requests
to get rid of that error. Now everything runs smoothly.
Add an indicator on the board to show the user that the Pi can't communicate with the Network or the Internet and therefore update its information. A red bar at bottom of screen seems the most convenient way.
Enhancement Req: Add an option for off-day that shows a simple clock (12 or 24h) and maybe the upcoming dates/times for favorite teams all on one display... nothing scrolling, just a simple display of a clock and date/times:
Example:
(please forgive the janky ASCII art... an artist I am not)
Running into an error.
INFO (16:33:26): NHL Scoreboard - v0.1.0 (64x32)
http://statsapi.web.nhl.com/api/v1/schedule?teamId=None
Traceback (most recent call last):
File "main.py", line 28, in
data = Data(config)
File "/home/pi/nhl-led-scoreboard/data/data.py", line 30, in init
self.refresh_fav_team_status()
File "/home/pi/nhl-led-scoreboard/data/data.py", line 56, in refresh_fav_team_status
self.fav_team_game_today = nhlparser.check_if_game(self.fav_team_id)
File "/home/pi/nhl-led-scoreboard/data/nhl_api_parser.py", line 189, in check_if_game
game = game_data["totalGames"]
KeyError: 'totalGames'
Trying to step through it on my own but not much success just yet.
Currently the time shows up as "06:00" for a game, which is a bit weird for people who are used to a 24hr clock format. Would it be possible for a 24hr clock format option in the config?
If it does not work, do sudo bash ./install.sh
.
Ill fix it in the readme file when I get back from trip.
Hey guys,
I just installed the NHL Scoreboard. I'm using the MLB Scoreboard since early April 2019 and just found out that there is a NHL version :)
My problem now is that whatever I do, I only get the "no game today" info. I tried changing the favorite team id to a team playing today in the config.json and by using the --fav-team flag without any results.
It's January 20th today and Detroit is playing but using the ID "17" still gives me the same info:
INFO (11:04:28): NHL Scoreboard - v0.1.0 (64x32)
INFO (11:04:29): Off day State
INFO (11:04:29): ping_day_off
Is there an option somewhere to check the correct date?
Please help me out here.
Regards,
Patrick
I'm not sure if the API provides this info, but a shot counter for each team and a powerplay indicator would be really nice.
Create a board that will show the list of draft pick with the team's abbrev.
Pre-draft day: show the pick order with pick number on the left and teams abbrev on the right.
During and post draft day have the pick number and Abbrev on the left and name of the player on the right.
Make a board that will show nhl related news from an RSS feed.
To make sure the user dont loose their configuration when they update, put the base configuration into a config.base.json and generate a config.json on install. put the config.json in the gitignore so that its not lost.
First run through after an install and I got this error:
$ sudo python3 src/main.py --led-gpio-mapping=adafruit-hat-pwm --led-brightness=60 --led-slowdown-gpio=2
Traceback (most recent call last):
File "src/main.py", line 9, in <module>
from dimmer import Dimmer
File "/home/pi/nhl-led-scoreboard/src/dimmer.py", line 1, in <module>
import ephem
ModuleNotFoundError: No module named 'ephem'
I don't have a dimmer installed.
To make rendering an easier task, Duetoxplode proposed a new Matrix class that is a wrapper for both PIL and the rgbmatrix rendering functions.
Is there a way to add that team info screen of the game day opponent? So, using today as an example. Game day is found for Avs. They play Columbus. Add Columbus team info screen into rotation. After game start that screen goes away. Tomorrow, another game day is found, playing the wild. Wild card gets inserted into rotation.
Greetings,
I'm running the latest version of raspbian with python 2.7.16-1. I was getting key errors on a fresh install when trying to start the scoreboard app. In short, it seems like it didn't want to pick up any of the settings/variables in the json config files (was receiving key errors for end_of_day, debug, fav_team_id). I made the following modifications to get things to run.
data/scoreboard_config.py:
from:
from utils import get_file
import json
import osclass ScoreboardConfig:
def init(self, filename_base, args):
json = self.__get_config(filename_base)
# Misc config options
self.end_of_day = json["end_of_day"]
self.debug = json["debug"]
to:
from utils import get_file
import json
import oswith open('config.json', 'r') as f:
config = json.load(f)class ScoreboardConfig:
def init(self, filename_base, args):
#json = self.__get_config(filename_base)
json = config
# Misc config options
self.end_of_day = json["end_of_day"]
self.debug = json["debug"]
I'm definitely not a python programmer and I'm sure there's a much cleaner way to do it. I just wanted to post in case it helps anyone out.
Is there a way to change the day start time? I changed the time in the config file but it has no effect. Sometimes it says no game today or its shows the final score of the last game up to just a couple hours before a new game starts. It would be nice to have a new day start earlier in the day/AM.
Need to rethink how to refresh the data and render the images using threading. This will allow to use scrolling text and rotate between different info on the same board (Exemple, rotating between the Period/Clock and the Shot on goal for the live scoreboard).
Ideas include:
Feature developed by Falkyre. Allready functional, just need to make a pull-request after I finish the Live Game features
nhl-led-scoreboard/src/boards/team_summary.py", line 98, in draw_team_summary
draw.text((0, 7), "GP: {} P: {}".format(stats.gamesPlayed, stats.pts), fill=(255, 255, 255),
AttributeError: 'bool' object has no attribute 'gamesPlayed'
Being able to see who scored at the end of each period would be a nice touch. Something like a recap screen that last about 5-10 minutes in between periods. Just a thought I was kicking around for a few days, could be a little to much/ unnecessary for the project.
On the "Team Summary" where it shows last game, it currently shows a red L for a loss irregardless of it's overtime loss or not... maybe have it show a red OTL for overtime loss? Helps to know if your team at least got a point out of it.
Duetoxplode proposed a better way to organize files and folders for future development. need to discuss details first and then implement the solution.
Need to write design guidelines to help contributors make their board and features fit with the rest of the project.
When displaying the score ticker board, all teams iterate through respective to the delay set in rotation_rate within config.json except for the last team, which seems to have a delay of around 20 seconds.
I like be black box the scoreboard in the photo is in. Did you make it or buy it? Care to share the details?
Found this. https://stackoverflow.com/questions/9166400/convert-rgba-png-to-rgb-with-pil
Might be a solution to create images with elements that has transparent or Alpha component.
Otherwise it will show twice in a shot period of time and it feels repetitive.
Show when a team pull their goalie
Currently, live game data is retrieved and the current game clock value is statically displayed.
Instead, the game clock should count down as soon as data is retrieved, so you can see how much time is left in the period. This will be a relatively trivial coding change, but will make the clock far more dynamic. :)
I'm running the latest beta
branch and main.py immediately crashes upon running it.
This is the error I receive:
File "src/main.py", line 47, in <module>
run()
File "src/main.py", line 43, in run
MainRenderer(matrix, data).render()
File "/home/pi/nhl-board-dev/src/renderer/main.py", line 38, in render
self.__render_offday()
File "/home/pi/nhl-board-dev/src/renderer/main.py", line 59, in __render_offday
self.boards._off_day(self.data, self.matrix)
File "/home/pi/nhl-board-dev/src/boards/boards.py", line 26, in _off_day
board(data, matrix)
File "/home/pi/nhl-board-dev/src/boards/boards.py", line 65, in scoreticker
Scoreticker(data, matrix).render()
File "/home/pi/nhl-board-dev/src/boards/scoreticker.py", line 28, in render
ScoreboardRenderer(self.data, self.matrix, Scoreboard(self.games[self.index], self.data.teams_info)).render()
File "/home/pi/nhl-board-dev/src/renderer/scoreboard.py", line 37, in render
self.draw_live()
File "/home/pi/nhl-board-dev/src/renderer/scoreboard.py", line 83, in draw_live
self.draw_power_play()
File "/home/pi/nhl-board-dev/src/renderer/scoreboard.py", line 131, in draw_power_play
colors[str(away_number_skaters)])
KeyError: '0'
First of all, awesome job on this project! I was thinking about covering this project in a howchoo guide and video, so I'm in the requirements-gathering phase.
I know the MLB-LED-Scoreboard guys covered hardware in their Wiki, but this doesn't cover the actual housing for the screen; did you 3D print yours? If so, uploading the source files (STL at a minimum) to the repo would be a great addition.
Would love additional info on the housing-portion of the hardware setup. Thanks!
Just got this setup and the first thing I noticed was that the API updates faster than the feed I use to watch games. Would you be open to a pull request to add this functionality or have you thought about a feature like this at all?
When there is a game deciding goal, like in OT or a Shoot Out, there is no goal animation for the game winning goal. The game status just changes to end of game.
n9rzr
Trigger a penalty board that display the player and the infraction with the amount of minute.
Since I have four LED panels connected I was wondering if there are any plans for a 132x64 version.
I found the file to readjust the team logos in the renderer folder but didn't find with the file where I can readjust the game info.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.