Temperature message filter doesn't filter temperature messages

Before I start changing it locally, I'm wondering if a temperature log like this should be filtered out:

Recv: ok N5993 P15 B15 T:59.2 /0.0 B:31.8 /0.0 T0:59.2 /0.0 @:0 B@:100:

If I compare it to the regex (below) the difference is significant, there unexpected "N" and "P" parameters in there. Should it match? I mean, is there a reason to leave these out?

(Send: (N\d+\s+)?M105)|(Recv:\s+(ok\s+)?(B|T\d*):)

I wonder if the N\d* is automatically removed before the regex'ing... (plus the checksum)? If so, you're now just down to the unexpected P\d*.

Knowing the printer and/or firmware might help.

yeah, perhaps 'N' is removed already.

It's the MP Mini Delta, which runs some version of Marlin.

You might consider tweaking that in Settings -> Terminal filters, btw. It's not like you have to "hack the mainframe" or anything. :wink:

Yeah, of course. Regexes are trivial. I'm just wondering why.

To me, the firmware is doing something unexpected. :shrugs:

Yeah, trying to figure out why/how. @foosel saw the P15/B15 entries, which makes me think it isn't that weird.

Comparing, here's the output from a Prusa:

Recv: ok T:210.3 /210.0 B:60.0 /60.0 T0:210.3 /210.0 @:85 B@:53 P:37.5 A:40.8

I can't find a reference for much of the output format. :woman_shrugging:

At some point, it just is what it is. Just make your regex work with both, I guess.

Welcome to my life :wink:

My guess is the P and B values in the first example are buffer information regarding the internal command buffer and the planner buffer for the motion planner. N is the line number that was acknowledged. Those are optional and only even available in recent firmware builds (enhanced ok or something like that it was called I think, at least in Marlin - no idea about other firmware variants). I wasn't aware that they might show up in temperature responses, but it does make sense in a way.

T is the currently selected hotend, T0 the first, T1 the second and so on, B is the bed. @: and B@: denote the current power level of the heaters I think.

I so far have never seen the P: notation. No idea what that is supposed to mean. Also no idea about A: in this context.

In any case, to filter out those lines that contain the P and B values before the temperature output, I'd try the following regex:

(Send: (N\d+\s+)?M105)|(Recv:\s+(ok\s.*)?(B|T\d*):)

Do you want me to put in a PR for an upgraded regex? Also yours was incorrect, it was missing the B entry (maybe you accidentally pasted in the default version?). I'm also fussing with the colon location in this version:

(Send: (N\d+\s+)?M105)|(Recv:\s+(ok\s.*)?([PBT]:?\d*))

next iteration, trying to stay with the spirit of the original by ensuring we find an entry with a colon and avoiding the .*.

(Send: (N\d+\s+)?M105)|(Recv:\s+(ok\s+)?([NPBT]\d*\s?)*:)

Of course, it could possibly be simplified to this if you are okay with it matching more things:

(Send: (N\d+\s+)?M105)|(Recv:\s+(ok\s+)?.*T\d*:\d+)

The idea behind the .* bits in mine was to capture anything like N, P, B and so on that went before a T:, T\d: or B: - but I admittedly also didn't test it so might have gone a bit over board there :wink:

PR against maintenance would be welcome :heart:

linking for context:

I´m sorry if this is not the right place, but I´d like to know if its possible to filter temperature messages from the terminal as default. Every time I disconnect and reconnect my printer and goes to terminal, I get tons of temperature messages covering other info I want to look at.

1 Like

I just looked in terminal.js and terminal.jinja2 and don't see that it is plumbed through. It's a great feature request, though.