THERE'S CODE!!
Saturday Night's alright for fighting, but it's also quite a good night for quietly releasing code...
I've uploaded the Arduino sketch
here
and the actual component
here
on github. All the required libraries are available via the Arduino Library Manager. You will need
Teensyduino
installed to compile & upload.
This
is a 'mock' linuxcnc interface so the pendant can be run attached to a PC that does not have LinuxCNC installed. Used primarily for UI dev. To run, from a command line in the mock directory: $ ./mock_cnc_machine.py mock.ini and it'll wake the pendant up.
I will add some documentation in the next few days but to add to LinuxCNC:
- Copy both Manualmatic.py (the class def) and manualmatic (the component) to your config directory (I know I said it would be only one file but keeping the class separate from the component allows me to mock it)
- Add the following line to custom.hal (replace gmoccapy.ini with your ini file name):
loadusr -W ./manualmatic gmoccapy.ini
- Start LinuxCNC, preferably from the command line (to see any errors).
- That's it!
The first time it runs, there will be a delay "Waiting for component 'manualmatic' to become ready" but it will connect eventually. After that it will always connect immediately. This might just be my Pi's USB...
EStop reset your machine - you can then turn it on with the 'On/Off' button on the pendant. Unfortunately you still have to home the machine on the main UI because I haven't worked out how to do that yet...
Once homed, you will have almost complete manual and auto control (all except loading the file) from the pendant. I haven't even looked at MDI.
I would really appreciate feedback - on both the C++ and Python (neither are my first language) and on my understanding of how LinuxCNC works (I only started late last year)... Please be gentle.
Can I do the happy dance now?