Jump to content

Communicate directly with printer from a plugin


bradk3

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
    • Our picks

      • Introducing Universal Cura Projects in the UltiMaker Cura 5.7 beta
        Strap in for the first Cura release of 2024! This 5.7 beta release brings new material profiles as well as cloud printing for Method series printers, and introduces a powerful new way of sharing print settings using printer-agnostic project files! Also, if you want to download the cute dinosaur card holder featured below, it was specially designed for this release and can be found on Thingiverse! 
          • Like
        • 10 replies
      • S-Line Firmware 8.3.0 was released Nov. 20th on the "Latest" firmware branch.
        (Sorry, was out of office when this released)

        This update is for...
        All UltiMaker S series  
        New features
         
        Temperature status. During print preparation, the temperatures of the print cores and build plate will be shown on the display. This gives a better indication of the progress and remaining wait time. Save log files in paused state. It is now possible to save the printer's log files to USB if the currently active print job is paused. Previously, the Dump logs to USB option was only enabled if the printer was in idle state. Confirm print removal via Digital Factory. If the printer is connected to the Digital Factory, it is now possible to confirm the removal of a previous print job via the Digital Factory interface. This is useful in situations where the build plate is clear, but the operator forgot to select Confirm removal on the printer’s display. Visit this page for more information about this feature.
          • Like
        • 0 replies
    ×
    ×
    • Create New...