Flash All Your GRBL Config Settings at Once.

by petercd in Workshop > CNC

6031 Views, 16 Favorites, 0 Comments

Flash All Your GRBL Config Settings at Once.

Clipboard011.jpg
culprit.jpg

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. :)

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.

It contains the default settings from the GRBL wiki, so dont use them on your machine as is.

Editing Simple Stream.py

Clipboard06.jpg
Clipboard05.jpg
Clipboard07.jpg
serial time error.jpg
port check.jpg

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.

Installing the Modules.

clear run.jpg
pyserial install.jpg

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.

Lets Try Again.

Clipboard01.jpg
Clipboard02.jpg

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.

One More Example.

Clipboard09.jpg
Clipboard08.jpg
Clipboard010.jpg

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.

GRBL.code Content Format.

Clipboard04.jpg
alternate grbl notation.jpg

For what its worth, you can either use bare config strings or with all the comments added because GRBL ignores the bracket contents anyway.