Prusa MK4/Prusa-Link Driver

Hello everyone!

I have a Prusa MK4 printer on an isolated LAN with my C7 hub, and I was wondering if there was any interest from the community in creating either a driver for it specifically or some sort of Prusa-Link driver or app based on the web API. My primary use case would be getting notifications for events like when a print is done or the printer runs out of filament. Additionally, remotely viewing telemetry from a dashboard, or at least a snapshot of that data, would be great. There are plenty of other capabilities that the API lists like directly controlling print jobs, but those are my initial thoughts.

If anyone is interested, I'd be happy to help test a solution. :slightly_smiling_face:

Web API reference: Prusa-Link-Web/spec/openapi.yaml at bc157b2496874f1712165f71ac8521e5c0cb6e07 · prusa3d/Prusa-Link-Web · GitHub

2 Likes

Are you offering to write a driver? If so I’d support it. I have a MK4 and love it and would welcome something like this.

I wish I had the skills to do so. I can read code well enough to decipher a decent chunk of what it's doing, and I can cut and paste bits of existing code together for very simple things, but writing something from scratch is beyond my skillset, as of now. Basically, I can be dangerous but not useful, haha.

There are octoprint integrations but that is not specific for Prusa.

1 Like

This is what I have used in the past but haven't tried with the newer network enabled Prusa's. I was hoping to keep things simple and move away from Octoprint but, as per the OP, what I miss the most is the notifications.

While the Octoprint/hubitat app can be made to work for this I find that using the webhooks plug-in and Maker API is better for that specific purpose. While a Prusa specific one sounds nice it would be way better for Prusa to just implement local webhooks so I can stick with Prusalink and still get my hubitat notifications.

Somebody has figured it out for HA: PrusaLink - Home Assistant (home-assistant.io)

1 Like

Curses. I can't get user intervention (ie. filament change) notifications to work on XL using octoprint as the printer status/state does not change during these events like it does on mk3.

Not sure how difficult it would be to port that driver to Hubitat. I know it's possible to integrate HA to Hubitat via a bridge, but that's not a time/money commitment I'd want to make for this alone.

1 Like

I have been playing around with this off and on with the help of ChatGPT. Originally, I tried creating a driver to poll PrusaLink, but I couldn't work out the digest authorization in the driver code and kept getting a 401 response. With a little extra time over the past couple of weeks, I tried to go at it from a different angle. I tried to see if I could use a Python script (again, ChatGPT) to connect to /api/v1/status, and I got it to connect and start displaying telemetry right away. I have a NAS on my network, so I got ChatGPT to write a full script that will run on the NAS and a driver that reaches out to the service that is running on the NAS for data. It works, but there are a couple of bugs that need to be worked out. No control of the printer yet, but for my use case, it's getting there.

1 Like

I use octoprint integration and it works great for what you want. Otherwise I would probably take the time to write the driver myself….

Do you get filament change notifications though? I couldn't get this to work with XL the same way it worked with mk3.