terjeio / ioSender

A GCode Sender for Grbl and grblHAL written in C# (Windows only).
BSD 3-Clause "New" or "Revised" License
207 stars 65 forks source link

Make own G-Code sender #371

Closed timeO25 closed 1 week ago

timeO25 commented 2 months ago

Hello, can someone help me I would like to write my own G-Code sender with Java and don‘t know how to connect my via Ethernet with the Teensy 4.1. Would be create if someone can show me an Java code example. Thank you very much.

imechura commented 2 months ago

I would suspect that you will need an ethernet module for the board. Then you will need to hook the boards ethernet adapter and the computer to an ethernet switch.

This is borrowed from another site: "You edit the my_machine.h configuration file, uncomment the Ethernet define statement, rebuild and upload the firmware to the Teensy. "

Once you can ping back and forth then it should just be a matter of standard Java network programming. It looks like GRBLHal supports HTTP so something like Apache HTTPClient will make it easy to send commands and poll for reports.

terjeio commented 2 months ago

It looks like GRBLHal supports HTTP

True, but request handlers has to be added to make use of the HTTP protocol. Currently only the WebUI backend code does so, and it has its own custom protocol on top of HTTP and WebSockets. The (raw) telnet and WebSocket protocols are better alternatives since they replaces the serial stream on connect and thus do not need any additional code in the controller.