Intro: Flash All Your GRBL Config Settings at Once.
Here's a quick way to flash all GRBL configuration settings to your Arduino (Mega or Uno) without having to enter them individually in a gcoder sender, ie $10=3 on the command line.
I had been playing around with many gcode senders and my "lets push this" habit got my Mega 2560 erased quite a few times, thus was born the need for a quick fix.
Im pretty sure the culprit was 3dpburner, I was struggling to get it to connect to the arduino and pushed everything in sight. :)
Step 1: Software Requirements.
You'll need some software to get things to work properly:
- Python V2.7 (its an older version because the script was written in an older version and tosses out an error if you use python 3.)
- Simple_stream.py this is the script which gets the job done.
- grbl.gcode this file contains the settings that simple stream sends to the arduino.
- Pyserial, a module called by simple stream.
- Pytime, also a called module.
Pyserial is available here, https://pypi.org/project/pyserial/#history
Simple stream is available on Github here. https://github.com/grbl/grbl/blob/master/doc/scrip...
You can also copy the 66 lines of code there and paste it into a text file using Notepad, which you then rename to simple stream.py.
Pytime is here. https://pypi.org/project/pytime/#files
For convenience I've attached the script and its called modules as well as a default grbl.gcode which can be edited to your liking.
Step 2: Editing Simple Stream.py
The default script wont work on your PC unless you use the default port string "/dev/tty.usbmodem1811".
For my windows pc it needs some editing on the port search string to COM6, this must be done using a text editor like notepad++ to retain the code formatting.
At this point you can also change the baud rate if need be.
As per the screenshots I hadnt yet installed the needed modules.
Step 3: Installing the Modules.
As can be seen, I just extracted the files into the C:\Python27\Lib folder, although there are probably better ways to do it, but my pc didnt respond to "pip install".
Pytime was a simple root folder extract and for pyserial, I extracted the serial folder only, into the lib folder.
Step 4: Lets Try Again.
Now with all dependencies loaded we should have an error free run.
Both simple stream and grbl.gcode need to be in the same folder, which can be anywhere, mine are in D:\Temp in this example.
Also make sure your arduino is connected.
Step 5: One More Example.
Here Im using a gcode sender to interrogate my board.
Its also how you edit config settings the old way , one by one.
Meanwhile, back in the grbl.gcode file, I've changed the Z axis travel speed to 777, its easy to note and makes me feel like a winner. :)
After a script run with no errors, we open up gcoder sender again to interrogate the board.
Lo and behold $112 is now equal to 777.
Step 6: GRBL.code Content Format.
For what its worth, you can either use bare config strings or with all the comments added because GRBL ignores the bracket contents anyway.