Installation of latest Lejos into Netbeans on Ubuntu

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

Moderators: 99jonathan, roger, imaqine

Installation of latest Lejos into Netbeans on Ubuntu

Postby Chopper69 » Sat Oct 29, 2011 6:58 pm

I use the Lejos software and can install without any problems on Windows however on Ubuntu the installation is complicated to say the least. So far I have basically been following this webpage (http://www.fontysvenlo.org/lejos/) by the letter and everything seems to be fine until I need to build the project. I receive this error message when I build the project:

Code: Select all
clean:
Deleting directory /home/jamie/NetBeansProjects/NXJSample/build
compile:
Created dir: /home/jamie/NetBeansProjects/NXJSample/build
Compiling 1 source file to /home/jamie/NetBeansProjects/NXJSample/build
/home/jamie/NetBeansProjects/NXJSample/build.xml:40: /home/jamie/NetBeansProjects/NXJSample/${env.NXJ_HOME}/lib/nxt does not exist.
BUILD FAILED (total time: 0 seconds)


From the look of it I think there is a problem with my environment variables. My environment variables are set to as follows.

Code: Select all
export PATH=/Documents/lejos_nxj/bin:$PATH
export PATH=/usr.share/ant/bin:$PATH
export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.26
export NXT_HOME=/Documents/lejos_nxj


Lejos was unpacked into my Documents folder.
The project properties java source classpath is "/home/jamie/Documents/lejos_nxj/lib/nxt/classes.jar

If anyone can help with this then it would be greatly appreciated.

Jamie
Chopper69
New User
 
Posts: 13
Joined: Sun Feb 20, 2011 2:16 pm

Re: Installation of latest Lejos into Netbeans on Ubuntu

Postby skoehler » Sat Oct 29, 2011 7:18 pm

Use the line
<property environment="env" />
before loading the other property files. Have you tried using ant on the command line?
ant not expanding the variable typically means that it doesn't exist.
skoehler
leJOS Team Member
 
Posts: 1399
Joined: Thu Oct 30, 2008 4:54 pm

Re: Installation of latest Lejos into Netbeans on Ubuntu

Postby Chopper69 » Sat Oct 29, 2011 8:52 pm

Thanks for the response. Fortunately I have managed to solve that problem. Was an issue with my environment variables set in /etc/profile. Those are all working fine now.

Now I have a problem with my usb drivers. I can connect my NXT to the computer and run lsusb which doesn't give me what I expect back. It registers that a device has been detected but not a part of the lego group.

From reading articles I have seen that I should be getting (or at least something similar to):

Code: Select all
Bus XXX Device YYY: ID 0694:0002 Lego Group


However if the brick is in firmware update mode I get:

Code: Select all
Bus XXX Device YYY: ID 03eb:6124 Atmel Corp. at91sam SAMBA bootloader


If i run lsusb when it has been flashed on a Windows PC I get
Code: Select all
Bus XXX Device YYY: ID 04f2:b1d8 Chicony Electronics Co., Ltd


Not sure where I went wrong when installing libusb. Thought it was going to be one of the easy parts.

Cheers,

Jamie
Chopper69
New User
 
Posts: 13
Joined: Sun Feb 20, 2011 2:16 pm

Re: Installation of latest Lejos into Netbeans on Ubuntu

Postby skoehler » Sat Oct 29, 2011 9:21 pm

Chopper69 wrote:Thanks for the response. Fortunately I have managed to solve that problem. Was an issue with my environment variables set in /etc/profile. Those are all working fine now.

Now I have a problem with my usb drivers. I can connect my NXT to the computer and run lsusb which doesn't give me what I expect back. It registers that a device has been detected but not a part of the lego group.

From reading articles I have seen that I should be getting (or at least something similar to):

Code: Select all
Bus XXX Device YYY: ID 0694:0002 Lego Group



Correct.

Chopper69 wrote:However if the brick is in firmware update mode I get:

Code: Select all
Bus XXX Device YYY: ID 03eb:6124 Atmel Corp. at91sam SAMBA bootloader



Correct.

Code: Select all
If i run lsusb when it has been flashed on a Windows PC I get [code]Bus XXX Device YYY: ID 04f2:b1d8 Chicony Electronics Co., Ltd


Not sure where I went wrong when installing libusb. Thought it was going to be one of the easy parts.[/quote]

Which firmware did you flash? The standard Lego firmware doesn't work with Linux, BTW. Their USB implementation is rubbish. LeJOS firmware works just nice.
04f2:b1d8 is not the NXT. Are you sure, that device appears/disappears when you connect/disconnect the NXT?
skoehler
leJOS Team Member
 
Posts: 1399
Joined: Thu Oct 30, 2008 4:54 pm

Re: Installation of latest Lejos into Netbeans on Ubuntu

Postby Chopper69 » Sat Oct 29, 2011 9:41 pm

I originally installed LeJOS onto a Windows Vista machine, the brick was flashed previously to the LeJOS software and I 're-flashed' it during the installation and setting up of Netbeans on the computer. I used the Lego drivers to detect the brick on the Windows machine though I don't think that should make a difference. The brick syncs fine to the Windows computer and has been used on a University maintained machine that runs linux.

Though I have just noticed I have been quite retarded and the last code snippet I put about if I run lsusb and get
Code: Select all
Bus XXX Device YYY: ID 04f2:b1d8 Chicony Electronics Co., Ltd
was wrong and that's a different device. So it stays as
Code: Select all
Bus XXX Device YYY: ID 03eb:6124 Atmel Corp. at91sam SAMBA bootloader


Apologies for the mistake.

Cheers,

Jamie
Chopper69
New User
 
Posts: 13
Joined: Sun Feb 20, 2011 2:16 pm

Re: Installation of latest Lejos into Netbeans on Ubuntu

Postby Chopper69 » Sat Oct 29, 2011 9:52 pm

After flashing the brick on the windows machine and then plugging it into this computer and running lsusb I get:

Code: Select all
Bus 002 Device 006: ID 0694:0002 Lego Group Mindstorms NXT


It was flashed using the nxtflashginst file on the Windows machine.

Cheers,

Jamie
Chopper69
New User
 
Posts: 13
Joined: Sun Feb 20, 2011 2:16 pm

Re: Installation of latest Lejos into Netbeans on Ubuntu

Postby skoehler » Sat Oct 29, 2011 10:11 pm

nxjflash didn't work on Linux?
skoehler
leJOS Team Member
 
Posts: 1399
Joined: Thu Oct 30, 2008 4:54 pm

Re: Installation of latest Lejos into Netbeans on Ubuntu

Postby Chopper69 » Sat Oct 29, 2011 10:24 pm

Nope, neither did browse, or any others for that matter.

nxjbrowse (whilst flashed and working properly for windows):
Code: Select all
jamie@jamie-AO533:~/Documents/lejos_nxj/bin$ nxjbrowse
leJOS NXJ> Searching for any NXT using Bluetooth inquiry
leJOS NXJ> Search Failed: Bluetooth Device is not available
leJOS NXJ> Failed to find any NXTs
No NXT found - is it switched on and plugged in (for USB)?


edit: just realised that the browse was based on bluetooth enabled bricks....it's been a long day. And I haven't even attempted to connect via bluetooth.

nxjflash (whilst in firmware update mode):
Code: Select all
jamie@jamie-AO533:~/Documents/lejos_nxj/bin$ nxjflash
Building firmware image.
VM file: /home/jamie/Documents/lejos_nxj/bin/lejos_nxt_rom.bin
Menu file: /home/jamie/Documents/lejos_nxj/bin/StartUpText.bin
Magic string found at offset 0x40
VM size: 55712 bytes.
Menu size: 44132 bytes.
Total image size 99940/100352 bytes.
Locating device in firmware update mode.
No devices in firmware update mode were found.
Searching for other NXT devices.
No NXT found. Please check that the device is turned on and connected.


nxjflashg:
Fails

When installing libusb its just a case of typing:

Code: Select all
sudo apt-get install libusb-(version)


Then creating the file in dev for the usb rules. There arent any other steps that I have missed out possibly?

Cheers,

Jamie
Chopper69
New User
 
Posts: 13
Joined: Sun Feb 20, 2011 2:16 pm

Re: Installation of latest Lejos into Netbeans on Ubuntu

Postby esmetaman » Sun Oct 30, 2011 10:12 am

Hi friends,

in ubuntu, LeJOS tools run nice. In 2 years, I have installed LeJOS on Ubuntu systems without any problem.

Now, with Ubuntu 10.04, I run:

LeJOS
Eclipse
Eclipse Plugin for LeJOS
Subeclipse

without any problem

I have a doc about LeJOS installation on Linux which I use frecuently.
http://code.google.com/p/lejos-ebook/so ... nnexes.pdf

i noticed that exist and extrange error in Ubuntu 10.04 when you try to replace firmware, but I found the solution and I documented it:
http://www.roboticaenlaescuela.es/blog/ ... -sesion-1/

Some times you could see the following messages:

“cannot load comm driver”
“an error occurred: Failed to open device in SAM-BA mode.”


Solution:

sudo rmmod cdc_acm

sudo -s
echo "" >> /etc/modprobe.d/blacklist.conf
echo "blacklist cdc_adm" >> /etc/modprobe.d/blacklist.conf
Juan Antonio Breña Moral
http://www.juanantonio.info/lejos-ebook/
http://www.iloveneutrinos.com/
User avatar
esmetaman
Advanced Member
 
Posts: 290
Joined: Wed Sep 13, 2006 12:16 am
Location: Madrid, Spain

Re: Installation of latest Lejos into Netbeans on Ubuntu

Postby Chopper69 » Sun Oct 30, 2011 10:29 am

I have a doc about LeJOS installation on Linux which I use frecuently.
http://code.google.com/p/lejos-ebook/so ... nnexes.pdf


Clicking on the link sends me to the document however I am unable to view it. I get this error message "This file is not plain text (only UTF-8 and Latin-1 text encodings are currently supported)."

And the error message you posted I have not received as of yet. The brick is detected when running lsusb but is not detected when running usbflash etc.

Cheers,

Jamie
Chopper69
New User
 
Posts: 13
Joined: Sun Feb 20, 2011 2:16 pm

Re: Installation of latest Lejos into Netbeans on Ubuntu

Postby skoehler » Sun Oct 30, 2011 10:37 am

Chopper69 wrote:
I have a doc about LeJOS installation on Linux which I use frecuently.
http://code.google.com/p/lejos-ebook/so ... nnexes.pdf


Clicking on the link sends me to the document however I am unable to view it. I get this error message "This file is not plain text (only UTF-8 and Latin-1 text encodings are currently supported)."


Click "view raw file" on the right side.
skoehler
leJOS Team Member
 
Posts: 1399
Joined: Thu Oct 30, 2008 4:54 pm

Re: Installation of latest Lejos into Netbeans on Ubuntu

Postby Chopper69 » Sun Oct 30, 2011 11:55 am

Not entirely sure how I managed to get it to compile but it now compiles and a project can be uploaded to the brick.

New problem has arisen now. When creating a new project and uploading it. I receive the following error message:

Code: Select all
Java Exception:
Class: 16
Method: 26
PC: 3651


Class 16 refers java.lang.NullPointerException and Method 26 is org.lejos.example.HelloWorld.main(java.lang.Sting[])

I've had errors before but never with the examples.

Cheers,

Jamie
Chopper69
New User
 
Posts: 13
Joined: Sun Feb 20, 2011 2:16 pm

Re: Installation of latest Lejos into Netbeans on Ubuntu

Postby Chopper69 » Sun Oct 30, 2011 12:06 pm

Chopper69 wrote:Not entirely sure how I managed to get it to compile but it now compiles and a project can be uploaded to the brick.

New problem has arisen now. When creating a new project and uploading it. I receive the following error message:

Code: Select all
Java Exception:
Class: 16
Method: 26
PC: 3651


Class 16 refers java.lang.NullPointerException and Method 26 is org.lejos.example.HelloWorld.main(java.lang.Sting[])

I've had errors before but never with the examples.



Ok managed to fix it. Basically I have LeJOS installed on 3 systems now. Two of those are Windows and the one I have been trying to get working was a notebook running Ubuntu. The Notebook and one of the Windows computers were running the latest version of LeJOS as they were installed yesterday and now today. The other Windows machine that I am sat by now is running LeJOS 0.85 not 0.9

After flashing the brick with the notebook running the 0.9 version the error doesn't come up any more. Any ideas why that would make a difference?

Cheers for all your help and links,

Jamie
Chopper69
New User
 
Posts: 13
Joined: Sun Feb 20, 2011 2:16 pm

Re: Installation of latest Lejos into Netbeans on Ubuntu

Postby esmetaman » Sun Oct 30, 2011 12:12 pm

Hi Jamie,

I could check with you in detail your LeJOS installation with Ubuntu to discover the source of your problems.

I think that you should try to reinstall LeJOS enterelly to solve the issues if you have time.

Besides, I recommend to use Eclipse with LeJOS because you have a fantastic plugin. Without that puglin develop project using packages or a large set of classes is a bit hard but it is not impossible :)

Tell me if you have to time to check the installation in team.

Cheers
Juan Antonio Breña Moral
http://www.juanantonio.info/lejos-ebook/
http://www.iloveneutrinos.com/
User avatar
esmetaman
Advanced Member
 
Posts: 290
Joined: Wed Sep 13, 2006 12:16 am
Location: Madrid, Spain

Re: Installation of latest Lejos into Netbeans on Ubuntu

Postby skoehler » Sun Oct 30, 2011 12:21 pm

Never upload a program linked with 0.8.5 to an NXT brick running firmware 0.9.
Also never upload a program linked with 0.9 to an NXT brick running firmware 0.8.5
The firmware does not check the version of the binary file (as far as I'm aware) and it does not provide any form of compatibility with old binary files.
skoehler
leJOS Team Member
 
Posts: 1399
Joined: Thu Oct 30, 2008 4:54 pm


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff