GPIO AirAssist

Hi, I’d like to trigger AirAssist from laserweb through the gpio of my raspberry as my laser cutter doesn’t deal with it.
The idea would be to trigger a script on AirAssist ON/OFF instead of GCODE.
I’m willing to develop and submit this feature but I don’t really see where the air assist is being triggered in the server. Is everything managed from the webapp ?
Any advice ?

It is sort-of possible… But that doesnt necessarily mean it is easy… You would need to do it in the lw.comm-server backend, not in the web UI.

Currently the Air-assist gcode is simply passed along to the controller; which needs to trigger the correct action (toggle the correct control) at the correct moment in the gcode execution.

In theory the comm-server could intercept the air-assist command when it is running the job and wiggle a gpio pin instead of passing along the command to the device.
In the UI the gcode sent for air assist on/off can be edited in the settings, so you could put in a placeholder comment, rather then an active gcode command.

But… there is a major issue… timing.

  • The server passes the commands to the controller, which has an internal buffer (usually 15 commands for grbl)
  • The server only knows which commands it has requested to be sent over the serial port, it does not know for sure which actual command is being executed at any moment.
  • This means that the air assist on/off could be considerably advanced from the actual cutting commands. Potentially shutting off well before the laser has finished it’s final cutting moves.

It is best to solve this by somehow adapting your controller to control the assist line itself. If you cant free a control pin maybe simply connecting it to the main laser enable would work (so long as you remember to turn it down when engraving).

Alternatively; simply adapting the server to turn the Assist on immediately when it starts to stream out a job and then turn it off a fixed time period after the last command is sent might be suitable, it depends on how fancy a solution you need. You could inspect the machine status after sending the last command and wait for it to come to a halt as an alternative ‘off’ mechanism, for instance.

Note; dont take chances with air assist… one of it’s uses is to cool and prevent the work burning and possibly catching fire as you lower the speed to increase the cut depth; having it turn off prematurely could be costly in unpleasant ways.


Thanks for your feedback. I’ll investigate further ans let toi know.

There is a feature in lw.comm-server to execute commandline scripts on job start, on job finish and on job abort. In this scripts you can do the GPIO output or whatever you want. The configuration is done in config.js by entering the commandline in the corresponding line:

config.jobOnStart = '';
config.jobOnFinish = '';
config.jobOnAbort = '';

This can also be used for showing the operation state of the machine with a lamp (or a Webservice).