Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting coordinates with M114 with printrun #1188

Closed
comes04 opened this issue Apr 26, 2021 · 3 comments
Closed

getting coordinates with M114 with printrun #1188

comes04 opened this issue Apr 26, 2021 · 3 comments

Comments

@comes04
Copy link

comes04 commented Apr 26, 2021

Hi there,

¿Can someone let me know how to send the command M114 and get the data that returns with printrun?

I know that this is a topic that has been around many timesbut I can't figure out how to get it.

For example, i get the return from command M105 with the following and works perfectly:

p.send_now("M105")
def temp_callback(line):
	print(line)
p.tempcb = temp_callback

I tried the same with M114 but doesn't work since that command send the info to the serial...

I also have seen the “New module to synchronously, blocking send gcodes with return” which seems to be able to help on this, but i'm not able to use it.

Also tried to send M114 and read it with the “Serial” library, which works. However i would like to do it just with the printrun library since in order to use “Serial” I have to disconnect “printrun” …

Thanks again for all the help :)

@volconst
Copy link
Collaborator

@comes04 Why you can't use #1008 ?

@volconst
Copy link
Collaborator

volconst commented Apr 27, 2021

You can use:

def recv_callback(line):
	print('got', line)
p.recvcb = recv_callback

p.send_now("M114")

It receives all responses and you have to test which of them is M114.

@comes04
Copy link
Author

comes04 commented Apr 29, 2021

Hi volconst,
I tried that and is working great.
Thanks for all your time and help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants