I’m trying to develop some G-Code macros and have two problems.
First, when I get syntax errors, the little pop-up dialogs in the web UI give an error message, but not a line number. I can’t seem to find any log files on the beaglebone that have the information with a line number either.
When I tried to fire up the linuxcnc web interface to turn on additional logging using the “Linux CNC Server Web Configuration”, which I’ve done before but have since gotten a replacement beaglebone, it now asks for a username and password that I don’t know. Is that available anywhere?
The username and password are both default. I’m not sure that you’ll find anything that will help debug your issue there, though. A couple options for you:
Use the simulator at https://sim.pocketnc.com. It doesn’t support O codes or variables, unfortunately, so it may not be suitable for your use case.
If you ssh to the Pocket NC (pocketnc/pocketnc for credentials), you can use the
rs274 executable to interpret your G code. While it still doesn’t give line numbers, it does show you the line that has issues. Something like this:
rs274 -t ~/pocketnc/Settings/tool.tbl -v ~/pocketnc/Settings/pru-stepper.var ~/ncfiles/yourprogram.ngc
-t ~/pocketnc/Settings/tool.tbl option provides your tool table settings and the
-v ~/pocketnc/Settings/pru-stepper.var provides the G code variable table, so any offsets that you have set on your machine. The last argument is the file you want to interpret, which will be under ~/ncfiles if you used the web UI to upload it. You’ll be prompted to select a number:
enter a number:
1 = start interpreting
2 = choose parameter file ...
3 = read tool file ...
4 = turn block delete switch ON
5 = adjust error handling...
Type 1 to start interpreting and it should give you information about where any issues are.
At the moment I’m developing a subroutine, which I’ve been testing by using
O<routine-file-name> CALL [arg1] [arg2] in the MDI box. I made a simple one line .ngc file which invokes the subroutine call, but
rs274 doesn’t seem to know how to resolve named subroutines the same way as the MDI box does. It just reports
Unknown control command in o word.
Any ideas on how to get it resolving the names properly? Can I somehow pass it the
~/pocketnc/Settings/PocketNC.ini which defines the subroutine path? (I tried just running it from the subroutine directory, but that didn’t seem to work either).
Using the -i argument should work.
You can also get the usage using
Great, I’m in business now between the
-i flag and fixing a syntax error in my one line wrapper . Now I’m getting an actual execution trace, which makes the errors actually usable.