Jump to content
Ultimaker Community of 3D Printing Experts

Communicate directly with printer from a plugin


bradk3
 Share

Recommended Posts

Posted · Communicate directly with printer from a plugin

Is it possible for a plugin to communicate directly with a connected printer without worrying about the underlying communication method?  By this, I mean send gcode directly and read the printer's response whether the printer is connected directly using USB or through something like Octoprint?  

 

I'm combing through the source code but am having trouble figuring out how to do this.  I've found UM's OutputDevice, for instance, which provides a "requestWrite" function, that looks promising, but doesn't give me much hope to be able to read the printer's response.

 

Is there a plugin that already does this sort of thing I could look at?

 

Cheers and thanks!

  • Link to post
    Share on other sites

    Posted · Communicate directly with printer from a plugin
    1 hour ago, bradk3 said:

    Is it possible for a plugin to communicate directly with a connected printer without worrying about the underlying communication method? 

    In a word: no.

     

    Every PrinterOutputDevice has a PrinterOutputController, and some PrinterOutputControllers implement a sendRawCommand method (the PrinterOutputController will have its can_send_raw_gcode property set to true). But there is no generic way to retreive the response.

     

    The requestWrite method is for sending and queueing whole gcode files and is not suitable for individual commands.

  • Link to post
    Share on other sites

    Posted · Communicate directly with printer from a plugin

    I've written a Windows app that I think does what you want.  It isn't for printing via USB but rather for controlling SD card printing from a connected PC.  Gcode commands can be sent and the responses received and are displayed in a text box.  It has other functionality (tuning a print on the fly, bed leveling, macros) as well as some odd post-processing ("cooling profile" is one) that I added because I could.  It is more an alternative to PrintRun (which interface I don't care for) than anything else.

    The full version begat a smaller version which just functions as a print utility with leveling commands but you can send one command at a time and receive and display the printer response.

    Greg's Toolbox is the full monte and includes instructions (such as they are) and a readme for installation.

    Greg's SD Print Tool is the Cliff's Notes version.  This one has just a readme as the program itself is pretty self-explanatory.

     

    They are un-signed Windows apps (VB doesn't port to Linux or Mac) so you would need to fool your anti-virus/firewall in order to install either.

     

    The opening dialog looks like this.  In this case I have a print running.  The gcode for it was post-processed with both a M117 to message the display and an M118 to bounce the same info back to the textbox in the app.

    image.thumb.png.720c43d0d6fe29562304361407420178.png

  • Link to post
    Share on other sites

    Posted · Communicate directly with printer from a plugin
    2 hours ago, GregValiant said:

    I've written a Windows app that I think does what you want.  It isn't for printing via USB but rather for controlling SD card printing from a connected PC.  Gcode commands can be sent and the responses received and are displayed in a text box.  It has other functionality (tuning a print on the fly, bed leveling, macros) as well as some odd post-processing ("cooling profile" is one) that I added because I could.  It is more an alternative to PrintRun (which interface I don't care for) than anything else.

    The full version begat a smaller version which just functions as a print utility with leveling commands but you can send one command at a time and receive and display the printer response.

    Greg's Toolbox is the full monte and includes instructions (such as they are) and a readme for installation.

    Greg's SD Print Tool is the Cliff's Notes version.  This one has just a readme as the program itself is pretty self-explanatory.

    That looks interesting.  I'll check it out.  

     

    Thank you!

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
     Share

    • Our picks

      • New here? Get ahead with a free onboarding course
        Hi,
         
        Often getting started is the most difficult part of any process. A good start sets you up for success and saves you time and energy that could be spent elsewhere. That is why we have a onboarding course ready for
        Ultimaker S5 Pro Bundle, Ultimaker S5, Ultimaker S3 Ultimaker 2+ Connect.   
        They're ready for you on the Ultimaker Academy platform. All you need to do to gain access is to register your product to gain free access. 
        Ready? Register your product here in just 60 seconds.
          • Like
        • 11 replies
    ×
    ×
    • Create New...