Installing Lejos 0.8.5 on SuSe 11.2 problem

This is where you talk about the NXJ hardware related topics such as the brick, sensors, LEGO pieces, etc.

Moderators: 99jonathan, roger, imaqine

Installing Lejos 0.8.5 on SuSe 11.2 problem

Postby last_deceneu@yahoo.com » Thu Aug 05, 2010 9:43 am

Hello all!

I installed and used everything on windows vista usb+bluetooth - ok!

For some days I try to make to work lejos 0.8.5 on my suse 11.2 linux without succes.
JDK Version:1.6.0_17

I followed install guide for linux
1. unpacked tar
2. created env variables in .profile:
export JAVA_HOME=/usr/lib/jvm/java
export NXJ_HOME=/home/robo/lejos_nxj
export PATH=$PATH:$NXJ_HOME/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$NXJ_HOME/bin\
3. added udev.rules
# Lego NXT
BUS=="usb", SYSFS{idVendor}=="03eb", GROUP="users", MODE="0660"
BUS=="usb", SYSFS{idVendor}=="0694", GROUP="users", MODE="0660"
4. installed following libraries:
libusb-0_1-4 Version:0.1.13-2.2
libusb-0_1-4-debuginfo Version:0.1.13-2.2
libusb-1_0-0 Version:1.0.2-2.2
libusb-1_0-0-debuginfo Version:1.0.2-2.2
libusb-1_0-debugsource Version:1.0.2-2.2
libusb-1_0-devel Version:1.0.2-2.2
libbluetooth3 Version:4.56-1.1.1
5. run ant build script from builld directory that give errors:
jlibnxt:
[echo] jni.include.dir=/usr/lib/jvm/java-1.6.0-sun-1.6.0/jre/../include jni.sys.dir= /usr/lib/jvm/java-1.6.0-sun-1.6.0/jre/../include/linux
[cc] 1 total files to be compiled.
[cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:29:17: error: usb.h: No such file or directory
[cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:56: warning: ‘struct usb_device’ declared inside parameter list
[cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:56: warning: its scope is only this definition or declaration, which is probably not what you want

Actually I'm able to compile and link samples java programs, but I can't upload to nxt using usb or bluetooth. On brick I previously uploaded firmware from windows.

On some posts I read that it is not required to build libnxt because it is old and is replaced by default fantom driver. I'm a little bit confusing.

With linux bluetooth tools I'm able to find nxt, but I can't connect to it.
What mean "Bluetooth Pair from PC to NXT" ?

What I'm missing? What I should do to upload and communicate with brick over bluetooth ?
last_deceneu@yahoo.com
New User
 
Posts: 3
Joined: Thu Aug 05, 2010 9:05 am

Postby gloomyandy » Thu Aug 05, 2010 10:33 am

Hi,
you need libnxt on Linux to provide USB connection capability. So you need to fix those errors to get that. You may have to adjust your include paths to locate usb.h (try searching your system locate the file and make sure that the build includes that location).

To be able to connect to your NXT over Bluetooth you must pair the device with your computer:
http://www.bluetomorrow.com/about-bluet ... iring.html
The above artical describes the general process. I'm not sure how under suse you pair devices there will normally be some sort of Bluetooth manager that will allow you to search for and enter the required pin. Perhaps another user can help or you could ask for help on a Suse forum...

Good luck

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3967
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Installing Lejos 0.8.5 on SuSe 11.2 problem

Postby skoehler » Thu Aug 05, 2010 11:13 am

last_deceneu@yahoo.com wrote:On some posts I read that it is not required to build libnxt because it is old and is replaced by default fantom driver. I'm a little bit confusing.


Only on Windows. On Linux, libnxt is still the best thing to use.

You need to install the libusb devel package. I can't tell you the exact name, but consult you favourite package manager to find the right package. After that, libnxt should compile fine.
skoehler
leJOS Team Member
 
Posts: 1406
Joined: Thu Oct 30, 2008 4:54 pm

Postby last_deceneu@yahoo.com » Thu Aug 05, 2010 12:44 pm

Please help me to build libnxt, I really want to switch from win to linux and I'm not experienced with building C projects.

I installed all libraryes related to usb sources, devel, debug that I founded in the repository (listed in first post).

I downloaded and installed libusb from: http://libusb.sourceforge.net/
ldconfig output:
    libusb-1.0.so.0 (libc6) => /usr/local/lib/libusb-1.0.so.0
    libusb-1.0.so.0 (libc6) => /usr/lib/libusb-1.0.so.0
    libusb-1.0.so (libc6) => /usr/local/lib/libusb-1.0.so
    libusb-1.0.so (libc6) => /usr/lib/libusb-1.0.so
    libusb-0.1.so.4 (libc6) => /usr/lib/libusb-0.1.so.4
I see that sources for library libusb does not have usb.h header file but libusb.h.
I tried to modify main_jlibnxt.c file to include libusb.h - the same error.
If I specify the complete path to libusb.h file I don't get first error but still have rest of the errors.

This is complete list of errors:
    jlibnxt:
    [echo] jni.include.dir=/usr/lib/jvm/java-1.6.0-sun-1.6.0/jre/../include jni.sys.dir= /usr/lib/jvm/java-1.6.0-sun-1.6.0/jre/../include/linux
    [cc] 1 total files to be compiled.
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:55: warning: ‘struct usb_device’ declared inside parameter list
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:55: warning: its scope is only this definition or declaration, which is probably not what you want
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c: In function ‘create_address’:
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:58: error: dereferencing pointer to incomplete type
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:59: error: dereferencing pointer to incomplete type
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:68: warning: implicit declaration of function ‘usb_open’
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:68: warning: assignment makes pointer from integer without a cast
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:73: warning: implicit declaration of function ‘usb_get_string’
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:73: error: dereferencing pointer to incomplete type
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:74: warning: implicit declaration of function ‘usb_close’
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:86: error: dereferencing pointer to incomplete type
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:86: error: dereferencing pointer to incomplete type
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:88: error: dereferencing pointer to incomplete type
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:88: error: dereferencing pointer to incomplete type
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c: In function ‘nxt_find_nth’:
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:101: warning: implicit declaration of function ‘usb_init’
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:106: warning: implicit declaration of function ‘usb_find_busses’
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:107: warning: implicit declaration of function ‘usb_find_devices’
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:111: warning: implicit declaration of function ‘usb_get_busses’
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:111: warning: assignment makes pointer from integer without a cast
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:112: error: dereferencing pointer to incomplete type
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:116: error: dereferencing pointer to incomplete type
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:116: error: dereferencing pointer to incomplete type
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:118: error: dereferencing pointer to incomplete type
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:119: error: dereferencing pointer to incomplete type
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:120: error: dereferencing pointer to incomplete type
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:121: error: dereferencing pointer to incomplete type
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:126: warning: passing argument 1 of ‘create_address’ from incompatible pointer type
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:55: note: expected ‘struct usb_device *’ but argument is of type ‘struct usb_device *’
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c: In function ‘nxt_open’:
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:144: warning: assignment makes pointer from integer without a cast
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:146: warning: implicit declaration of function ‘usb_set_configuration’
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:154: error: dereferencing pointer to incomplete type
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:155: error: dereferencing pointer to incomplete type
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:157: warning: implicit declaration of function ‘usb_claim_interface’
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:170: warning: implicit declaration of function ‘usb_bulk_read’
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c: In function ‘nxt_close’:
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:186: warning: implicit declaration of function ‘usb_release_interface’
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c: In function ‘nxt_write_buf’:
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:197: warning: implicit declaration of function ‘usb_bulk_write’
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c: In function ‘nxt_serial_no’:
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:218: error: dereferencing pointer to incomplete type
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:219: error: dereferencing pointer to incomplete type
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:224: warning: assignment makes pointer from integer without a cast
    [cc] /home/robo/lejos_nxj/src/libnxt/main_jlibnxt.c:226: error: dereferencing pointer to incomplete type

    BUILD FAILED
    /home/robo/lejos_nxj/build/build.xml:85: The following error occurred while executing this line:
    /home/robo/lejos_nxj/src/libnxt/build.xml:40: gcc failed with return code 1
last_deceneu@yahoo.com
New User
 
Posts: 3
Joined: Thu Aug 05, 2010 9:05 am

Postby skoehler » Thu Aug 05, 2010 3:31 pm

last_deceneu@yahoo.com wrote:Please help me to build libnxt, I really want to switch from win to linux and I'm not experienced with building C projects.

I installed all libraryes related to usb sources, devel, debug that I founded in the repository (listed in first post).

I downloaded and installed libusb from: http://libusb.sourceforge.net/


No, please don't. I'm sure, there are RPM packages for SuSE 11.2.

Another issue is, that libnxt has not been ported to libusb 1.0 yet. Please use the legacy release v0.1 or the compatibility layer.

I think, all you need is to install OpenSUSE's libusb-compat-devel package. It exists and contains the right files, according to this page:
http://www.rpmseek.com/rpm/libusb-compa ... :0:8077831
skoehler
leJOS Team Member
 
Posts: 1406
Joined: Thu Oct 30, 2008 4:54 pm

Postby last_deceneu@yahoo.com » Fri Aug 06, 2010 9:10 am

Thank you guys for your help!

I installed bluez-devel 4.56 and libusb-compat-devel 0.1.3-2.2 from repo. With this build was successful.

Please add this informations in start guide tutorial for OpenSuSe 11.2, I spend one week with that.
last_deceneu@yahoo.com
New User
 
Posts: 3
Joined: Thu Aug 05, 2010 9:05 am


Return to NXJ Hardware

Who is online

Users browsing this forum: No registered users and 2 guests

more stuff