m0ranwad / nba-led-scoreboard

NBA LED scoreboard! This project displays matches and scores for all of the current day's NBA action
GNU General Public License v3.0
5 stars 3 forks source link

nhl/nba_api_parser module missing #3

Open pjockey opened 9 months ago

pjockey commented 9 months ago

Describe the bug api parser missing

pi@Scoreboard:~/nba-led-scoreboard $ sudo python main.py --led-gpio-mapping=adafruit-hat-pwm --led-brightness=60 --led-rows=64 --leds-cols=128 --led-slowdown-gpio=3 Traceback (most recent call last): File "main.py", line 6, in from data.data import Data File "/home/pi/nba-led-scoreboard/data/data.py", line 3, in import data.nba_api_parser as nbaparser ImportError: No module named nba_api_parser

m0ranwad commented 9 months ago

Hmm, that's strange. I've encountered a similar problem before.

In my experience, this was resolved by adjusting the import statement in the data.py file. Specifically, I had to prepend data to the beginning of the import statement. So, instead of import nba_api_parser as nbaparser, it would be import data.nba_api_parser as nbaparser.

A possible solution could be to try removing the data prefix from the import statement. Change import data.nba_api_parser as nbaparser back to import nba_api_parser as nbaparser and see if that resolves the issue.

pjockey commented 9 months ago

That seems to have solved it, removing the data from the import sttement, at least I don't receive the error any further. But, now I get a bunch of weird colours and nothing really decernable.

I have the board working with the nhl and mlb boards, but they are also using python3, not 2.

I use these 2 switches --led-panel-type=FM6126B --led-rgb-sequence=BGR, but the scripts don't recognize the panel type.

alexanderthebadatcoding commented 9 months ago

@pjockey did you try adding parser.add_argument("--led-panel-type", action="store", help="Needed to initialize special panels. Supported: 'FM6126A'", default="FM6126B", type=str) and then add options.panel_type = args.led_panel_type after options.pixel_mapper_config = args.led_pixel_mapper in the utils.py file in side of def process(self):

I have a similar panel type and it was giving me issues.

pjockey commented 9 months ago

I don't see a def process(self): in the utils.py file. I add the options.panel_type = self.args.led_panel_type after options.pixel_mapper_config = self.args.led_pixel_mapper but his option in my utils.py did not have the word "self" in the code and when the code was run, I go this,

Traceback (most recent call last):
  File "/home/pi/nhl-led/main.py", line 16, in <module>
    matrixOptions = led_matrix_options(args)
  File "/home/pi/nhl-led/utils.py", line 69, in led_matrix_options
    options.panel_type = self.args.led_panel_type
NameError: name 'self' is not defined

snippet from the utils.py

def led_matrix_options(args):
  options = RGBMatrixOptions()

  if args.led_gpio_mapping != None:
    options.hardware_mapping = args.led_gpio_mapping

  options.rows = args.led_rows
  options.cols = args.led_cols
  options.chain_length = args.led_chain
  options.parallel = args.led_parallel
  options.row_address_type = args.led_row_addr_type
  options.multiplexing = args.led_multiplexing
  options.pwm_bits = args.led_pwm_bits
  options.brightness = args.led_brightness
  options.pwm_lsb_nanoseconds = args.led_pwm_lsb_nanoseconds
  options.led_rgb_sequence = args.led_rgb_sequence
  options.panel_type = args.led_panel_type
  try:
    **options.pixel_mapper_config = args.led_pixel_mapper**
  except AttributeError:
    debug.warning("Your compiled RGB Matrix Library is out of date.")
    debug.warning("The --led-pixel-mapper argument will not work until it is updated.")
alexanderthebadatcoding commented 9 months ago

@pjockey That looks good, does it work? Sorry I copied the code from the wrong place. delete the self.

pjockey commented 9 months ago

no, it doesn't work. The code went thru the progression of the games, but nothing showed on the screen. I'll continue to play with it.

alexanderthebadatcoding commented 9 months ago

@pjockey What LED Panel do you have? Have you looked over the readme https://github.com/hzeller/rpi-rgb-led-matrix#changing-parameters-via-command-line-flags

pjockey commented 8 months ago

@pjockey What LED Panel do you have? Have you looked over the readme https://github.com/hzeller/rpi-rgb-led-matrix#changing-parameters-via-command-line-flags I've been on the page and poked around, tried some different things, like --led-panel-type=FM6126B. This option worked in the nhl-led-scoreboard version prior to their api problems but I don't need it any more for some reason. Works fine without it.

20231126_143714 20231126_143809 20231126_144037

alexanderthebadatcoding commented 8 months ago

@pjockey Is this one 128X64? I think the NBA scoreboard is set for 32 X 64 so maybe that could cause an issue. I'll keep looking into it.

You could try --led-row-addr-type=3 (https://github.com/hzeller/rpi-rgb-led-matrix/issues/823)

pjockey commented 8 months ago

sudo python main.py --led-gpio-mapping=adafruit-hat-pwm --led-rows=64 --led-cols=128 --led-rgb-sequence=BGR --led-brightness=60 --led-slowdown-gpio=2 --led-row-addr-type=1

This is the command line I'm runnging. As I said it seems to work, just nothing on hte screen.

alexanderthebadatcoding commented 8 months ago

Does it not work as Python3?

You can check here too: https://rpi-rgb-led-matrix.discourse.group

and you can probably edit the main renderer file to move things around with the added space.

pjockey commented 8 months ago

Does it not work as Python3?

You can check here too: https://rpi-rgb-led-matrix.discourse.group

and you can probably edit the main renderer file to move things around with the added space.

Only have python3 on the Pi.

I asked a question about the chipset on another board I have, but no one responded.

alexanderthebadatcoding commented 8 months ago

@pjockey from what I found you should try:

--led-rows=64 --led-cols=128 --led-chain=1 --led-show-refresh --led-parallel=1 --led-pwm-dither-bits=1 --led-pwm-bits=7 --led-panel-type=FM6126A --led-row-addr-type=3

https://rpi-rgb-led-matrix.discourse.group/t/p2-128x64-hub-75-icnd2038s/125/7

And then maybe try messing with these examples: https://github.com/hzeller/rpi-rgb-led-matrix/tree/master/bindings/python

pjockey commented 8 months ago

@pjockey from what I found you should try:

--led-rows=64 --led-cols=128 --led-chain=1 --led-show-refresh --led-parallel=1 --led-pwm-dither-bits=1 --led-pwm-bits=7 --led-panel-type=FM6126A --led-row-addr-type=3

https://rpi-rgb-led-matrix.discourse.group/t/p2-128x64-hub-75-icnd2038s/125/7

And then maybe try messing with these examples: https://github.com/hzeller/rpi-rgb-led-matrix/tree/master/bindings/python

I have a spare Pi 3 so I started fresh with the Bullseye Lite and attempted to install both the nba-led-scoreboard and the nhl-led. Both have major inssues installing. Perhaps it is the python version, 3.9.2, that is the problem. The install.sh refers to installing python2.7 packages. rgbmatrix installl also did not work.

I will continue to play with this and see what I can get done. I may create another micro SD with Buster as the OS and see if the python2.7 is the trick.

alexanderthebadatcoding commented 8 months ago

@pjockey I'm pretty sure that you need Buster for the LED Matrix to work. But I'm not sure why.