Using a gamepad/joystick to for Jogging

HI folks,

Still new but enjoying the snot outa LB :slight_smile:

I’d like to make use of a BlueTooth HID controller - old PS3 sixaxis or Wii nunchuck via AntiMicroX - to help with the basic alignment & control aspects of my jobs so that I’m present at the machine rather than dividing my attentions.
Looks like the one machine I’m controlling is Ruida-based, so cannot inject G-code (according to docs), though the other I’m refurbishing is GRBL.

Is there a way I can do basic controlling of my machine? I’ve tried remapping via AntiMicroX gamepad events to keystrokes sent to the GUI, but it’s suuuper fiddly & not great.

I’m running LB on a super-basic Linux/Ubuntu host, and noticed it has a plugins directory containing subs for:
audio iconengines mediaservice platforms xcbglintegrations bearer imageformats platforminputcontexts printsupport
Each containing a bunch of *.so library files.

I see the LB binary firing up a localhost:19840 UDP socket, but cannot find additional info on this ‘API’.
I’m assuming this is the same as the #pi-bridge image, as it (presumably) stands up a socket that LB talks to, so I should be able to simply pass it similar or emulated commands?

From the CLI I can see corresponding “DGRec:” output to my nc -u localhost 19840 / socat UDP:localhost:19840 input, but no corresponding actions or meaningful response in socat UDP-RECV:19841 STDOUT

Is there a way I can build/load a plugin to LB to facilitate this?
Even a Python library to handle this more gracefully would be awesome.

There’s no API or plugin mechanism into LightBurn today although there has been some talk about making such a thing available at some point in the future.

You could look at creating a keyboard based controller device and using keyboard shortcuts to control this.

Note that there are 2 different types of keyboards shortcuts for moving:

  1. global shortcuts for jogging
  2. numeric key based shortcuts when Move has focus. Numeric keys will allow for more fine controls and even possibly continuous jogging

Take a look at this Topic for more information on this approach:

Alternatively, for Ruida controllers you could look at reverse engineering the communication protocol or using one of the available documentation efforts to directly interface with the Ruida.

Note that there are mobile apps that allow you to do this today, including an official one from Ruida.

Not sure if this will help or not, but you could look at Universal Gcode Sender (UGS) for how it handles using an X-box controller for jogging with Gcode.

Thanks for the feedback folks.

API or py-lib would make sense, as the Bridge effectively is a client-server model & is a relatively “simple” thing to enable. Even just expanding on the commands over UDP in listed elsewhere is a huge improvement.

I’ve mapped the values in the hotkeys to the gamepad using AntiMicroX, but the latency or accidentally being in another app (eg. dialog popping up) makes this a risky move.

@Wyked - running a Ruida on one machine, so Gcode/GCS is no-go.

Trying to dig up some Ruida controller/driver code to see if it recognises USB-HID inputs, such as a numpad. If so, I can build a Arduino/ESP to translate actions.

See if this blows your skirt up

Good luck

:smile_cat:

1 Like

awesome!

Gonna give it a go tomorrow & report back!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.