Linux Lejos

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

Moderators: 99jonathan, roger, imaqine

Linux Lejos

Postby Xpyd3r » Mon Dec 31, 2007 6:34 am

Okay so I am using Ubuntu, and I'm wondering if anyone has any better way to do this.

Whenever I Turn on, I have to open up my terminal and define and export my variables
Then after that i have to go to lsusb to find the nxt
After i find out the number I do the sudo chmod line
Then after all that I can use my nxt for programming, but have to leave it on while programming otherwise i have to do it all over again...

P.S. I recently got a USB bluetooth dongle so I'm not exactly sure how to use that instead of the cable now either.

Any and all help is greatly appreciated
Xpyd3r
Novice
 
Posts: 50
Joined: Tue Aug 07, 2007 5:58 am

Postby mdsmitty » Mon Dec 31, 2007 3:34 pm

Add all the export stuff to your .profile file its a hidden file in the root of your home folder. if you don't have one make one. logout and log back in. here is a copy of the lejos stuff in mine its for both the rcx and nxt

export JAVA_HOME=/home/mike/bin/java
export NXJ_HOME=/home/mike/lejos_nxj
export LEJOS_HOME=/home/mike/lejos_rcx
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LEJOS_HOME/bin
export RCXTTY=/dev/usb/legousbtower0
export CLASSPATH=$CLASSPATH:.:$LEJOS_HOME/lib/classes.jar:$LEJOS_HOME/lib/pcrcxcomm.jar
PATH=/home/mike/bin/java/bin:/home/mike/lejos_rcx/bin:/home/mike/lejos_nxj/bin:$PATH


The following is from the readme.html file

To use udev rules, set up a file such as /etc/udev/rules.d/70-lego.rules and populate it with the following lines:

# Lego NXT
BUS=="usb", SYSFS{idVendor}=="03eb", GROUP="lego", MODE="0660"
BUS=="usb", SYSFS{idVendor}=="0694", GROUP="lego", MODE="0660"

You have to also create a group called lego and add your self to it.

This should take care of your problems

For bluetooth you can upload your programs by typing the following "nxj -b -d 00:16:53:03:7B:CF filename". If you don't put -d and your nxt address it will take a lot longer since lejos will have to find it. to get your address type "hcitool scan" and you'll see your nxt. I have tried uploading with the name for the nxt and this does not seam to work. You could set a variable for your address so you don't have to type it.
mdsmitty
Novice
 
Posts: 78
Joined: Tue Feb 27, 2007 3:07 am

Postby CoBB » Mon Dec 31, 2007 9:08 pm

mdsmitty wrote:You have to also create a group called lego and add your self to it.

This should take care of your problems

One step is missing: restarting udev after making the changes.
Code: Select all
sudo /etc/init.d/udev restart
User avatar
CoBB
Novice
 
Posts: 73
Joined: Tue Apr 24, 2007 12:24 pm

Postby Xpyd3r » Wed Jan 02, 2008 4:16 pm

do i need any software for bluetooth?
Xpyd3r
Novice
 
Posts: 50
Joined: Tue Aug 07, 2007 5:58 am

Postby CoBB » Wed Jan 02, 2008 10:30 pm

You need bluez and a PIN helper. I use bluez-gnome for that purpose. Debian (and therefore I guess Ubuntu as well) has a metapackage called bluetooth which should get it all working; it only recommends bluez-gnome though, so you might need to install that explicitly. If you’re using a dongle, you also need a udev rule similar to the one above to set the permissions (you can use lsusb to determine the vendor id for the rule after plugging it in).
User avatar
CoBB
Novice
 
Posts: 73
Joined: Tue Apr 24, 2007 12:24 pm

Postby Xpyd3r » Sat Jan 05, 2008 10:05 pm

i dont know where to put my exports in my .profile. I have put them in the beginning middle and end and its not working. I have no idea what im doing wrong. when i type echo $NXJ_HOME it just shows a blank line
Xpyd3r
Novice
 
Posts: 50
Joined: Tue Aug 07, 2007 5:58 am

Postby edalquist » Sat Jan 05, 2008 10:21 pm

With Ubuntu you'll need to log out and back in after adding things to your .profile to have them take effect. You can also type 'source .profile' at the command prompt instead of logging out and back in.
edalquist
Novice
 
Posts: 48
Joined: Sun Apr 08, 2007 5:55 pm


Return to NXJ Software

Who is online

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

cron
more stuff