Temperature message filter doesn't filter temperature messages


#1

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*):)

#2

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.


#3

yeah, perhaps 'N' is removed already.

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


#4

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


#5

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


#6

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


#7

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


#8

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:


#9

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


#10

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*):)

#11

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*))

#12

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+)


#13

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:


#14

linking for context:


#15

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.


#16

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.