The easiest thing to do would be to do this beforehand.

There is no conditional checking available within an ini file, since this file
is read by other programs and does not of itself do anything.

Run from a script and check for the existence of the joystick device, then
launch the relevant config.

eg.  launch.sh

# !/bin/bash

if [ -f /dev/input/js0] ; then
    machinekit ~/configs/myconfig/my-config-with-js.ini
else
    machinekit ~/configs/myconfig/my-config-without-js.ini
fi

On 01/10/18 17:05, Paulo Sherring wrote:
Hey there! I am new to machinekit / linuxcnc and I have a question I couldn't find an answer. I have a joystick pluged in a BeagleBone Green and I use it to control a CNC router. The fact is that sometimes, I may have to use the machine without the controller - maybe its mal functioning or something of this sort.
Currently, I am loading a hal file that specifically sets up the relations between the buttons and the jog signals on my INI file, something like:
HALFILE = joystick.hal
What I need is to run some kind of check on my ini file to load it or not, something like
if [ -f /dev/input/js0]
then
HALFILE = joystick.hal
fi

Obviously, this could also be inside the hal file itself, but, I also don't know how to do it :(
Thanks in advance!
Paulo Sherring.
--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
---
You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to machinekit+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
---
You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to machinekit+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to