Java UI for linuxcnc
my app has no os dependencies at all. As soon as you have a working copy of linuxcnc, my app will be working. You only need a jre - nothing more.What Debian version do you have installed?
I compiled the java stuff with v8 compatibility, so any jre available in decent os will do the job.
My app worked on jessie, buster and it works on bullseye as well. It worked with linuxcnc before 2.8 was released and it works with current master-gtk3 (python3).
.
Why should I?I hope you have not felt offended by the fact that I said that I wanna take your project into another direction by using kotlin.
That's the nature of open source. You can do what you want, as long as you mention me as original author.
But - I won't accept any push request regarding kotlin, gradle, maven or whatever tools that will bloat my harddisk. I did not use gradle by intention and don't wonna use it at all.
I'm fine with the stuff I created and the tools I used.
If you like my work, you can use it - if you don't like it, you don't have to use it.
Its a free world
I would have appreciated a little feedback about whether you got your copy working - after all that struggling. But you're free not to give any feedback at all.
Please Log in or Create an account to join the conversation.
The PR that you saw with kotlin is made by a friend of mine who tried on his machine to see if he can manage to make it work on his arch linux, he told me later he made a pull request.
I haven't wrote a line of code yet about this project. I wanted to get the original app working first.
I had two linux machines, one of them is ubuntu but its the laptop I have from work, and I did not managed yet to setup a debian on that one yet.
The other one was a minipc, which had debian 10 installed. On that machine, I've ended up a bit further than with the one running ubuntu. I've managed to install all the dependencies, and got the correct libraries listed in the ldd command.
However there was something still not working, but I will come back to this later next week once I manage to create a partition and install debian on the work laptop.
I have a question: from your app can you open the already existent utility apps like halscope, hal configuration, etc that the Axis or Gmoccapy are opening for setting up the linuxcnc machine configuration?
There was always annoying to me how hal configration is implemented and I was wondering if the api's used to create that application would be available to be consumed from java.
Thanks,
Vasi
Please Log in or Create an account to join the conversation.
well, first of all try to get your linuxcnc working.
When you compiled a rip-installation successfully, the rest should be a bit of nothing
No, all halapps run natively from linux commandline. I don't see any need or benefit in calling those apps from java environment. I did some tests with accessing hal from java - it was possible, but I abandoned that idea, as I have no need for direct hal access.I have a question: from your app can you open the already existent utility apps like halscope, hal configuration, etc that the Axis or Gmoccapy are opening for setting up the linuxcnc machine configuration?
Just to clarify: hal means hardware abstraction layer - I have no plans to directly access any hardware. linuxcnc does it good enuf. Anything is possible. Shortcomings of linuxcnc are NOT hardware related. All the bad is in software
cheers Reinhard
Please Log in or Create an account to join the conversation.
How difficult would it be to obtain the same functionality in java?
On my machine I have a touch probe and a tool sensor, and I wanna signal in the software if the sensor is plugged in or not. That's just one usecase.
Please Log in or Create an account to join the conversation.
I have set up a fresh debian 10 on my minipc. I have pulled out the branch master-gtk3 and successfully ran the following commands.
[code]> git clone git://github.com/linuxcnc/linuxcnc.git linuxcnc-dev
> cd linuxcnc-dev/src
> ./autogen.sh
> ./configure --with-realtime=uspace
> make
Then I ran
[code]sudo make setuid
Then I've pulled your code, did all the steps, and reach the following point:
cnc@mindovercnc:~/Work/JCNCScreen/native$ make TestNML
make: 'TestNML' is up to date.
cnc@mindovercnc:~/Work/JCNCScreen/native$ ldd TestNML
linux-vdso.so.1 (0x00007ffcf17a5000)
libnml.so.0 => /home/cnc/Work/JCNCScreen/native/lc/lib/libnml.so.0 (0x00007fe46c780000)
libGL.so.1 => /lib/x86_64-linux-gnu/libGL.so.1 (0x00007fe46c6d1000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fe46c54d000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe46c3ca000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fe46c3b0000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe46c1ef000)
liblinuxcnchal.so.0 => /home/cnc/Work/linuxcnc-dev/lib/liblinuxcnchal.so.0 (0x00007fe46c1de000)
libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007fe46c1aa000)
libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007fe46c0ed000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe46c0e8000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe46c0c7000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe46c7e6000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fe46c0bb000)
libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007fe46bf7a000)
libXext.so.6 => /lib/x86_64-linux-gnu/libXext.so.6 (0x00007fe46bd68000)
libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fe46bd3e000)
libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007fe46bb3a000)
libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fe46b932000)
libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007fe46b918000)
Then I navigated into the runtime folder and tried to run the app:
cnc@mindovercnc:~/Work/JCNCScreen$ cd runtime/
cnc@mindovercnc:~/Work/JCNCScreen/runtime$ java -Djava.library.path=.:./lc/lib -splash:lc/linuxcnc.gif -jar JCNCScreen.jar -base ./exHdr
local check: AppTitle == > JCNCScreen - frontend for linuxCNC <
current directory: /home/cnc/Work/JCNCScreen/runtime/.
populateTree ...
read ToolTable ...
Exception in thread "main" java.lang.UnsatisfiedLinkError: no nml in java.library.path: [., ./lc/lib]
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2670)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
at java.base/java.lang.System.loadLibrary(System.java:1873)
at de.schwarzrot.system.ErrorReader.<clinit>(Unknown Source)
at de.schwarzrot.app.LinuxCNCClient.<init>(Unknown Source)
at de.schwarzrot.app.LinuxCNCClient.main(Unknown Source)
Any idea what I am still missing?
Thanks,
Vasi
Please Log in or Create an account to join the conversation.
Congratulation!and just to make sure, I ran the linuxcnc tests witch ran fine.
Finally you got it
Oh man!make TestNML
make: 'TestNML' is up to date.
you had a binary from a former installation.
This can't work.
So if you (re)compile linuxcnc, you should run a "make clean" first of all.
Then - if you issue a "make TestNML" only the test-app will be build.
That means, you can't start the java app without having built the library (just "make").
TestNML is an app to test the NML communication. So it serves to check your build environment, as well as to check NML-connection.
So start linuxcnc with axis (without any UI-action in axis) and then start TestNML.
Axis should turn on and home all axis.
If that works, you can continue with the library.
Cheers Reinhard
Please Log in or Create an account to join the conversation.
make: 'TestNML' is up to date.
This installation was a clean debian, without any version of linuxcnc installed. So the only install that I have is the one built from master-gtk3 branch.
After reading your last message I was more enlightened a bit so I did the following:
1. in JCNCScreen folder -> ant clean, then ant dist
2. in another terminal window, opened linuxcnc, with a default configuration (axis UI window estopped)
3. switched to native folder then ran ./TestNML which took the Axis UI out of estop, powered on the machine, then homed the machine.
4. Then I navigated into the runtime folder and tried to run the app:cnc@mindovercnc:~/Work/JCNCScreen$ cd runtime/
cnc@mindovercnc:~/Work/JCNCScreen/runtime$ java -Djava.library.path=.:./lc/lib -splash:lc/linuxcnc.gif -jar JCNCScreen.jar -base ./exHdr
local check: AppTitle == > JCNCScreen - frontend for linuxCNC <
current directory: /home/cnc/Work/JCNCScreen/runtime/.
populateTree ...
read ToolTable ...
Exception in thread "main" java.lang.UnsatisfiedLinkError: no nml in java.library.path: [., ./lc/lib]
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2670)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
at java.base/java.lang.System.loadLibrary(System.java:1873)
at de.schwarzrot.system.ErrorReader.<clinit>(Unknown Source)
at de.schwarzrot.app.LinuxCNCClient.<init>(Unknown Source)
at de.schwarzrot.app.LinuxCNCClient.main(Unknown Source)
Its kinda wierd that TestNML can interact with linuxcnc properly, but this one cannot.
If you notice something that I might be missing, please let me know!
Thanks for your help!
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Thank you very much for that info
.
That's a different error from the ones before and it tells, that libnml.so is not found in library path.java.lang.UnsatisfiedLinkError: no nml in java.library.path
You can check it with "ls -l ./lc/lib/libnml.so"
May be you forgot to create the link lc to linuxcnc installation?
Please Log in or Create an account to join the conversation.
This is the result of the command you told me to run:
cnc@mindovercnc:~/Work/JCNCScreen/native$ ls -l
total 2196
-rw-r--r-- 1 cnc cnc 13994 Aug 16 12:13 de_schwarzrot_system_CommandWriter.cc
-rw-r--r-- 1 cnc cnc 18494 Aug 16 13:13 de_schwarzrot_system_CommandWriter.d
-rw-r--r-- 1 cnc cnc 4546 Aug 16 12:13 de_schwarzrot_system_CommandWriter.h
-rw-r--r-- 1 cnc cnc 223984 Aug 16 13:13 de_schwarzrot_system_CommandWriter.o
-rw-r--r-- 1 cnc cnc 5931 Aug 16 12:13 de_schwarzrot_system_ErrorReader.cc
-rw-r--r-- 1 cnc cnc 18841 Aug 16 13:13 de_schwarzrot_system_ErrorReader.d
-rw-r--r-- 1 cnc cnc 720 Aug 16 12:13 de_schwarzrot_system_ErrorReader.h
-rw-r--r-- 1 cnc cnc 184920 Aug 16 13:13 de_schwarzrot_system_ErrorReader.o
-rw-r--r-- 1 cnc cnc 3241 Aug 16 12:13 de_schwarzrot_system_StatusReader.cc
-rw-r--r-- 1 cnc cnc 18337 Aug 16 13:13 de_schwarzrot_system_StatusReader.d
-rw-r--r-- 1 cnc cnc 935 Aug 16 12:13 de_schwarzrot_system_StatusReader.h
-rw-r--r-- 1 cnc cnc 183368 Aug 16 13:13 de_schwarzrot_system_StatusReader.o
-rwxr-xr-x 1 cnc cnc 81408 Aug 16 13:13 DumpBufDesc
-rw-r--r-- 1 cnc cnc 7271 Aug 16 12:13 dumpBufDesc.cc
-rw-r--r-- 1 cnc cnc 17933 Aug 16 13:13 dumpBufDesc.d
-rw-r--r-- 1 cnc cnc 107616 Aug 16 13:13 dumpBufDesc.o
-rw-r--r-- 1 cnc cnc 12514 Aug 16 12:13 emcDecode.cc
lrwxrwxrwx 1 cnc cnc 28 Aug 16 12:21 lc -> /home/cnc/Work/linuxcnc-dev/
-rw-r--r-- 1 cnc cnc 20262 Aug 16 13:13 libLinuxCNC.map
-rwxr-xr-x 1 cnc cnc 732480 Aug 16 13:13 libLinuxCNC.so
-rw-r--r-- 1 cnc cnc 2000 Aug 16 12:13 Makefile
-rwxr-xr-x 1 cnc cnc 398 Aug 16 12:13 rebuild_header
-rwxr-xr-x 1 cnc cnc 535872 Aug 16 12:33 TestNML
-rw-r--r-- 1 cnc cnc 6111 Aug 16 12:13 TestNML.cc
cnc@mindovercnc:~/Work/JCNCScreen/native$ ls -l ./lc/lib/
total 27788
drwxr-xr-x 2 cnc cnc 4096 Aug 16 11:38 hallib
lrwxrwxrwx 1 cnc cnc 15 Aug 16 17:53 libcanterp.so -> libcanterp.so.0
-rwxr-xr-x 1 cnc cnc 106888 Aug 16 17:53 libcanterp.so.0
-rw-r--r-- 1 cnc cnc 4693856 Aug 16 17:52 liblinuxcnc.a
lrwxrwxrwx 1 cnc cnc 19 Aug 16 17:51 liblinuxcnchal.so -> liblinuxcnchal.so.0
-rwxr-xr-x 1 cnc cnc 233664 Aug 16 17:51 liblinuxcnchal.so.0
lrwxrwxrwx 1 cnc cnc 19 Aug 16 17:51 liblinuxcncini.so -> liblinuxcncini.so.0
-rwxr-xr-x 1 cnc cnc 282424 Aug 16 17:51 liblinuxcncini.so.0
lrwxrwxrwx 1 cnc cnc 11 Aug 16 17:51 libnml.so -> libnml.so.0
-rwxr-xr-x 1 cnc cnc 1323824 Aug 16 17:51 libnml.so.0
lrwxrwxrwx 1 cnc cnc 16 Aug 16 17:51 libposemath.so -> libposemath.so.0
-rwxr-xr-x 1 cnc cnc 370424 Aug 16 17:51 libposemath.so.0
lrwxrwxrwx 1 cnc cnc 16 Aug 16 17:53 libpyplugin.so -> libpyplugin.so.0
-rwxr-xr-x 1 cnc cnc 747976 Aug 16 17:53 libpyplugin.so.0
lrwxrwxrwx 1 cnc cnc 13 Aug 16 17:53 librs274.so -> librs274.so.0
-rwxr-xr-x 1 cnc cnc 20470912 Aug 16 17:53 librs274.so.0
lrwxrwxrwx 1 cnc cnc 16 Aug 16 17:53 libtooldata.so -> libtooldata.so.0
-rwxr-xr-x 1 cnc cnc 196712 Aug 16 17:52 libtooldata.so.0
drwxr-xr-x 12 cnc cnc 4096 Aug 16 17:54 python
cnc@mindovercnc:~/Work/JCNCScreen/native$ ls -l ./lc/lib/libnml.so
lrwxrwxrwx 1 cnc cnc 11 Aug 16 17:51 ./lc/lib/libnml.so -> libnml.so.0
cnc@mindovercnc:~/Work/JCNCScreen/native$
Please Log in or Create an account to join the conversation.