Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PursaLink not starting, error parsing power_panic file? #1015

Open
pth0rn opened this issue Jan 14, 2025 · 1 comment
Open

PursaLink not starting, error parsing power_panic file? #1015

pth0rn opened this issue Jan 14, 2025 · 1 comment

Comments

@pth0rn
Copy link

pth0rn commented Jan 14, 2025

Not sure exactly what happened or why but I encountered an issue while powering on my printer.
LCD would display "PrusaLink Starting..." (or vise versa , i forget) indefinitely. I SSH'd into the Pi and found this error:

ERROR: Adapter was not start {run():53}
Traceback (most recent call last):
  File "/home/p/.local/lib/python3.11/site-packages/prusa/link/daemon.py", line 51, in run
    self.prusa_link = PrusaLink(self.cfg, self.settings)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/p/.local/lib/python3.11/site-packages/prusa/link/printer_adapter/prusa_link.py", line 152, in __init__
    power_panic_delay(cfg)
  File "/home/p/.local/lib/python3.11/site-packages/prusa/link/util.py", line 338, in power_panic_delay
    pp_data = PPData(**json.load(pp_file))
                       ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/__init__.py", line 293, in load
    return loads(fp.read(),
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

After poking I found the "power_panic" file and assumed it had something to do with that. So renamed it to something else and after restarting the printer again PursaLink booted fine. I checked the file's contents and it was empty so I figure that may be the reason for the unhandled error.

Copy link
Contributor

TojikCZ commented Jan 14, 2025

Yup, handling that shouldn't be ultra hard. If anyone feels like making a PR, I'd most likely merge it. Just delete or ignore the file if it doesn't parse. Make sure that no checks of the Power Panic file existence and whatnot affect the state, just skip it in such case. If I get to it, Ill try to fix it. But I won't have much time to dedicate to it. Thank you for the excellent report tho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants