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

Using Remote API to call Gcode macro 'A0_TEST' actually calls 'A0' Macro #909

Open
QwermMakes opened this issue Oct 6, 2024 · 2 comments
Labels
not moonraker reported issue with other software

Comments

@QwermMakes
Copy link

QwermMakes commented Oct 6, 2024

What happened

When you make two gcode macros that both start include a number followed by an underscore (e.g. "A0_FOOBAR" & "A0") and call them using the remote api, calling A0 works as intended, but A0_FOOBAR causes the A0 macro to run.

I've tried a few different versions. Excluding the number before the underscore in the macro's name seems to work normally. For example, calling "BA_TEST" and "BA" both work as intended.

Client

Mainsail

Browser

Firefox, Other or N/A

How to reproduce

Create the following macros:

[gcode_macro B0]
gcode:
  M118 B0

[gcode_macro B0_TEST]
gcode:
  M118 B0_Test

Use the remote API by sending a http call to: http://[ServerURL]/printer/gcode/script?script=B0_TEST

The console will print B0 and not B0_Test.

Additional information

No response

@QwermMakes QwermMakes added the bug Something isn't working label Oct 6, 2024
@QwermMakes
Copy link
Author

I've messed around some more and found out that "B0", "B0_Test", and "B0Test" all call B0, even when inputted directly into the console. Seems to not be an API issue. Maybe just an issue with Klipper's G-Code macros?

@Arksine Arksine added not moonraker reported issue with other software and removed bug Something isn't working labels Oct 6, 2024
@Arksine
Copy link
Owner

Arksine commented Oct 6, 2024

Correct, this is not a Moonraker issue, nor is it a bug in Klipper. Its a limitation of extended gcode commands, they cannot begin with something that looks like a standard gcode command (ie: A letter followed by a number). So it cant be B0_TEST, but TEST_B0 would be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not moonraker reported issue with other software
Projects
None yet
Development

No branches or pull requests

2 participants