-
Notifications
You must be signed in to change notification settings - Fork 4
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
Unable to get it running with Readme examples #270
Comments
I think you are mixing up a few things.
Since you want to connect locally to an XL you should look into PrusaLink v2. It is the same as what the Home Assistant integration uses for example. From what I can tell, based on the python, you are looking into the V1 source code. This is not correct for the Prusa XL. |
I'm specially looking for to accessing the Print Queue and Set Ready command for my home assistant. Both are Prusa Connect features and not available/part of Prusa Link Vx. Hence, why I'm looking at this SDK. Looks like this library is mostly meant for a Printer that communicates with Prusa Connect and not a User/Script that reads data from Prusa Connect? |
In that case it might be much easier to just use the dev tools on the browser when working on connect.prusa.com and look at what is happening there on the network tab in dev tools |
Yeah, I was really hoping this "Python printer library for Prusa Connect" from Prusa directly could do most of the heavy lifting. |
I'm somewhat confused by this thread. I'm also trying the example code from the readme and not really getting expected results. I currently own a prusaXL which is registered to The constructor for class Printer:
...
def __init__(self,
type_: Optional[const.PrinterType] = None,
sn: Optional[str] = None,
fingerprint: Optional[str] = None,
max_retries: int = 1,
mmu_supported: bool = True): And here is the example from readme from prusa.connect.printer import Printer, const
SERVER = "https://connect.prusa3d.com"
SN = 'SERIAL_NUMBER_FROM_PRINTER'
FINGERPRINT = 'Printer fingerprint'
TOKEN = 'secret token from prusa_printer_settings.ini'
printer = Printer(const.PrinterType.I3MK3, SN, SERVER, TOKEN) This leaves me with 2 questions:
|
I'm trying to get it running, but the examples from the Readme are all outdated and / or the error handling appears to be wrong?
My use case is basic. My Prusa XL is already connected to Prusa Connect and I just want to get the current printer state.
My odyssey
---- Let's just go through what I did and why it's frustrating.Picking up the very first example from the Readme:
Running this will result in the first error:
The arguments from Printer are different now. The 3rd Argument is now finterprint (instead of SERVER) and the 4th argument is now max_retries (instead of TOKEN)
The next issue, the Prusa XL doesn't exist as PrinterType.
Prusa-Connect-SDK-Printer/prusa/connect/printer/const.py
Lines 47 to 57 in b3e8f6d
Okay, maybe it's too new, but Prusa Mini (and MK4) don't even exist. Looking at the code, the PrinterType is optional, so I'll leave it empty:
Prusa-Connect-SDK-Printer/prusa/connect/printer/__init__.py
Lines 85 to 89 in b3e8f6d
Upnext I tried the following code:
While I know the SerialNumber I have no clue what fingerprint is. So I used the Printer UUID from the Prusa Connect settings page of my printer.
Running that looks good! I got a State back!
But wait a second.. HOW? I didn't even enter an API Token and just the SN and UUID shouldn't be enough. So I tried setting stupid data like this:
Running that looks good as well? I got a state back and no error whatsoever.
Digging deeper into the SDK Code I have to call
printer.set_connection
. The function want a Server and a Token but not the API Token, a different token. I did some research and looks like downloading the "LAN settings" from Prusa Connect contains both, the Server and the token. Furthermore, the API Key is still not set, so just set this as well.Running that code now, which looks like this:
Running it?
Which is still wrong! It should be PRINTING
Would it be possible to provide an up2date Readme example that shows the current printer status, nozzle temperature, print time and document which (API) tokens and fingerprints I need to get it running?
The text was updated successfully, but these errors were encountered: