Virtual printer doesn't echo M118

What is the problem?
I'm testing a hardware/software interface to drive enclosure LEDs
If I use a real printer M118 echoes correctly
Using the virtual printer, it just replies ok
Is this expected behaviour?

What did you already try to solve it?
tried with "real" printer and all works fine
virtual printer - not so much

Logs (octoprint.log, serial.log or output on terminal tab at a minimum, browser error console if UI issue ... no logs, no support!)
terminal log REAL

Send: M118 //action:LEDs red   <= this is my command
Recv: //action:LEDs red        <= response
Recv: ok
Send: M118 //action:LEDs green
Recv: //action:LEDs green
Recv: ok

terminal log VIRTUAL

Send: M118 //action:LEDs blue         <= this is my command
Recv: ok                              <= response
Recv: T:21.30 /0.00 B:21.30 /0.00 @:64
Recv: Not SD printing
Recv: wait
Recv: Not SD printing
Recv: wait
Recv: T:21.30 /0.00 B:21.30 /0.00 @:64
Recv: Not SD printing
Recv: wait
Recv: Not SD printing

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible)
OctoPrint 1.4.0 OctoPi 0.17.0
printer: Creality Ender-3
OS: Windows 10
browser: Chrome

I guess that's something only @foosel can tell you (when she's back at work on monday) :slight_smile:

You can fake a response with the virtual printer using the command !!DEBUG:send //action:LEDs red.

1 Like

@jneiliii that is brilliant!

Don't forget to mark the solution.

neat solution provided by @jneiliii in the 3rd post :slight_smile:

I decided to tinker (always a bad idea)
I made a small change to virtual.py
and M118 now echoes correctly

great

how do I offer this up so it gets incorporated into the real thing?
a Plugin seems overkill for 2 lines of code?!?

To contribute to the OctoPrint project, see:

At the very minimum, you could post your change as a patch but the above documents the proper method, creating a pull request.

cheers
I'm working down that route now :slight_smile:

You may want to hold back until the next release, my understanding is the Virtual printer has been extracted out into it's own full plugin now, so you might want to submit your changes against it.

ah ok

I'll stand down for a mo!

Only the settings have finally been extracted into the full plugin that was there for a while now, the code location is still the same. Filing a PR against maintenance should find everything still where it's expected.

1 Like

@foosel
ok once I've finished testing I'll give that a try!

But not all the settings are editable in the UI yet? It seems that only enabling/disabling the Virtual Printer is currently visible in RC3.

Yep, and I'm not really interested into changing that tbh... The only thing I could imagine putting there is a JSON or YAML editor to adjust them that way. I only added the toggle in as it makes quick tests on fresh instances so much easier.

1 Like

If someone was to design a beautiful settings interface for it... would it be considered? Could be hidden behind the checkbox until enabled to not confuse users too much.

If it was somehow populated automatically from the definitions, yes. Otherwise, eh :wink: The problem is, I really don't want to have to maintain and translate yet another bunch of settings for a development tool.

It could maybe be done... Will take a look at some point. Have some idea as to how, but it may not be pretty if it is done automatically from the settings.