How to use grblHAL simulator for testing

I often use a spare Arduino with grbl on it for testing and answering questions about gSender without having to go to my CNC computer. Then along came grblHAL and threw a wrench into things.

I recently discovered that you can use the grblHAL Web Builder to create a grblHAL simulator and connect gSender to that. Build the simulator by selecting Simulator in the Driver field and Linux or Windows in the board field. Didn’t see any Mac option. Using the ‘Generate and download firmware’ button will download ‘firmware.zip’.

I’m on Linux and unzipping firmware.zip gave me two executable files, grblHAL_sim and grblHAL_validor. On Windows I’m guessing they will have .exe added to the name.

These programs are meant to be used from the command line. In order to connect gSender to grblHAL sim it needs to be started with ‘p 23’ as an option. On Linux that’s ‘path_to_executable -p 23’ and I think PowerShell is the same. With cmd it might be something like ‘start path_to_executable /p 23’ but I’m not sure. If you run the simulator without any options you get the equivalent of the Console tab in gSender and you won’t be able to connect gSender to it.

In order to connect gSender to the simulator you need to put your computers local IP address in the Ethernet section of Config in gSender. The ‘ipconfig’ command should work on Windows and ‘ifconfig’ or ‘ip addr show’ on Linux to find your local IP address.

After the simulator is running and your IP address is set up in gSender you should be able to connect with the simulator. It will show up as an Ethernet device.

2 Likes

I’ll give it a try on my Windows system when I get a chance and report back.

1 Like

Since my OP I’ve learned a couple of things I’d like to share.

One of my reasons for trying the simulator was because gSender’s UI changes depending on if it’s connected to grbl or grblHAL. An example pertaining to the Vortex is mentioned here. Unfortunately it doesn’t seem like a 4th axis can be used with the simulator yet.

The repository for the simulator can be found on GitHub and the developer says it’s a work in progress and a ‘proof of concept’. It might get better over time.

The other major difference is that, as far as I can tell, the SLB and SLB EXT boards are running a fork of grblHAL called SienciHAL. I’m basing that on the Firmware & Flashing resource page for the SLB showing a version number that matches one on the SienciHAL repo. Sienci states, in the SienciHAL README that it is purposefully not under active development. The plan is to eventually switch to grblHAL once all the progress that Sienci has made is incorporated into grblHAL.

I wanted to make sure that anyone that tries the simulator is aware of these differences. It’s not perfect but short of having an extra SLB laying around it’s the best testing solution I’ve found.

I should also mention that the simulator has, like many command line programs, a -h option that prints the help describing the options available when starting the program. Just a FYI because I know not everyone is used to command line programs.