Skip to main content

grblhub: a command line tool to handle grbl code.

Project description

grblhub

Grblhub is a command line based tool to handle grbl code.

It features full control of the grbl v1.1 device and supports realtime direct commands and buffered streaming of commands and programs.
Grbl state is in line viewable, showing (all) machine states i.e. Idle, Run, Hold, Jog, Alarm, Door, Check, Home, Sleep in color. State also includes current buffered (pending) gcode blocks (and no scrolling ok's)
Grbl v1.1 error and Alarm code definitions are shown when they occur. Spindle and Feed settings can be updated realtime while gcode (G1) is running; gcode programs can be loaded and run with specific Spindle and Feed settings.
Gcode loops are simulated (using a very simple WHILE DO syntax that must be annotated within the gcode) and can be run separately and (be) iterated at will. Soft and hard-resets can be issued and Ctrl-D makes a full stop (to machine state Door). This makes it easy to laser draw and cut without the need to (re)connect the device, so drawings and cuts have full (relative) machine precision.

Grblhub is tested on several platforms - arm64/intel - and operating systems - Linux/macosx and two grbl v1.1 devices (a lasercutter and a CNC router)

Information on grbl commands: https://github.com/gnea/grbl/blob/master/doc/markdown/commands.md

Note that image2gcode and svg2gcode can be used to convert images and vector graphics to gcode at the highest quality. gcode2image can be used to validate these conversions and verify the layout before using grblhud to send the code to your lasercutter or cnc machine. https://github.com/johannesnoordanus?tab=repositories

WHILE DO syntax:

    # Gcode:
    #    #100 = 1
    #    WHILE [#100 LE 5] DO1
    #    (Some G-Code Blocks Go Here to Be Repeated Each Loop)
    #    #100 = #100 + 1 (Increase #100 by 1 each iteration of the loop)
    #    END1
    
    # Simulate gcode WHILE DO instructions (above) like this:
    #    ; WHILE <count> <loopname>'    example: '; WHILE 23 aloop123'
    #    (Some G-Code Blocks Go Here to Be Repeated Each Loop)
    #    ; DO <loopname>'               example: '; DO aloop123'
    #
    # Note that this is an annotation (quoted out so the grbl controller does not see it)
    # Note also that loopnames are all lowercase! And have a number (if any) at the end:
    # in regex '[a-z]+[0-9]*'

Installation note:

	- pyserial must be installed first ('pip install pyserial')
	- inputimeout must be installed ('pip install inputimeout')
	- pip install grblhud

	To install additional tools:
	- pip install image2gcode
	- pip install svg2gcode
	- pip install gcode2image 

Grblhud help:

    $ ./grblhud.py --help
    usage: grblhud.py [-h] [--serialdevice /dev/<serial-tty-name>] [--status /dev/<terminal-tty-name>]

    Stream g-code using grbl's serial read buffer.

    options:
      -h, --help            show this help message and exit
      --serialdevice /dev/<serial-tty-name>
                            serial device on linux (default: /dev/ttyUSB0 115200 baud)
      --status /dev/<terminal-tty-name>, -s /dev/<terminal-tty-name>
                            grbl status output (default: no output)

Example run:

>
> grblhud
Opened serial port /dev/ttyUSB0 at 115200 bauds (bits/s)
Initializing grbl...

Status report every 0.1 seconds
Start command queue
[     XYZ:00.000,00.000,00.000 FS:0,0] grbl> Grbl 1.1h ['$' for help]
0|[Idle XYZ:00.000,00.000,00.000 FS:0,0] grbl> help
Type one of the following commands:
   (<Ctrl><D>) or FSTOP                              (FULL STOP to continue: softreset)

 - cls                                               (clear screen)
 - load <filename>                                   (load file to buffer)
 - run [LOOP] <(file/loop)name> [F<eed>] [S<peed>]   (run from buffer)
 - S+10, S+1, S-10, S-1                              (Speed up/down 10% 1%)
 - F+10, F+1, F-10, F-1                              (Feed up/down 10% 1%)
 - softstop                                          (purge command buffer, but let machine buffer run till empty)
 - softreset                                         (Issue soft reset command)
 - hardreset                                         (Hard reset: close/open serial port)
 - sleep                                             ($SLP command)
 - dryrun                                            ($C check mode)
 - Stoggle                                           (S toggle, in 'Hold' state only)
 - setting [<nr>]                                    (get setting for specific <nr>)
 - grbl/gcode (direct) command:
     -- '!' feed hold, 
     -- '~' start/resume, 
     -- '?' status, 
     -- 'ctrl-x' or 'command + x' soft reset!
0|[Idle XYZ:00.000,00.000,00.000 FS:0,0] grbl> 

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grblhud-1.0.1.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grblhud-1.0.1-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file grblhud-1.0.1.tar.gz.

File metadata

  • Download URL: grblhud-1.0.1.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.2

File hashes

Hashes for grblhud-1.0.1.tar.gz
Algorithm Hash digest
SHA256 58b3e8ececdc870acd7f0a2237cf157c8a62be013754d30932e4ab6d16b46037
MD5 7a503a6f14123f6f8c812fb9c1371d71
BLAKE2b-256 dca4af9c68098a83b8f9d07ff18a30b7f1d9c8e6c3d8267b62119af859096b3c

See more details on using hashes here.

File details

Details for the file grblhud-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: grblhud-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.2

File hashes

Hashes for grblhud-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3ee484eba61dd76b76637506f7634810939588d9ca2d20ec2d6457e4030abf28
MD5 9235697442544f29d6433be9b0718f8d
BLAKE2b-256 1e740d253bf78438ec9970065ee26959d1134690b4b39101af349d9028e19e17

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page