Is there any simple MK approach to a remote UI?

117 views
Skip to first unread message

justin White

unread,
Dec 4, 2019, 9:17:42 PM12/4/19
to Machinekit
Every once in a while I sit down and try to get something going in QT creator for remaking  My project machine LinuxCNC GUI to QT for use with a remote instance of Machinekit. Right now this machine runs LinuxCNC with a mesa 7i96, and it works just fine, however my ideal setup is to use MKSOCFPGA on the DE10-Nano with the interface board I created to replace the mesa hardware and get the hal side off of the x86 PC. Getting a QT ui going would just be too much work even if I could get it started

Problem is AFAIK all of the remote stuff is baked into qtquickvcp, and not MK's gladevcp has nothing new. I'm fairly certain I can get the existing GTK2 UI to run under MK as I've made a GTK2 test UI for my interface board that runs in both MK and LinuxCNC, but I'd need remote capabilities. The other day I was playing with linuxcncrsh and was able to control basic things on my MK test GUI with it but linuxcncrsh has no ability to set pins. I tried halrmt which supposedly does set pins but it does not seem to run on MK. From what I've read, linuxcncrsh and halrmt are both poorly coded so I don't think they are ideal anyway. I guess the basic question is is there any way to get machinetalk or any small useable portion of it to work with a GTK2 GUI?

markus

unread,
Dec 4, 2019, 11:19:18 PM12/4/19
to justin White, Machinekit
Not sure if you're looking for python or C++. In case it's the former
you could use the base classes from the FreeCAD workbench:

https://github.com/mlampert/machinekit-workbench

All files which start with MK... are independent of FreeCAD and/or QT.
The final class which ties everything together is in machinekit.py,
which can also function without FreeCAD but it does use a QT base
object for signal propagation into the UI. You can probably replace
that quite easy with whatever GTK2 uses for signals/notifications.

Other than that you are expected to call _update() in machinekit.py
periodically for service discovery and message processing.

HTH and let me know if you have any questions.

justin White

unread,
Dec 5, 2019, 9:51:36 PM12/5/19
to Machinekit
Well honestly I was looking for something that had about as minimal programming approach as possible. The freecad approach doesn't seem to implement a hal style approach like setting pins, and signals from the client, it appears to be more of an MDI interface. I'd need full hal visibillity as I need command and feedback of pins directly. 

As was probably the original intention of LinuxCNC with someone like me in mind, I'm good with hal but not traditional programming languages. I have a friend that helps me with Python and C but I try not to throw huge projects at him. Like I said, I was unable to run halrmt in MK but I believe it seems similar to Linuxcncrsh with more hal abillities. I don't suppose that anyone has looked into improving these components? 

I might just be talking to the air here but if a userspace or RT component  (which does not exist yet) could  write telnet commands as pins that could be written to in hal, it could exist on the a client machine running a sim config that likely would not need an RT kernel. Hal-python could also read/write these pins/signals on the client side. On the RT hal side halrmt or similar would exist almost exactly as it does, just grabbing the telnet commands and commanding RT-hal. This approach would pretty much enable a linuxCNC machine to talk to an MK-CNC machine just using hal as a universal language. Completely GUI and language independent, if the interface can somehow set a hal pin, or give an MDI command it should work with this

I'm certainly not married to telnet as a protocol, I just mention it because it exists and this communication path is not meant for realtime critical things. If there is some existing way to do similar to what I mentioned I'd love to hear about it.

markus

unread,
Dec 5, 2019, 10:40:20 PM12/5/19
to justin White, Machinekit
I believe the functionality you're looking for is in
https://github.com/mlampert/Machinekit-Workbench/blob/master/MKServiceHal.py

Anyway, it is indeed a programming interface and not a remote hal shell.


On Thu, 5 Dec 2019 18:51:36 -0800 (PST)

justin White

unread,
Dec 5, 2019, 10:56:15 PM12/5/19
to Machinekit
I'll have to look into that but isn't protobuf/zeromq an MK thing that wouldn't readily exist in LCNC? A fella sent me an interesting email:


Does the mb2hal component run in MK?  I've played a bit with it on LCNC, and Modbus is a pretty common and versatile protocol, either the TCP or rs232 serial variants.

I've heard of mb2hal but never looked into it. It exists as a component in LCNC. I don't see it at all in MK source. I'd have to look into what I can do with it but since it's an RT shouldn't it "just work" in MK?

markus

unread,
Dec 5, 2019, 11:14:13 PM12/5/19
to justin White, Machinekit
I might've misunderstood your question - you are correct, everything in
my repo is MK specific and I don't think it translates to anything in
LCNC.

On Thu, 5 Dec 2019 19:56:15 -0800 (PST)
Reply all
Reply to author
Forward
0 new messages