Jump to content
Ultimaker Community of 3D Printing Experts

Livestream of current G-Code execution


timotub
 Share

Recommended Posts

Posted · Livestream of current G-Code execution

Is there a possibility to stream the currently executed G-Codes somewhere? - Maybe this could be integrated into the REST API?

I guess I have to implement this feature myself, for that I have the following questions

1. Is it possible to upgrade python to a later version without danger of destroying something? - On my printer there is an installation of python 3.4.

2. Could I add pykafka to the existing python installation without dangers?

3. Where in the architecture would you sugguest me to plug in this feature? - I have figured out that the actual transmission of G-Codes to the Ultiboard is done in physicalLayer.py, using a SerialDumpFormatter. I would then modify the SerialDumpFormatter to only include the plaintext of transmitted code and stream it out either using pykafka or integrate it to Flask.

 

What are your thoughts?

  • Link to post
    Share on other sites

    Posted · Livestream of current G-Code execution
    1 hour ago, timotub said:

    1. Is it possible to upgrade python to a later version without danger of destroying something? - On my printer there is an installation of python 3.4.

    Possible, yes. But it will come with a lot of risk.
     

    1 hour ago, timotub said:

    2. Could I add pykafka to the existing python installation without dangers?

    Changing things is never without danger and all modifications that you make are on your own risk. I don't think that this is likely to cause issues though.

     

    1 hour ago, timotub said:

    3. Where in the architecture would you sugguest me to plug in this feature? - I have figured out that the actual transmission of G-Codes to the Ultiboard is done in physicalLayer.py, using a SerialDumpFormatter. I would then modify the SerialDumpFormatter to only include the plaintext of transmitted code and stream it out either using pykafka or integrate it to Flask.

    I'm not with the firmware team, so I can't give you a good answer to that.

    But to remove the risk of the XY problem (https://xyproblem.info/) being a thing here. Why do you want this in the first place?

    • Like 1
    Link to post
    Share on other sites

    Posted · Livestream of current G-Code execution

    Thank you for your reply and sorry that this may sound strange.

     

    There are additional sensors mounted to the printer, whose data is already streamed to Kafka by separate hardware. I want to stream the G-Code instructions as well, to gather all the live data in one place and to analyze it to enable a better control of the printing process.

    Why I want to process the data on a separate machine? - Because I think that the embedded UM3-system should not get more compute load to work on.

  • Link to post
    Share on other sites

    Posted · Livestream of current G-Code execution
    2 hours ago, timotub said:

    Thank you for your reply and sorry that this may sound strange.

     

    There are additional sensors mounted to the printer, whose data is already streamed to Kafka by separate hardware. I want to stream the G-Code instructions as well, to gather all the live data in one place and to analyze it to enable a better control of the printing process.

    Why I want to process the data on a separate machine? - Because I think that the embedded UM3-system should not get more compute load to work on.

    Ah, yes, that makes sense! I will notify one of our FW engineers about this topic, they are better able to answer your questions.

    • Like 1
    Link to post
    Share on other sites

    Posted · Livestream of current G-Code execution

    Here one of the firmware developers:
    You mention python 3.4, from this I assume your printer is an UM3? The S3 and S5 printers updated last year to a new Linux version with python 3.6

     

    1) Updating python is possible, but like @nallath said there is a lot of risk. I'd expect you have to update several of the related packages like Flask, etc. It will be a lot of work. Perhaps for a first try it would be easier to stick with python 3.4 and install older versions of the packages you want to use. When you have those older version working and time left, then you can always decide to upgrade.

     

    2) installing extra packages like pykafka is possible. The only problem we sometimes run into is a short of memory

     

    3) SerialDumpFormatter is not how we do the actual communication but is a part of the code for dumping the raw communication data to files. You could do your thing here if you want to, just check the option switch that's there somewhere. By default we are not dumping the raw data.

     

    • Like 2
    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
        • 8 replies
    ×
    ×
    • Create New...