Giter Site home page Giter Site logo

Comments (7)

STS-ATS avatar STS-ATS commented on June 26, 2024 2

Hey there, i have an update, jejeje

Guys, the RPC server is already reporting the current line, on the ETA, its the third value, i have already been able to extract it and use it

Somehow i didn't notice it when i was working with that

Thanks, hope it would be usefull

from printrun.

DivingDuck avatar DivingDuck commented on June 26, 2024 1

One possible way is to add https://reprap.org/wiki/G-code#M118:_Echo_message_on_host before a pause. You can catch up the message then and use this as a trigger in your action chain.

from printrun.

rockstorm101 avatar rockstorm101 commented on June 26, 2024 1

ive found some interesting "flags", like error, on_end, on_layerchange, on_printsend and the on_recv
i wonder if there is any way to access that data from the rpc server?

No, such functionality does not seem implemented as of today.

how could i know in which exact number line of the G code, the software is sending to the printer?

Good question (note to self to document this attribute) The printcore.printcore.queueindex attribute holds the current index in the queue of commands to be sent

from printrun.

rockstorm101 avatar rockstorm101 commented on June 26, 2024 1

@rockstorm101, we should leaf this open as I have some concern with the behavior of RPC (see in details). The shown information need to be at least correct, especially for temp values.

Agreed. We can definitely improve the code a bit. I would open a new issue with your findings and what exactly needs changing. Since this one was more like a question about pausing a print via RPC and not technically a bug report. But up to you. I'm happy either way.

from printrun.

STS-ATS avatar STS-ATS commented on June 26, 2024

Ok, got it
Thanks

But, how could i capture the message?

Ive been reading some .py files of pronterface, ive found the eventhandler.py https://github.com/kliment/Printrun/blob/master/printrun/eventhandler.py
and ive found some interesting "flags", like error, on_end, on_layerchange, on_printsend and the on_recv
i wonder if there is any way to access that data from the rpc server?

or do i have to change the rpc.py to add options to read that data and re-make the pronterface.exe?

i have another question, how could i know in which exact number line of the G code, the software is sending to the printer?
other than counting the number of events of the on_printsend of the eventhandler

I will really appreciate your ideas, and comments

from printrun.

DivingDuck avatar DivingDuck commented on June 26, 2024

Good question (note to self to document this attribute) The printcore.printcore.queueindex attribute holds the current index in the queue of commands to be sent

I did never use or play myself with printcore.printcore.queueindex but I saw you mentioned this in #1397. I saw an old issue #263 where @kliment mentioned !print self.p.queueindex as well.

from printrun.

DivingDuck avatar DivingDuck commented on June 26, 2024

I just run the rpc server it myself as I didn't use it in the past. I can see the following output:

On print:

{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG_ohneTemp.gcode', 'progress': 2.4973348391931687, 'eta': [7276.893032068913, 7471.893032068913, 4732], 'temps': {'T': ['23.7', '0.0'], 'T1': ['24.0', '0.0'], 'B': ['23.4', '0.0'], 'B1': ['22.8', '0.0']}, 'z': 0.6000000238418579}

On Pause:

>>> print(rpc.status())
{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG_ohneTemp.gcode', 'progress': None, 'eta': None, 'temps': {'T': ['23.7', '0.0'], 'T1': ['24.0', '0.0'], 'B': ['23.4', '0.0'], 'B1': ['22.8', '0.0']}, 'z': 0.800000011920929}

I can see that there are some quirks, like format of eta, z high not showing on first layer or when printing from SD do not show any information except temperature.

Here an example where I start a real print from start to manually pausing and then aborting the print:

Pay attention on my --> marks for understanding what happen during a print and where some wrong information occur.


>>> import xmlrpc.client
>>> rpc = xmlrpc.client.ServerProxy('http://localhost:7978')
>>> print(rpc.status()) --> after start heating the bed. Target as well as actual temp and z arn't updated what is actual a bad situation...
{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG.gcode', 'progress': 0.005805300767355211, 'eta': [6551.908890955335, 6551.908890955335, 11], 'temps': {'T': ['24.7', '0.0'], 'T1': ['24.4', '0.0'], 'B': ['23.9', '0.0'], 'B1': ['23.2', '0.0']}, 'z': 1.600000023841858}
>>> print(rpc.status())
{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG.gcode', 'progress': 0.005805300767355211, 'eta': [6551.908890955335, 6551.908890955335, 11], 'temps': {'T': ['24.7', '0.0'], 'T1': ['24.4', '0.0'], 'B': ['23.9', '0.0'], 'B1': ['23.2', '0.0']}, 'z': 1.600000023841858}
>>> print(rpc.status())
{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG.gcode', 'progress': 0.007388564612997541, 'eta': [6551.820835508195, 6713.820835508195, 14], 'temps': {'T': ['25.8', '0.0'], 'T1': ['24.3', '0.0'], 'B': ['81.0', '81.0'], 'B1': ['23.2', '0.0']}, 'z': 1.600000023841858}
>>> print(rpc.status()) --> after bed temp reached the target temp. Still wrong temps before and then only heater temp is shown while bed temp is at 81 °C, z isn't updated...
{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG.gcode', 'progress': 0.008444073843425761, 'eta': [6551.762131876768, 6719.762131876768, 16], 'temps': {'T': ['105.3', '240.0']}, 'z': 1.600000023841858}
>>> print(rpc.status())
{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG.gcode', 'progress': 0.008444073843425761, 'eta': [6551.762131876768, 6719.762131876768, 16], 'temps': {'T': ['151.3', '240.0']}, 'z': 1.600000023841858}
>>> print(rpc.status())
{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG.gcode', 'progress': 0.008444073843425761, 'eta': [6551.762131876768, 6719.762131876768, 16], 'temps': {'T': ['192.4', '240.0']}, 'z': 1.600000023841858}
>>> print(rpc.status())
{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG.gcode', 'progress': 0.008444073843425761, 'eta': [6551.762131876768, 6719.762131876768, 16], 'temps': {'T': ['219.7', '240.0']}, 'z': 1.600000023841858}
>>> print(rpc.status()) --> bed and heater reached target temp and started the print. z still not updated... 
{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG.gcode', 'progress': 0.031137522297632492, 'eta': [6550.500003801096, 6818.500003801096, 59], 'temps': {'T': ['245.2', '240.0'], 'T1': ['24.4', '0.0'], 'B': ['81.1', '81.0'], 'B1': ['23.4', '0.0']}, 'z': 1.600000023841858}
>>> print(rpc.status())
{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG.gcode', 'progress': 0.10396765919717968, 'eta': [6546.44945323266, 6826.44945323266, 197], 'temps': {'T': ['245.6', '240.0'], 'T1': ['24.4', '0.0'], 'B': ['81.1', '81.0'], 'B1': ['23.4', '0.0']}, 'z': 1.600000023841858}
>>> print(rpc.status())
{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG.gcode', 'progress': 0.2153238830073569, 'eta': [6540.256220117151, 6838.256220117151, 408], 'temps': {'T': ['238.9', '240.0'], 'T1': ['24.4', '0.0'], 'B': ['81.1', '81.0'], 'B1': ['23.4', '0.0']}, 'z': 1.600000023841858}
>>> print(rpc.status())
{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG.gcode', 'progress': 0.29712584836554395, 'eta': [6535.706688681589, 6846.706688681589, 563], 'temps': {'T': ['240.0', '240.0'], 'T1': ['24.4', '0.0'], 'B': ['81.1', '81.0'], 'B1': ['23.5', '0.0']}, 'z': 1.600000023841858}
>>> print(rpc.status())
{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG.gcode', 'progress': 0.42748123832342916, 'eta': [6528.456790200402, 6853.456790200402, 810], 'temps': {'T': ['240.3', '240.0'], 'T1': ['24.4', '0.0'], 'B': ['81.1', '81.0'], 'B1': ['23.5', '0.0']}, 'z': 1.600000023841858}
>>> print(rpc.status())
{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG.gcode', 'progress': 0.7995482420493767, 'eta': [6507.763760122521, 6843.763760122521, 1515], 'temps': {'T': ['239.9', '240.0'], 'T1': ['24.4', '0.0'], 'B': ['81.1', '81.0'], 'B1': ['23.5', '0.0']}, 'z': 1.600000023841858}
>>> print(rpc.status())
{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG.gcode', 'progress': 1.2291404988336623, 'eta': [6483.871382131888, 6832.871382131888, 2329], 'temps': {'T': ['240.1', '240.0'], 'T1': ['24.5', '0.0'], 'B': ['81.1', '81.0'], 'B1': ['23.6', '0.0']}, 'z': 1.600000023841858}
>>> print(rpc.status())
{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG.gcode', 'progress': 1.520461046431851, 'eta': [6467.669179858142, 6827.669179858142, 2881], 'temps': {'T': ['240.1', '240.0'], 'T1': ['24.4', '0.0'], 'B': ['81.1', '81.0'], 'B1': ['23.6', '0.0']}, 'z': 1.600000023841858}
>>> print(rpc.status())
{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG.gcode', 'progress': 1.697258842528578, 'eta': [6457.8363215941845, 6828.8363215941845, 3216], 'temps': {'T': ['240.1', '240.0'], 'T1': ['24.4', '0.0'], 'B': ['81.0', '81.0'], 'B1': ['23.6', '0.0']}, 'z': 1.600000023841858}
>>> print(rpc.status()) --> now print on on second layer started, z have now a valid z height...
{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG.gcode', 'progress': 1.904138651692509, 'eta': [23872.17801305205, 24254.17801305205, 3608], 'temps': {'T': ['240.0', '240.0'], 'T1': ['24.5', '0.0'], 'B': ['81.1', '81.0'], 'B1': ['23.6', '0.0']}, 'z': 0.4000000059604645}
>>> print(rpc.status())
{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG.gcode', 'progress': 1.966413696287774, 'eta': [23855.779328443175, 24249.779328443175, 3726], 'temps': {'T': ['239.9', '240.0'], 'T1': ['24.5', '0.0'], 'B': ['81.0', '81.0'], 'B1': ['23.7', '0.0']}, 'z': 0.4000000059604645}
>>> print(rpc.status()) --> now pausing the print:
{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG.gcode', 'progress': None, 'eta': None, 'temps': {'T': ['239.9', '240.0'], 'T1': ['24.4', '0.0'], 'B': ['81.0', '81.0'], 'B1': ['23.7', '0.0']}, 'z': 0.4000000059604645}
>>> print(rpc.status()) --> now stopping the print:
{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG.gcode', 'progress': None, 'eta': None, 'temps': {'T': ['239.9', '0.0'], 'T1': ['24.5', '0.0'], 'B': ['80.5', '0.0'], 'B1': ['23.8', '0.0']}, 'z': 0.6000000238418579}
>>> print(rpc.status())
{'filename': 'C:\\Users\\Armin\\Documents\\3D-Printer\\3D Modelle\\3DBenchy\\Armin\\3DBenchyHEVOPETG.gcode', 'progress': None, 'eta': None, 'temps': {'T': ['207.2', '0.0'], 'T1': ['24.5', '0.0'], 'B': ['75.5', '0.0'], 'B1': ['23.9', '0.0']}, 'z': 0.6000000238418579}
>>> 

There is real potential for improving the code of Pronterface / RPC server. Be careful with interpreting the shown information.

@rockstorm101, we should leaf this open as I have some concern with the behavior of RPC (see in details). The shown information need to be at least correct, especially for temp values.

from printrun.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.