iforce2d / linuxcnc-gcode-server Goto Github PK
View Code? Open in Web Editor NEWAllows connecting to a LinuxCNC installation and executing commands, similar to linuxcncrsh.
Allows connecting to a LinuxCNC installation and executing commands, similar to linuxcncrsh.
Figured I'd open this issue just to provide some feedback as I have a mostly working machine but I'm still trying to navigate my way through OpenPnP. I'm not really sure what all is an OpenPnP issue and what might be something that can be addressed with the server.
$ ./linuxcnc-gcode-server -i /home/justin/linuxcnc/configs/PnP_rev3.0/PnP.ini
Using ini file : /home/justin/linuxcnc/configs/PnP_rev3.0/PnP.ini
Using nml file : /usr/share/linuxcnc/linuxcnc.nml
Using subroutine path : /run/user/1000
libnml/os_intf/_shm.c 206: shmget(1001(0x3E9),8192,0) failed: (errno = 2): No such file or directory
libnml/os_intf/_shm.c 225: No shared memory buffer exists for this key and the IPC_CREAT was not given.
libnml/os_intf/_shm.c 413: rcs_shm_nattch: shmctl failed: Invalid argument
libnml/cms/cms_cfg.cc 829: cms_config: -4(CMS_NO_MASTER_ERROR: An error occurred because the master was not started.) Error occurred during SHMEM create.
libnml/nml/nml.cc 371: NML: cms_config returned -1.
**********************************************************
* Current Directory = /home/justin/git/linuxcnc-gcode-server
*
**********************************************************
* BufferName = emcCommand
* BufferType = 0
* ProcessName = xemc
* Configuration File = /usr/share/linuxcnc/linuxcnc.nml
* CMS Status = -4 (CMS_NO_MASTER_ERROR: An error occurred because the master was not started.)
* Recent errors repeated:
cms_config: -4(CMS_NO_MASTER_ERROR: An error occurred because the master was not started.) Error oc
NML: cms_config returned -1.
No shared memory buffer exists for this key and the IPC_CREAT was not given.
rcs_shm_nattch: shmctl failed: Invalid argument
* BufferLine: B emcCommand SHMEM localhost 8192 0 0 1 16 1001 TCP=5005 xdr queue confirm_write serial
* ProcessLine: P xemc emcCommand LOCAL localhost W 0 10.0 0 10
* Config File = /usr/share/linuxcnc/linuxcnc.nml
* error_type = 0 (NML_NO_ERROR)
************************************************************
libnml/os_intf/_shm.c 206: shmget(1002(0x3EA),20480,0) failed: (errno = 2): No such file or directory
libnml/os_intf/_shm.c 225: No shared memory buffer exists for this key and the IPC_CREAT was not given.
libnml/os_intf/_shm.c 413: rcs_shm_nattch: shmctl failed: Invalid argument
libnml/cms/cms_cfg.cc 829: cms_config: -4(CMS_NO_MASTER_ERROR: An error occurred because the master was not started.) Error occurred during SHMEM create.
libnml/nml/nml.cc 371: NML: cms_config returned -1.
**********************************************************
* BufferName = emcStatus
* BufferType = 0
* ProcessName = xemc
* Configuration File = /usr/share/linuxcnc/linuxcnc.nml
* CMS Status = -4 (CMS_NO_MASTER_ERROR: An error occurred because the master was not started.)
* Recent errors repeated:
rcs_shm_nattch: shmctl failed: Invalid argument
cms_config: -4(CMS_NO_MASTER_ERROR: An error occurred because the master was not started.) Error oc
NML: cms_config returned -1.
No shared memory buffer exists for this key and the IPC_CREAT was not given.
* BufferLine: B emcStatus SHMEM localhost 20480 0 0 2 16 1002 TCP=5005 xdr
* ProcessLine: P xemc emcStatus LOCAL localhost R 0 10.0 0 10
* Config File = /usr/share/linuxcnc/linuxcnc.nml
* error_type = 0 (NML_NO_ERROR)
************************************************************
can't connect to LinuxCNC
Another issue with homing might have to do with OpenPnP, I'm not sure what command OpenPnP is trying to send to pass the "home" command. In my testing all it does is set the axis coordinates to what the home coordinates are set to Machine Setup -> Axis -> Home Coordinates. So what I have had to do is power on inside LinuxCNC GUI (power button doesn't communicate either), Then Home-All in LinuxCNC and not move anything otherwise. As long as the LinuxCNC home positions in the ini match what OpenPnP are set to, they will be "synced" but it seems like kind of an anecdotal way to sync the axis.
I'm not sure what is possible when interfacing between LinuxCNC and OpenPnP, but I would think that OpenPnP's home button should just issue the home-all command, then once LinuxCNC returns "is-homed" OpenPnP should grab the current position but I'm not sure how well that plays with OpenPnP seeming to need to know all the home positions beforehand.
I have 2 nozzles, setup as A and B in LinuxCNC and OpenPnP.
I added the B nozzle to POSITION_REPORT_REGEX, GET_POSITION_COMMAND, and MOVE_TO_COMMAND by just copying the regex of A as it is in the examples.
After that I get this from OpenPnP.
If I just change POSITION_REPORT_REGEX from:
^ok X:(?<x>-?\d+\.\d+) Y:(?<y>-?\d+\.\d+) Z:(?<z>-?\d+\.\d+) A:(?<rotation>-?\d+\.\d+) B:(?<rotation>-?\d+\.\d+)
Back to:
^ok X:(?<x>-?\d+\.\d+) Y:(?<y>-?\d+\.\d+) Z:(?<z>-?\d+\.\d+) A:(?<rotation>-?\d+\.\d+)
........I can get through homing so I assume this is not the proper way to add B. What would the right regex for the 2nd nozzle be?
Trying to compile on Debian bookworm. I didn't write down the error but upon running $ make there was a complaint about "boost". Not sure which specific libboost package this is referring to so I installed libboost-all-dev and got past that error. Not sure if that's all that's required since I still haven't gotten through make, but that's a different issue.
Instructions say that running "make" is all that should be needed if LinuxCNC is compiled from source. Since 2.9 is available in the apt repo as linuxcnc-uspace-dev compiling from source isn't what most people are likely to do. I installed LinuxCNC from apt myself.
running make alone will fail:
$ make g++ -c -Wall -I. -I/usr/include -I/usr/include/linuxcnc -c -o obj/from_shcom.o from_shcom.cpp g++ -c -Wall -I. -I/usr/include -I/usr/include/linuxcnc -c -o obj/inifile.o inifile.cpp inifile.cpp:23:10: fatal error: config.h: No such file or directory 23 | #include "config.h" | ^~~~~~~~~~ compilation terminated. make: *** [Makefile:14: obj/inifile.o] Error 1
I believe config.h is typically generated from running ./configure?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.