iforce2d / linuxcnc-gcode-server

Allows connecting to a LinuxCNC installation and executing commands, similar to linuxcncrsh.
23 stars 6 forks source link

Gcode Driver regex for 2 nozzles? #4

Closed ShadeTechnik closed 1 year ago

ShadeTechnik commented 1 year ago

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. Screenshot_20230815_012226 Screenshot_20230815_013257

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?

iforce2d commented 1 year ago

As the error says, 'rotation' was already defined. I think if you change the last part to the name of the new axis you created it should be ok. For example:

Selection_1324

... would match this:

B:(?<B>-?\d+\.\d+)

However, your next problem will be that this server currently only outputs four axes in the position report. I will have to change that to have it match whatever the ini file defines.

iforce2d commented 1 year ago

I updated this to output the position of all axes as defined in the .ini file for status/m114 commands.