TFT percentage progress not updatet M73

HOST_ACTION_COMMANDS:


-> Enabled in the firmware and M118 commands obviously work because I can switch the tft to printing menu with:
M118 P0 A1 action:print_start

HOST_STATUS_NOTIFICATIONS:


-> Enabled in the firmware but M117 commands seems to have no effect

Yes but shouldn’t that then send to the tft from the printer ? Otherwise I would assume that the possibility to use better progress estimations would be useless (because not displayed on the tft).

Why that ? I‘m trying with the terminal of OctoPrint (and tried Pronterface aswell).
The developer sent me this, so also from a host (not OctoPrint):

Tried the following sequience of commands (reported on section Printing from Remote Host) and it properly worked

M118 P0 A1 action:print_start

M117 Data Left 1234/12345

and

M118 P0 A1 action:notification Data Left 1234/12345

@lethuer, Please remember that this is the OctoPrint forum. We have no control over the firmware in the printer or the firmware in the TFT.

All OctoPrint can do is send M73, M117, and/or M118 commands through the USB serial interface to the printer firmware. It is up to the printer firmware to communicate those commands (or modifications of them) to the TFT firmware. Perhaps the TFT firmware eavesdrops on the printer communications. The exact communications path(s) are completely out of OctoPrint's control.

If the M117 or M118 commands that are documented don't work as advertised or as you would like them to, then nothing you communicate here will change the behavior.

1 Like

Wow ! Finally I found this is working for me to update the tft...
Never tried M118 before for more than switching to printing menu.
Now back to octoprint...
How can I include M118 messages in the stream which is sent to the printer ?

You would have to write a plugin.

I'd start with https://github.com/cesarvandevelde/OctoPrint-M73Progress and modify it to inject the M118 command instead of the M73 command.

Does M118 P0 A1 action:notification Layer Left <XXXX>/<YYYY> also update the progress bar?

No.

M118 P0 A1 action:notification Time Left XXhYYmZZs
-> Updates Time Left Field

M118 P0 A1 action:notification Layer Left XX/YY
-> Updates Layer Left Field

M118 P0 A1 action:notification Data Left XX/YY
-> Updates Percentage Field + Progress Bar

Found this interesting discussion about the same topic:

Didn't tried yet but seems the developer of plugin "DisplayLayerProgress" provided a test version to support M118 instead of M117 messages...

This is excellent news. I believe a one line change in OctoPrint-M73Progress will solve your issue. Now all I have to do is figure out how you can do that!

1 Like

Here's the one line change (untested, of course):

(code deleted, see newer response)

@Charlie_Powell or @jneilliii , can you help me figure out how @lethuer can install this change on his system?

1 Like

Probably the easiest way would be to fork the original plugin and make the change in it and install that version. Otherwise, in order to manually update the code you have to find the files in site-packages of the venv. For an octopi 0.18 installation that would probably be something like this...

nano ~/oprint/lib/python3.7/site-packages/octoprint_m73progress/__init__.py

for octopi 1.0.0 is would be something like this

nano ~/oprint/lib/python3.9/site-packages/octoprint_m73progress/__init__.py
1 Like

Exactly what I needed! Thank you!

I'd like @lethuer to see if my change actually works before putting any more effort into forking the original plugin. I'm not sure if there would be more than one user!

I guess I need one more hint... After I edit the file, what do I have to do to get it "recompiled"?

you just have to restart OctoPrint's service.

Attached is (a zip file with) a modified __init__.py for the OctoPrint-M73Progress plugin.

m73progress.zip (1.5 KB)

I got carried away so it's more than a one line change. Instead of using nano to edit the file, use cp to copy this file into the location shown by @jneilliii in his response.

I kept the M73 command and added two M118 commands, one for "time left" and one for "data left". I was able to test this change on my LulzBot TAZ6 so I'm fairly confident that it will work on your printer. I'm sure you will let us know one way or the other!

1 Like

You are on your own to find a plugin to modify with this one :grin:

First of all I tried the test version mentioned above: How to send M118 A1 P0 action:notification Time Left hms (e.g. 02h04m06s)
I couln't make any comment here because the discussion is already closed.

I made comments about my experience here as proposed by @OllisGit : Feature-Request: Use M118 instead of M117 commands · Issue #252 · OllisGit/OctoPrint-DisplayLayerProgress · GitHub

Here a copy of my message:
I tested this test version for M118 provided by @OllisGit: Release V1.29.0.dev1 · OllisGit/OctoPrint-DisplayLayerProgress · GitHub
together with this small modification provided by @racSF: Feature-Request: Use M118 instead of M117 commands · Issue #252 · OllisGit/OctoPrint-DisplayLayerProgress · GitHub
and created a zip File with that which can be installed directly:
https://github.com/OllisGit/OctoPrint-DisplayLayerProgress/files/14804163/OctoPrint-DisplayLayerProgress-1.29.0.dev1_MissingHourMod_compressed.zip

I have configured this:
For print progress I used progress information: P0 A1 action:notification Data Left [progress]/100
Another possibility would be to use layer information: P0 A1 action:notification Data Left [current_layer]/[total_layers]

That's working for me AFTER uploading a file again (which includes M118 messages instead M117), so I would really like to get a stable version !
Otherwise changes would be gone with next update, which is provided:
image

Additionally I would like it would be possible to send three M118 messages to the printer:

M118 P0 A1 action:notification Time Left XXhYYmZZs
-> Updates Time Left Field
M118 P0 A1 action:notification Layer Left XX/YY
-> Updates Layer Left Field
M118 P0 A1 action:notification Data Left XX/YY
-> Updates Percentage Field + Progress Bar

But currently there are only 2 fields are available.
For me it wouldn't be neccessary to toggle between messeges, they could be send all at the same time.

One small downside:
Currently I additionally have installed an SSD1306 display together with this plugin:

With the modified "DisplayLayerProgress" plugin mentioned above on the display now "INIDICATOR-Layer1" is displayed.
I think the reason is that the plugin also uses M117 messages which are now completely replaced by M118.

Definitely more than one user (see my mentioned discussion above). I think anybody with an artillery printer (Genius / Sidewinder) would benefit from this :slight_smile:

Of course I installed your version, but I used another (maybe easier) way:
I downloaded the original M73 plugin: Release 0.2.1 · cesarvandevelde/OctoPrint-M73Progress · GitHub
Then I put in your modified file and created a new zip file: OctoPrint-M73Progress-0.2.1-M118.zip (764.8 KB)
Afterwards I installed this version like I did with the other test version mentioned above:
Pluginmanager -> "+ Mehr" -> "...von einer hochgeladenen Datei"

AWESOME, you did a great job !!!
In the terminal I can observe messages like this:

Send: N951 M73 P23 R26*29
Recv: echo: M73 Progress: 23%; Time left: 26m;
Recv: ok N951 P0 B3
Send: N952 M118 P0 A1 action:notification Time Left 00h26m00s * 96
Recv: //action:notification Time Left 00h26m00s
Recv: ok N952 P0 B3
Send: N953 M118 P0 A1 action:notification Data Left 23/100 * 9
Recv: //action:notification Data Left 23/100

Ragarding:

Send: N952 M118 P0 A1 action:notification Time Left 00h26m00s * 96

I think you have implemented leading 0h so that the remaining print time is not cut ?
This was a hint in the other test plugin: Feature-Request: Use M118 instead of M117 commands · Issue #252 · OllisGit/OctoPrint-DisplayLayerProgress · GitHub
For that there was this modification: Feature-Request: Use M118 instead of M117 commands · Issue #252 · OllisGit/OctoPrint-DisplayLayerProgress · GitHub
Or didn't you made any changes here and original M73 plugin already handles this correctly ?

Regarding:

Send: N953 M118 P0 A1 action:notification Data Left 23/100 * 9

Here it's great that you are using same approach as I thought about:

Would it be possible to also include layer information ? Then I would have anything I need :slight_smile:
Maybe it would also be nice option to have the possibility to select if M118 messages should send instead or additionally to M73 ?! Maybe with a checkbox in the plugin settings ?

With your solution it is possible that additional plugins which also uses M117 messages aren't affected ! :wink: So my additional display just works like before if using the original "DisplayLayerProgress" plugin.

I modified only the one function listed below. The function inputs are progress 0-100 and time_left in minutes. The minutes value is divided by 60 to get hours and modulo by 60 to get minutes. The M118 command is formatted with 2 digits with leading zeros.

The proper thing to do is to modify the name of the plugin and then make any other modifications you want. I was tempted to remove the / 60 from line 72 and do that division in the _set_progress function so that the M118 could output hours, minutes, and seconds but I wanted to minimize my changes.

The OctoPrint-M73Progress plugin doesn't expose the layer information so adding an M118 command for layers would be significant work. It looks like you have enlisted the aid of @OllisGit and his OctoPrint-DisplayLayerProgress plugin so perhaps you can convince him to include this feature.

Again, I think the correct solution is to borrow code from both plugins and make your own plugin specifically for this printer / display combination.

    def _set_progress(self, progress, time_left=None):
        if time_left is None:
            gcode = "M73 P{:.0f}".format(progress)
            gcode2 = "M118 P0 A1 action:notification Time Left 00h00m00s"
        else:
            gcode = "M73 P{:.0f} R{:.0f}".format(progress, time_left)
            gcode2 = "M118 P0 A1 action:notification Time Left {:02.0f}h{:02.0f}m00s".format(time_left / 60,time_left % 60)

        gcode3 = "M118 P0 A1 action:notification Data Left {:.0f}/100".format(progress)

        self._printer.commands([gcode,gcode2,gcode3])

@lethuer,

After a little research, adding the M118 for layer information can be done in your slicer. See here for details.

One could also write a small post-processing script in your favorite language (mine would be Perl).

Yes sure you could insert layer info from the slicer. I found this notice in plug-in „DisplayLayerProgress“:

  • The layer information works only when the slicer adds “layer-indicator” to the g-code (CURA-Example as comments like ;LAYER:10). Then these indicators are parsed via a regular-expression.

Then the plug-in provides possibility to create messages with [current_layer] / [total_layers].
So in principle layer information is already available in gcode and it should be possible to include this in your modification „M73 Progress“ plugin aswell ?!

Side notice:
If I upload a gcode file to OctoPrint and download it afterwards I can observe that these layer informations are added (with M117 messages in original plug-in). I think this is done by the plugin automatically after uploading a file.

I agree, putting the M118 command in the layer change gcode of slicer is a better approach for the layer data, otherwise you'll have to rely on DisplayLayerProgress to do that for you. That plugin has been known to cause some issues in the past.