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

      • Here it is. The new UltiMaker S7
        The UltiMaker S7 is built on the success of the UltiMaker S5 and its design decisions were heavily based on feedback from customers.
         
         
        So what’s new?
        The obvious change is the S7’s height. It now includes an integrated Air Manager. This filters the exhaust air of every print and also improves build temperature stability. To further enclose the build chamber the S7 only has one magnetically latched door.
         
        The build stack has also been completely redesigned. A PEI-coated flexible steel build plate makes a big difference to productivity. Not only do you not need tools to pop a printed part off. But we also don’t recommend using or adhesion structures for UltiMaker materials (except PC, because...it’s PC). Along with that, 4 pins and 25 magnets make it easy to replace the flex plate perfectly – even with one hand.
         
        The re-engineered print head has an inductive sensor which reduces noise when probing the build plate. This effectively makes it much harder to not achieve a perfect first layer, improving overall print success. We also reversed the front fan direction (fewer plastic hairs, less maintenance), made the print core door magnets stronger, and add a sensor that helps avoid flooding.
         

         
        The UltiMaker S7 also includes quality of life improvements:
        Reliable bed tilt compensation (no more thumbscrews) 2.4 and 5 GHz Wi-Fi A 1080p camera (mounted higher for a better view) Compatibility with 280+ Marketplace materials Compatibility with S5 project files (no reslicing needed) And a whole lot more  
        Curious to see the S7 in action?
        We’re hosting a free tech demo on February 7.
        It will be live and you can ask any questions to our CTO, Miguel Calvo.
        Register here for the Webinar
          • Like
        • 12 replies
      • UltiMaker Cura 5.3.0-Alpha 🎄 Tree Support Spotlight 🎄
        Are you a fan of tree support, but dislike the removal process and the amount of filament it uses? Then we would like to invite you to try this special release of UltiMaker Cura. Brought to you by our special community contributor @thomasrahm
         
        We generated a special version of Cura 5.2 called 5.3.0 Alpha + Xmas. The only changes we introduced compared to UltiMaker Cura 5.2.1 are those which are needed for the new supports. So keep in mind, this is not a sneak peek for Cura 5.3 (there are some really cool new features coming up) but a spotlight release highlighting this new version of tree supports.  
          • Like
        • 17 replies
      • 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
        • 14 replies
    ×
    ×
    • Create New...