Interface to LightBurn (is pylib a better choice).
14 Nov 2024 22:10 #314495
by jtrantow
Interface to LightBurn (is pylib a better choice). was created by jtrantow
LightBurn(Commercial Laser Software) has functionality to generate LinuxCNC gode. It also has an interface that can home, frame, jog, frame, load programs, run programs etc. This UI works very well for laser cutting and it can communicate using serial over TCP.Recently, LightBurn added a "custom g-code device" that allows you to configure much of the gcode. With some help from the LightBurn forum I have a custom gcode device that can communicate with linuxcncrsh.
I have written a small C++ program that acts as a TCP server to LightBurn and as a client to linuxcncrsh. I have the basics working where I pass the majority of gcode commands through using the "set MDI <gcode command>" and special case a few commands *M114" to run linuxcncrsh get commands to fill in responses sent back to LightBurn.
Working with linuxcncrsh I'm seeing a few problems. github.com/LinuxCNC/linuxcnc/issues/3180
This isn't a deal breaker for what I'm trying to do, but going through some of the unit tests, I noticed tests/toolchanger/test-ui.py uses python as the ui. I'm wondering if python might be a better option???
Is the python interface more complete/better supported than linuxcncrsh?
I'm assuming opening the sockets and translating some strings wouldn't be a problem?
linuxcncrsh documentation indicates it can run in conjunction with another UI. (not sure if this is true in practice?)
Can a python interface run at the same time as another(GMOCCAPY) ui?
I'm trying to decide whether to continue on with linuxcncrsh or start over with python.
I have written a small C++ program that acts as a TCP server to LightBurn and as a client to linuxcncrsh. I have the basics working where I pass the majority of gcode commands through using the "set MDI <gcode command>" and special case a few commands *M114" to run linuxcncrsh get commands to fill in responses sent back to LightBurn.
Working with linuxcncrsh I'm seeing a few problems. github.com/LinuxCNC/linuxcnc/issues/3180
This isn't a deal breaker for what I'm trying to do, but going through some of the unit tests, I noticed tests/toolchanger/test-ui.py uses python as the ui. I'm wondering if python might be a better option???
Is the python interface more complete/better supported than linuxcncrsh?
I'm assuming opening the sockets and translating some strings wouldn't be a problem?
linuxcncrsh documentation indicates it can run in conjunction with another UI. (not sure if this is true in practice?)
Can a python interface run at the same time as another(GMOCCAPY) ui?
I'm trying to decide whether to continue on with linuxcncrsh or start over with python.
Please Log in or Create an account to join the conversation.
15 Nov 2024 17:36 #314543
by Aciera
Replied by Aciera on topic Interface to LightBurn (is pylib a better choice).
The python interface is the solution of choice for GUI development and easier to get support. linuxcncrsh is a bit of an exotic solution that few users have experience with.
You can run multiple python scripts that interface with the python API but you need to be aware that having more than one interface sending commands to linuxcnc can lead to race conditions, particularly when sending MDI commands (This is independent of what languages those interfaces use though).
With python you also need to be careful as one python script can block all the others (eg if you wait for an MDI command to finish execution) which can lead to problems like these :
github.com/LinuxCNC/linuxcnc/issues/3120
github.com/LinuxCNC/linuxcnc/issues/3129
You can run multiple python scripts that interface with the python API but you need to be aware that having more than one interface sending commands to linuxcnc can lead to race conditions, particularly when sending MDI commands (This is independent of what languages those interfaces use though).
With python you also need to be careful as one python script can block all the others (eg if you wait for an MDI command to finish execution) which can lead to problems like these :
github.com/LinuxCNC/linuxcnc/issues/3120
github.com/LinuxCNC/linuxcnc/issues/3129
Please Log in or Create an account to join the conversation.
16 Nov 2024 20:20 #314620
by jtrantow
Replied by jtrantow on topic Interface to LightBurn (is pylib a better choice).
Thanks, that's consistent with what I'm slowly deciding. (Old dog reluctant to tackle learning python.) I have Lightburn talking to LaserSpoof
LightBurn <----(serial/TCP) ---> LaserSpoof application <--->linuxcncrsh controlling Linuxcnc.
I will take a look at rewriting this as a python (non-GUI) interface. Once I have that working, I will consider adding it to gmoccapy, which is what I normally use but never got into the python code. My immediate goal is the non-GUI interface as the impetus for this effort is to leverage the LightBurn UI when I have the laser module mounted on my router.
LightBurn <----(serial/TCP) ---> LaserSpoof application <--->linuxcncrsh controlling Linuxcnc.
I will take a look at rewriting this as a python (non-GUI) interface. Once I have that working, I will consider adding it to gmoccapy, which is what I normally use but never got into the python code. My immediate goal is the non-GUI interface as the impetus for this effort is to leverage the LightBurn UI when I have the laser module mounted on my router.
Please Log in or Create an account to join the conversation.
Time to create page: 0.066 seconds