nxjupload hangs on Linux Mint 13

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

nxjupload hangs on Linux Mint 13

Postby Matuku » Tue Jan 29, 2013 2:53 pm

I'm trying to get my NXT working on Linux Mint 13 (64-bit). 0.9.1 has been flashed to the device beforehand so that's all sorted. But I'm unable to upload programs to the device. When trying to do so it says "NXT Found" (and indeed it appears when lsusb is called) but then just hangs indefinitely. I've been following the Linux Set Up guide: setting the environment variables, getting the location in /dev/bus/usb/ and setting the correct permissions, etc. The native java library seems to build correctly:
Code: Select all
Buildfile: /opt/leJOS_NXJ/build/build.xml

jlibnxt:

clean:

jlibnxt:
       [cc] 1 total files to be compiled.
       [cc] Starting link

make:
     [copy] Copying 1 file to /opt/leJOS_NXJ/lib/pc/native/linux/x86_64
     [echo]
     [echo] *** SUCCESS: jlibnxt was installed correctly ***
     [echo]         

all:
     [echo] Done.

BUILD SUCCESSFUL
Total time: 4 seconds


The main issue I can think of is that it's still using the incorrect version of libusb (even though both are installed). I can't uninstall libusb1.0 due to dependencies but how can I ensure that the NXJ software is using the legacy version?
Matuku
New User
 
Posts: 1
Joined: Tue Jan 29, 2013 2:40 pm

Re: nxjupload hangs on Linux Mint 13

Postby skoehler » Tue Jan 29, 2013 4:23 pm

What guide have you followed? Actually, you should be using the udev rules instead of setting the permission of the USB devices manually.
Also, the libusb version should not be an issue. The native library wouldn't even compile or link if the correct libusb version wasn't installed.

I'm using Linux myself, and nxjupload has worked like a charm so far. I haven't tried Linux Mint 13. I will have to install that, possibly within a virtual machine. So I'm not sure, whether I can reproduce the issue.

I assume, nxjupload is failing every time and not just sometimes? Can you post the output of a failed nxjupload attempt?
skoehler
leJOS Team Member
 
Posts: 1430
Joined: Thu Oct 30, 2008 4:54 pm

Re: nxjupload hangs on Linux Mint 13

Postby mls0.5 » Wed Mar 06, 2013 6:21 pm

I have this exact same problem. I am running Cinnarch (Archlinux) and lejos-nxj 0.9.1.beta3-2. I am using libusbx 1.0.14-1 (which provides libusb) and libusb-compat 0.1.4-2.

I am able to flash the brick to lejos:
Code: Select all
Building firmware image.
VM file: /opt/lejos-nxj/bin/lejos_nxt_rom.bin
Menu file: /opt/lejos-nxj/bin/StartUpText.bin
Magic string found at offset 0x40
VM size: 55888 bytes.
Menu size: 47740 bytes.
Total image size 103804/104448 bytes.
Building filesystem image.
Locating device in firmware update mode.
No devices in firmware update mode were found.
Searching for other NXT devices.
Found Unknown Address 0016531192BF
Attempting to reboot the device.
Locating device in firmware update mode.
Opened device in firmware update mode.
Connected to SAM-BA v1.4
Unlocking pages.
Writing firmware image.
Verifying firmware.
Verified 104448 bytes ok.
Unlocking pages.
Writing filesystem image.
Verifying filesystem.
Verified 157696 bytes ok.
Restarting the device.


But it fails when I try to upload:
Code: Select all
Initializing LeJOS JDK at /opt/lejos-nxj
nxjflashg has been started successfully
Linking ...
Program has been linked successfully
Uploading ...
Found NXT: GRB 0016531192BF
Linking or uploading the program failed
java.io.IOException: Error in write
See Eclipse error log for detailed stack trace.

it hangs at "Found NXT: GRB 0016531192BF" until the nxt automatically turns off, at which point it throws the IOException
mls0.5
New User
 
Posts: 6
Joined: Wed Mar 06, 2013 5:50 pm

Re: nxjupload hangs on Linux Mint 13

Postby mls0.5 » Wed Mar 06, 2013 6:28 pm

I made a new post for this: http://lejos.sourceforge.net/forum/viewtopic.php?f=7&t=4347
mls0.5
New User
 
Posts: 6
Joined: Wed Mar 06, 2013 5:50 pm

Re: nxjupload hangs on Linux Mint 13

Postby skoehler » Wed Mar 06, 2013 11:32 pm

I'm using Gentoo, and I have libusbx and libusb-0.1 installed in parallel. With this, leJOS works like a charm.
Gentoo also offers libusb-compat. I will try to install that and let you know, whether I can reproduce the issue.
skoehler
leJOS Team Member
 
Posts: 1430
Joined: Thu Oct 30, 2008 4:54 pm

Re: nxjupload hangs on Linux Mint 13

Postby mls0.5 » Thu Mar 07, 2013 12:39 am

Some more information that might be helpful:

  • My user is in groups: lp wheel uucp network video audio storage lego users
  • When I try to upload as root I get the same errors.
  • I removed my self from group lego and got the same result as before when trying to upload.
  • lsmod | grep usb :
    Code: Select all
    btusb                  12373  0
    bluetooth             192234  24 bnep,btusb,rfcomm
    usbcore               150440  5 btusb,uvcvideo,rts5139,ehci_hcd,xhci_hcd
    usb_common               955  1 usbcore
  • upload using bluetooth actually does work
  • nxt_test program outputs:
    Code: Select all
    NXT brick name: GRB
    Host address: 00:16:53:11:92:BF
    Bluetooth signal strength: 0
    Free user flash: 129280
    Protocol version 1.2
    Firmware version 1.3
    Battery level 7256 mV


mls0.5
New User
 
Posts: 6
Joined: Wed Mar 06, 2013 5:50 pm

Re: nxjupload hangs on Linux Mint 13

Postby skoehler » Thu Mar 07, 2013 1:02 am

mls0.5 wrote:I removed my self from group lego and got the same result as before when trying to upload.

After you do that, you might have to logout and login again so the changes take effect. Are you SURE that you really got the same result?
Because according to what you posted, nxjupload can at least figure out the name of the NXT. When you are not in the lego group, you shouldn't be able to open the USB devices. Hence, nxjupload should not be able to determine the name of the NXT. Also, can you show me the permission of the device nodes /dev/bus/usb/ ?

mls0.5 wrote:nxt_test program outputs:

Which nxt_test program?
skoehler
leJOS Team Member
 
Posts: 1430
Joined: Thu Oct 30, 2008 4:54 pm

Re: nxjupload hangs on Linux Mint 13

Postby mls0.5 » Thu Mar 07, 2013 3:25 am

Sorry, you are right. When not in the lego group I cannot even find the nxt. I must have forgotten to relogin.

Also, can you show me the permission of the device nodes /dev/bus/usb/ ?

I am not quite sure what you mean by that but here is the output of ls -l in that directory:
Code: Select all
total 0
drwxr-xr-x 2 root root 140 Mar  6 22:05 001
drwxr-xr-x 2 root root  80 Mar  6 22:05 002
drwxr-xr-x 2 root root  60 Mar  6 22:12 003
drwxr-xr-x 2 root root  60 Mar  6 22:05 004

output of lsusb:
Code: Select all
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 005: ID 0694:0002 Lego Group Mindstorms NXT
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 001 Device 004: ID 0930:021d Toshiba Corp.
Bus 001 Device 005: ID 10f1:1a43 Importek

so I am guessing you want the permissions of /dev/bus/usb/003/005
ls -l /dev/bus/usb/003/:
Code: Select all
total 0
crw-rw-r-- 1 root root 189, 256 Mar  6 22:05 001
crw-rw-r-- 1 root lego 189, 260 Mar  6 22:18 005


The nxt_test program is something I though was from lejos-nxj but it is actually part of a package I downloaded from the aur called nxt-python
here is its contents:
Code: Select all
#!/usr/bin/python2

#Lists various information from all bricks it can connect to.

import sys, traceback

if '--help' in sys.argv:
    print '''nxt_test -- Tests the nxt-python setup and brick firmware interaction
Usage:  nxt_test (takes no arguments except --help)'''
    exit(0)

import nxt.locator
import nxt.brick

try:
    b = nxt.locator.find_one_brick()
    name, host, signal_strength, user_flash = b.get_device_info()
    print 'NXT brick name: %s' % name
    print 'Host address: %s' % host
    print 'Bluetooth signal strength: %s' % signal_strength
    print 'Free user flash: %s' % user_flash
    prot_version, fw_version = b.get_firmware_version()
    print 'Protocol version %s.%s' % prot_version
    print 'Firmware version %s.%s' % fw_version
    millivolts = b.get_battery_level()
    print 'Battery level %s mV' % millivolts
except:
    print "Error while running test:"
    traceback.print_tb(sys.exc_info()[2])
    print str(sys.exc_info()[1])
    if b:
        b.sock.close()
mls0.5
New User
 
Posts: 6
Joined: Wed Mar 06, 2013 5:50 pm

Re: nxjupload hangs on Linux Mint 13

Postby przmjaskier » Fri Mar 08, 2013 9:19 am

The same situation here. I see a pattern. I'm using 64-bit Linux, too. It's Kubuntu 12.10.
I see that all guys who wrote "works for me" are not saying that they use 64-bit linux. All issues are reported on 64 bits...
It looks like 100% reproducible on 64-bit environment. Before, I was running lejos on 32-bit Kubuntu 10.10 and there was no problems. I have udev-rules set, everything done exactly like on 32-bits, but after NXT found, it just simply hangs...

Can you verify my statement? Come on, 64-bit Linux is quite popular now and quite a bunch of people is affected by this problem...

Exactly the same thing happens for me - see below. Nxjupload hangs forever, the "Error in write" error can be due to NXJ shutting down due to a timeout - because it happens after 5 minutes or so. It doesn't change the fact, that nxjupload hangs for at least 5 minutes...

/leJOS_NXJ_0.9.1beta-3/bin/nxjupload
-r MultiServos.nxj
Found NXT: NXT 0016531B3FCF
Got exception during close: java.io.IOException: Error in write
java.io.IOException: Error in write
at lejos.pc.comm.NXTCommUSB.rawWrite(NXTCommUSB.java:271)
at lejos.pc.comm.NXTCommUSB.flushBuffer(NXTCommUSB.java:212)
at lejos.pc.comm.NXTCommUSB.write(NXTCommUSB.java:556)
at lejos.pc.comm.NXTCommUSB.sendRequest(NXTCommUSB.java:496)
at lejos.nxt.remote.NXTCommand.openWrite(NXTCommand.java:175)
at lejos.nxt.remote.NXTCommand.uploadFile(NXTCommand.java:398)
at lejos.pc.tools.Upload.upload(Upload.java:46)
at lejos.pc.tools.NXJUpload.run(NXJUpload.java:93)
at lejos.pc.tools.NXJUpload.start(NXJUpload.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at lejos.pc.tools.ToolStarter.startTool(ToolStarter.java:31)
at lejos.pc.tools.NXJUpload.main(NXJUpload.java:29)
Last edited by przmjaskier on Fri Mar 08, 2013 9:35 am, edited 3 times in total.
przmjaskier
New User
 
Posts: 8
Joined: Tue Feb 19, 2013 12:05 am

Re: nxjupload hangs on Linux Mint 13

Postby przmjaskier » Fri Mar 08, 2013 9:23 am

To our mighty Moderator: please, can you merge these two topics and set a subject of "nxjupload hangs on a 64-bit linux" ?
przmjaskier
New User
 
Posts: 8
Joined: Tue Feb 19, 2013 12:05 am

Re: nxjupload hangs on Linux Mint 13

Postby przmjaskier » Fri Mar 08, 2013 9:31 am

One more thing: I've tested nxjupload issue with the same results on both 32-bit and 64-bit JDK 1.7 (set using JAVA_HOME and LEJOS_NXT_JAVA_HOME variable), with 32-bit compatibility libs added to linux (ia32-libs) and libnxj compiled to both architectures. Both 32-bit and 64-bit runs ended in nxjupload hanging in the same way on my 64-bit linux.
przmjaskier
New User
 
Posts: 8
Joined: Tue Feb 19, 2013 12:05 am

Re: nxjupload hangs on Linux Mint 13

Postby skoehler » Fri Mar 08, 2013 7:49 pm

There is no issue with 64Bit Linux and leJOS. I'm using it myself for 2 years now.
Are you all using OpenJDK? Could you try with a JDK by Oracle?

Please tell me, which libusb related packages are installed on your system.
skoehler
leJOS Team Member
 
Posts: 1430
Joined: Thu Oct 30, 2008 4:54 pm

Re: nxjupload hangs on Linux Mint 13

Postby mls0.5 » Sat Mar 09, 2013 2:42 am

I tried the oracle JDK6 (jdk6 and jre6 from the AUR) and it gave the same results.
mls0.5
New User
 
Posts: 6
Joined: Wed Mar 06, 2013 5:50 pm

Re: nxjupload hangs on Linux Mint 13

Postby przmjaskier » Sat Mar 09, 2013 10:08 am

Oracle Java - tested on all 1.6/1.7 32/64 bit combinations.

I've simply apt-geted libusb-dev - if you'd like more details, please let me know what should I do to provide it.

I'm really sad because of this situation. So much things to do and I simply cannot afford to switch to Windows or my previous linux installation.
przmjaskier
New User
 
Posts: 8
Joined: Tue Feb 19, 2013 12:05 am

Re: nxjupload hangs on Linux Mint 13

Postby skoehler » Sat Mar 09, 2013 12:12 pm

just do a "dpkg -l |grep libusb" and post the output.
skoehler
leJOS Team Member
 
Posts: 1430
Joined: Thu Oct 30, 2008 4:54 pm

Next

Return to NXJ Software

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

more stuff