txoof / PaperPi

E-Paper display loop with plugins
97 stars 10 forks source link

LMS plugin Won't start #147

Closed OrangeTsar closed 7 months ago

OrangeTsar commented 7 months ago

The LMS plugin won't start

To Reproduce Follow installation instructions, configure ini file for LMS, run paperpi

Expected behavior Supposed to show playing information

Hardware

OS Info Run cat /etc/os-release

PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

[main] Section of Config Copy and paste the [main] section of your config file

[main]
# waveshare display type use HD for IT8951 displays
display_type = epd7in5_V2
# required vcom value for IT8951 screens
vcom = 0.0
# maximum refresh between total screen clear for HD displays
max_refresh = 4
# logging output level
log_level = WARNING
# display splash screen (True or False)
splash = True
# rotation of EPD display 
# (cable bottom: 0; cable left: -90; cable right: 90; cable top: 180)
rotation = 0
# mirror screen outuput - useful if output to screen appears backwards
mirror = False
# do not wipe screen when shutting down. True: leave image; False: wipe screen (default)
no_wipe = False
# plugin timeout - amount of time in seconds to wait for a hung plugin to complete execution
plugin_timeout = 30

Plugin Information

[Plugin: LMS - Music Box] layout = layout plugin = lms_client player_name = musicbox refresh_rate = 5 min_display_time = 30 max_priority = 0 idle_timeout = 1500

running paperpi creates this error

Traceback (most recent call last):
  File "/usr/local/paperpi/paperpi.py", line 690, in <module>
    exit_code = main()
  File "/usr/local/paperpi/paperpi.py", line 672, in main
    plugins = build_plugins_list(config=config, resolution=screen.resolution, 
  File "/usr/local/paperpi/paperpi.py", line 350, in build_plugins_list
    my_plugin.update()
  File "/usr/local/paperpi/library/Plugin.py", line 171, in update
    is_updated, data, priority = self.update_function(*args, **kwargs)
  File "/usr/local/paperpi/plugins/lms_client/lms_client.py", line 139, in update_function
    lms_status = build_lms()
  File "/usr/local/paperpi/plugins/lms_client/lms_client.py", line 103, in build_lms
    self.my_lms = QueryLMS.QueryLMS(player_name=player_name, handle_requests_exceptions=True)
  File "/usr/local/paperpi/venv_paperpi/lib/python3.9/site-packages/QueryLMS/QueryLMS.py", line 147, in __init__
    self.player_name = player_name
  File "/usr/local/paperpi/venv_paperpi/lib/python3.9/site-packages/QueryLMS/QueryLMS.py", line 176, in player_name
    self._set_player()
  File "/usr/local/paperpi/venv_paperpi/lib/python3.9/site-packages/QueryLMS/QueryLMS.py", line 202, in _set_player
    for p in self.get_players():
  File "/usr/local/paperpi/venv_paperpi/lib/python3.9/site-packages/QueryLMS/QueryLMS.py", line 393, in get_players
    players = players['players_loop']
KeyError: 'players_loop'

running "paperpi --run_plugin_func lms_client.scan_servers" also gives the "players_loop" error

txoof commented 7 months ago

Thanks for the updated bug report.

I'll need to take a deeper look into this. I suspect something in the underlying LMS Query library is borked.

Does paper pi start without the LMS plugin enabled?

OrangeTsar commented 7 months ago

It starts without that plugin loaded, and also the problem is intermittent. Sometimes it will start fine, sometimes it gives that error. If I keep trying to start it, it eventually goes.

txoof commented 7 months ago

Are there any other log lines that might be relevant when it fails?

Good to know that the paperpi --run_plugin_func lms_client.scan_servers command also fails.

I'll dig into this to see if I can figure out what's going on.

@OrangeTsar Can you run paperpy with --log_level DEBUG and share any lines around where the LMS plugin crashes?

I think I've zeroed in on where the problem is, but I need some more information about your circumstances.

txoof commented 7 months ago

@OrangeTsar I've updated the QueryLMS library and paperpi. Can you try to reinstall paperpi and see if this fixes your issue?

OrangeTsar commented 7 months ago

Appears to be working. It didn't like a LMS plugin that generated random playlists, but it's all good now it seems.

txoof commented 7 months ago

@OrangeTsar glad to hear it! I'll close this ticket.

Not sure what you mean about the random playlists though. Can you elaborate?