OpenRoberta / robertalab-usbprogram-nxt

USB connection for NXT
Apache License 2.0
0 stars 1 forks source link

Driver cannot be loaded #4

Closed goeba closed 5 years ago

goeba commented 5 years ago

Hi, I've just tried the new nxt-usb program and got the following error:

SCHWERWIEGEND: Error: Failed to load USB comms driver. lejos.pc.comm.NXTCommException: lejos.pc.comm.NXTCommException: Cannot load NXTComm driver 18.08.2019 20:26:39 lejos.pc.comm.NXTConnector search

(Schwerwiegend is german for serious)

I have carefully tried to use 32 bit java, I have even used the java bundled with older roberta usb programs.

With the older program the driver is loaded, nxt is found, but the button "connect" stays greyed out. I am clueless! Do I have to download the driver elsewhere? Or is it necessary to flash the nxt (which it was not with the older version)?

Regards, Andreas

VinArt commented 5 years ago

Hi,

I have done something a long time ago to make this work, but still it was somewhat unstable on 64 bit systems. The problem lies in the implementation on jlibnxt and is dragged from libusb-0.1 and namely the compat package which somehow is not fully compatible with this old library.

So in the end it sometimes fails with 32 bit version java and libraries on some systems and some kernels. I will see into this in next days and we will decide on what to do. Could you please tell us the OS you are currently running?

boonto commented 5 years ago

I just tried it with the 1.0.0 release and our NXT, and it works. My uname -a output:

Linux <hostname> 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

and my java -version output:

openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-8u222-b10-1ubuntu1~18.04.1-b10)
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)

Can you post your outputs for these commands? Maybe we can find a difference that may cause the issue.

goeba commented 5 years ago

Hi, I have set up a fresh Kubuntu 18.04 Machine. The default-jre is newer than yours, I have changed that to match yours. Now I get: $ uname -a Linux goe-TravelMate-B117-M 4.18.0-15-generic #16~18.04.1-Ubuntu SMP Thu Feb 7 14:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux and java -version openjdk version "1.8.0_222" OpenJDK Runtime Environment (build 1.8.0_222-8u222-b10-1ubuntu1~18.04.1-b10) OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode) When I run Openroberta, I get SCHWERWIEGEND: Error: Failed to load USB comms driver. lejos.pc.comm.NXTCommException: lejos.pc.comm.NXTCommException: Cannot load NXTComm driver

boonto commented 5 years ago

Thank you, we'll see if we can reproduce this on a fresh 18.04 install. Maybe I have something installed that fixes the issue.

goeba commented 5 years ago

I think I found (because of you posting that you are using kernel 4.15 and 64 bit java, in contrast to the documentation) an explanation:

The first version of Ubuntu 18.04 was shipped with 4.15 kernel, but later updated. The 4.15 kernel is still in the repos, one needs to install it, update grub-menu to show it, boot it, install all of the above and THEN IT WORKS.

This also explains why I had no look even with my old notebook, where roberta used to work: I had upgraded the kernel in the meantime.

So there is a regression in kernel > 4.15 that does not work with the nxt driver, and you should update your install script and documentation, because this is pretty much 64 bit now, I think.

Maybe with this info you can even fix it to work with later kernels, but I have the feeling that this will be quite difficult.

Regards, Andreas

boonto commented 5 years ago

Thank you for the additional info. With the previous changes of @VinArt in the testing branch we were able to get a running version for a newer kernel version using 64 bit Java. We tested it on a fresh Kubuntu (kernel 5.0) VM and my PC and it works on both. It should hopefully work on all 4.x versions as well.

Can you try this? The install script now downloads the appropriate 64 bit libraries.

goeba commented 5 years ago

Hi, my first test with my own Arch Linux (Kernel 5.2.9, very new) box was successful, thanks! I'll test on other systems, too.

The only difference I spotted is that when pressing the play-button, the program does not start automatically (whereas it did with the old version). It would be cool to have both possibilities: Download + start and download only.

boonto commented 5 years ago

The immediate start was actually an issue, I'll test it on the other platforms. Because of the fast transfer, we decided that immediately starting the program may cause problems if the robot drives off the table or something similar.

goeba commented 5 years ago

Hi, libusb-java is missing for the libraries that need to be installed.

Apart from that, in our schools network I was not able to use a local robertalab-installation. On the command line it says "invalid custom ip".

I just typed 10.0.0.81 for ip, there is no field for port. Do I need to use a special syntax for the IP or something? I need to use a custom ip, because we are behind a proxy server and the roberta-program does not support proxy server. Maybe there is another bug for the custom port.

Thanks in advance,

Andreas

VinArt commented 5 years ago

image is there an issue with the port field due to the monitor resolution? Custom server address is used for locally hosted servers though..

goeba commented 5 years ago

I have tried at school: No field for port. At home: The field is visible. I am totally clueless. Could you please provide a version where the port field is visible no matter what the window geometry is? Or where the window can be resized?

VinArt commented 5 years ago

I made the window re-sizable and wider by default. You can try this

goeba commented 5 years ago

Great, thank you!

In the meantime (as the matter was a bit urgent for us) I had added a default value of "80" to the port-field, which fixed the issure for our institution, too (as we use port 80 for our local roberta installation). Maybe you might want to add this.

VinArt commented 5 years ago

I in general do not fully understand your whole setup and the original issue was about driver not loading. I think such fixes/features should be proposed in a separate issue. Please re-open this in case if there will be something wrong with the driver again.

Best regards.