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

Feature: GCODE stream from telnet or websocket or serial #1012

Open
kshitijgarg2609 opened this issue Sep 4, 2023 · 5 comments
Open

Feature: GCODE stream from telnet or websocket or serial #1012

kshitijgarg2609 opened this issue Sep 4, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@kshitijgarg2609
Copy link

Machine Context

I am trying to make desktop application in java swing, used telnet and websocket protocol. I have send .nc file line by line and I am getting ok but sometimes late ok reply and I also found one more thing that streaming line by line GCODES in IDLE mode gives inaccuracy.

Feature Description

simply just need one example for sending gcode line by line and result in acuracy.

Other Approaches

I can see the starting nc file from SD works fine but want to know how it works the same command stream I want to do via telnet or serial or websocket

How I Can Help

I am trying to stream gcode in after typing $X but getting errors, but this mode IDLE, I came to know the state by typing '?' so how to get output like this <RUN|Wpos and proper way of streaming gcode. Or I missed any documentation. Please do help me for this.

@kshitijgarg2609 kshitijgarg2609 added the enhancement New feature or request label Sep 4, 2023
@breiler
Copy link
Contributor

breiler commented Sep 4, 2023

I also found one more thing that streaming line by line GCODES in IDLE mode gives inaccuracy.

What do you mean by inaccuracy?

First you need to read about the GRBL streaming protocol:
https://github.com/gnea/grbl/wiki/Grbl-v1.1-Interface#writing-an-interface-for-grbl

There are plenty of senders that does this, I suggest that you look at them. For Java specifically you can look at UGS. There are a couple of layers with their own thread workers and can be quite complex to follow. But here are the key components:

@kshitijgarg2609
Copy link
Author

There is no inaccuracy in fluidnc, inaccuracy is occuring when I am streaming commands over telnet protocol or websocket protocol. My motive is to stream .nc file instead of uploading. First I am sending $X to unlock then sending command line by line, sending one command and getting ok as response but I am sending next line only if I am receiving ok response. I just that whether this is the only way to stream or any document I missed.

@breiler
Copy link
Contributor

breiler commented Sep 4, 2023

Did you read the link describing the GRBL streaming protocol?
https://github.com/gnea/grbl/wiki/Grbl-v1.1-Interface#writing-an-interface-for-grbl

Is there a reason that you don't want to use an existing sender?
http://wiki.fluidnc.com/en/support/gcode_senders

@crxksa
Copy link

crxksa commented Sep 8, 2023

There is no inaccuracy in fluidnc, inaccuracy is occuring when I am streaming commands over telnet protocol or websocket protocol. My motive is to stream .nc file instead of uploading. First I am sending $X to unlock then sending command line by line, sending one command and getting ok as response but I am sending next line only if I am receiving ok response. I just that whether this is the only way to stream or any document I missed.

code you post the jave code here

@MitchBradley
Copy link
Collaborator

The java code is in the UGS repository. Search for "ugs github" to find it.

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

No branches or pull requests

4 participants