prusa_exporter icon indicating copy to clipboard operation
prusa_exporter copied to clipboard

Metrics stop sending when a print is running

Open gelicia opened this issue 7 months ago • 8 comments

Printer is an Mk4, using firmware updated today: 6.2.4-8909

Printer is connected through a laptop via an ethernet cable. Enabled Internet sharing on the laptop, all options checked. Laptop is a Macbook Air with ethernet being ran through a USBC-Ethernet dongle. Checked printers IP address, including API, is accessible using the printer's IP and a web browser. Successfully get a response from the /job endpoint, with the correct information if a job is running.

Followed instructions in readme to enable metrics, and ensured the listed ones were on (Except for chamber_temp, which I could not find listed). I see a very cute little graph icon on the top of my printer's display.

Listed host as the IP of the laptop, as found by hitting option and clicking the wifi icon in the top bar.

Downloaded and extracted zip file of alpha, tagged here https://github.com/pstrobl96/prusa_exporter/releases/tag/2.0.0-alpha1

Copied prusa.yml from this file and pasted to root https://github.com/pstrobl96/prusa_exporter/blob/2.0.0-alpha1/docs/config/prusa.yml

Edited the values to be the printers IP address, and my prusa link password. Added a name and a type.

Ensured docker is running, then ran docker compose up.

Checking out prusa_info in explore with my printer's IP, I am seeing that metrics are being sent when a print job is not running. As soon as the print starts, the metrics stop. And stopping the print means the metrics send again.

I imported the dashboard here https://github.com/pstrobl96/prusa_exporter/blob/2.0.0-alpha1/docs/Prusa%20Metrics%20MK4_C1-1747124111854.json and entered my printers IP address as a dashboard variable.

When the print is off, I see the basic information like my printer name, type, filament type and status. Of course since its not printing, the dashboard is mostly empty. When starting a print, some of the data is cached but attempting to look at an individual panel shows no data. Doing a full refresh of the page show everything empty.

I do not see anything in any of the docker container's logs to indicate what the issue might be but if a specific place would be good to do a through examination, please let me know!

Is there a setting that I am missing? Something else?

gelicia avatar May 19 '25 18:05 gelicia

Hello, I'd say there is something with the printer. Values like name, type, loaded filament, status are loaded from PrusaLink - REST API that printer expose. Other metrics are loaded via line_protocol.

When you go into Settings - Netrwork - Metrics & Log; can you see the correct address for metrics server - IP address of Macbook? It happened to me before, that I set the value in the settings and then I ran the gcode setting wrong IP address and I was confused where are the data.

However I'm not sure if it's not something with Macbook, I haven't tested the exporter with macOS

pubeldev avatar May 19 '25 18:05 pubeldev

Hmm, okay with that prompting, I figured trying to use the laptop wifi IP address was probably the wrong thing. I went into OSX's network settings and confirmed which one was the ethernet dongle by disconnecting it and reconnecting it. I got the IP address from there and put it into the host under Settings/Network/Metrics & Log. Still had the same issue.

I am not using the gcode setting if that helps, but entering it into the printer via the interface. I can try the gcode method if that would help make things consistent.

Are you exporting to grafana cloud from the printer?

gelicia avatar May 19 '25 19:05 gelicia

Also just to say too this isn't urgent for a conference or anything. I have v.1 working fine which will be good enough (it's a smaller, local conference). It would be great to get the shiny new-ness working, but super fine if not. I really appreciate your work with this!

gelicia avatar May 19 '25 19:05 gelicia

Are you exporting to grafana cloud from the printer? - No, in docker compose there is Prometheus 3.0 and everything is running locally.

If you connect printer directly to computer you have to configure static IP address

create prusa_printer_settings.ini on printer flash drive and put this in it

[eth::ipv4]
type=static
addr=192.168.33.2
mask=255.255.255.0
gw=192.168.33.3

set IP address on laptop to 192.168.33.3. Then go to Settings - System - Load Settings from File

In Metrics & Log just make sure you have set correct IP address.

How to enable metrics is visualized bellow. You can actually use touch screen to write IP address and you don't have to run the gcode

Image Image Image Image Image Image

pubeldev avatar May 20 '25 08:05 pubeldev

Btw. list of the metrics is different for every printer, Core One has chamber_temp you mentioned. Same as Prusa XL with enclosure. However MK4 does not contain this metric. I need to clarify it a bit more in README.md

pubeldev avatar May 20 '25 08:05 pubeldev

Okay I can check this out but I have another question

The docs say "address where prusa_metrics_handler is running" for the host IP - is that something we need to be running independently of this project?

In Metrics & Log just make sure you have set correct IP address.

How do you do this? I wrote out how I got the IP address above, but Im wondering what you do for this.

gelicia avatar May 20 '25 14:05 gelicia

The docs say "address where prusa_metrics_handler is running" for the host IP - is that something we need to be running independently of this project? - Hah, good catch, I'll update the README.md. For alpha2 there is going to be a revamp and I'll describe the configuration process more precisely. In alpha1 you don't have to run prusa_metrics_handler, it's already integrated in prusa_exporter.

How do you do this? I wrote out how I got the IP address above, but Im wondering what you do for this. - You can run this gcode and update the IP address in the file - port as well.

Or use printers dialog, use interact via touch screen and click on it. It will reveal candybar-like keyboard. At least it does not have T9.

pubeldev avatar May 21 '25 06:05 pubeldev

You can run this gcode and update the IP address in the file - port as well.

Sorry for not being clear with the question. How do you discover what IP address to enter into that gcode or interface?

gelicia avatar May 21 '25 12:05 gelicia