I want to execute a script on the pi when a certain string appears in Terminal
specifically, I am embedding M118 "message" in the g-code
I want to detect "message" and run a script
** what I've done so far**
M118 part embedded in g-code
Terminal Response successfully "sees" the M118 reply and runs the command
what's wrong with that
it's simply sending the script back to the printer!
Send: N1 M118 LEDs red103
Recv: LEDs red
Send: ~/scripts/SetLeds 1 0 0
Changing monitoring state from "Starting" to "Printing"
Send: N2 M140 S60*81
Recv: echo:Unknown command: "~/scripts/SetLeds 1 0 0"
you can see my M118, and the expected echo
then you can see the script sent to the printer, instead of the pi!
Terminal Response setup
regex: LEDs red
Command: ~/scripts/SetLeds 1 0 0
Raspberry pi 3B
so what did I do wrong?!