tchepperz / ArdSketch

Arduino Sketches
18 stars 4 forks source link

How to send input to the mega? #2

Closed karltinsly closed 7 years ago

karltinsly commented 7 years ago

Hi Pierre,

Thank you for this sketch - I've been looking for exactly this! I have everything hooked up correctly, I believe. When I plug in the mega, I see in the serial monitor:

SD card OK. . . Enter name for a gcode file on SD:

I tried entering a file name in the monitor and clicking Send, but nothing seems to happen. I wanted to check and make sure that is the correct way to send input to the mega.

Thanks again!

Karl Tinsley

tchepperz commented 7 years ago

Hi Karl, Have you got a callback such as : file doesn't exists or file opened ?

karltinsly commented 7 years ago

Hi Pierre,

No, that's what I was expecting, but nothing at all happens. I enter the filename in the serial monitor and send, but no response. The RX light on the mega flashes briefly. The filename is 0001.g. I have also tried a non-existent filename.

karltinsly commented 7 years ago

Hi Pierre,

Right after I sent that last comment, I changed the serial monitor terminator to Newline, and that worked! Each line of the file was printed in the serial monitor, followed by error:9. Progress! The CNC machine did not move, but at least the mega responded. What does error:9 refer to? I see in the sketch that it should be the response from GRBL.

karltinsly commented 7 years ago

Once again, given enough reflection on my own, I think I've made some more progress. Error 9 is "G-code locked out during alarm or jog state", which makes sense, since I had just restarted the uno after hooking everything up. When I get home, I will try sending a $H before sending the file. Thanks for your time - I'll post back with my results tonight.

karltinsly commented 7 years ago

Pierre, It's working great now. All my problems were just my not understanding what was going on. Thanks again for this great utility!

Karl

tchepperz commented 7 years ago

Glad you enjoy it ! Have a nice milling..