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

New module to synchronously, blocking send gcodes with return #1008

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

volconst
Copy link
Collaborator

@volconst volconst commented Jun 11, 2019

Implement the ping pong protocol - wait for 'ok' after each command, so no commands are lost with possibility to parse printer response specifically for each command. Related to #986 #959 #990 #965

… arrives

Possible race condition between readline raw_input and prompt writing
may leave garbage on command line. Used linux xterm fixed ANSI control
sequences instead of quering with curses, which could also result in garbage.
Are control sequences (also for color prompt) processed correctly in Windows?
Completes only current drive absolute and relative files. On Windows
user must enter drive letter without completion
by using do_print which provides checksum, threading, ok waiting.
Use adapted GCoder which does not preload data, but accumulates it till the end
@kliment
Copy link
Owner

kliment commented Jun 19, 2019

This is great, thanks for contributing it! Are you still working on it or should I merge it as is?

@volconst
Copy link
Collaborator Author

Hi @kliment
I have no experience with managing pull requests, even thought that they are fixed at creation time.
So I am open to advice should I open several pull requests at once and when to seek your attention.
I prepared PR #1009 which is single feature and complete, you can merge it.
Current PR #1008 turned to contain several unrelated changes and it's title is not relevant to all the commits. I think it should not be merged now, but we can discuss the commits here.

2572052 This commit is both a library and a sample for the ping pong protocol. I have based on it a console script for manual bed leveling, which moves nozzle with the arrow keys, but I am not sure if I will publish it.

7d001ae
I need feedback on this. Does it work on Windows? This is the most controversial commit. May put garbage on the command line, but I like the dynamic temp update. It is not good design to block in the main thread in readline raw_input and to update the prompt in the serial thread, but the default python readline library is not providing non blocking API. I think there should be loop select([serial, keyboard]) and then react accordingly. And maybe use curses.tparm(tigetstr("cup"), 5, 3) for the control sequences.
Thank you

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

Successfully merging this pull request may close these issues.

None yet

2 participants