User Tools

Site Tools


linux:legomindstorms

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
linux:legomindstorms [2014/01/07 22:15] – [Second Attempt: LEJOS] rlunarolinux:legomindstorms [2014/01/07 23:46] rlunaro
Line 181: Line 181:
  
 ===== Second Attempt: LEJOS ===== ===== Second Attempt: LEJOS =====
 +
 +==== Install ant ====
 +
 +You should have ''ant'' installed. To do so, 
 +
 +<code shell>
 +$ sudo apt-get install ant
 +</code>
 +
 +And should have ''libusb-dev'' installed also. 
 +
 +<code shell>
 +sudo apt-get install libusb-dev
 +</code>
 +
 +After doing that, make sure that the usb.h file is available in your destination system. 
 +
 +
 +==== Hands on ====
  
 [[http://www.lejos.org/|Lejos]] is a Java Virtual Machine for the RCX (the yellow box). It's a replacement for the Lego firmware, so, if your CD of mindstorms is broken, it's the perfect solution. [[http://www.lejos.org/|Lejos]] is a Java Virtual Machine for the RCX (the yellow box). It's a replacement for the Lego firmware, so, if your CD of mindstorms is broken, it's the perfect solution.
Line 187: Line 206:
  
 When I've checked out the web page, the download link didn't work. But you can go directly to the [[http://sourceforge.net/projects/lejos|sourceforge webpage]] in order to download the files.  When I've checked out the web page, the download link didn't work. But you can go directly to the [[http://sourceforge.net/projects/lejos|sourceforge webpage]] in order to download the files. 
 +
 +When you download and uncompress the file ''leJOS_NXJ_0.9.1beta-3.tar.gz'', you should check out the README.html file. 
 +
 +Then start by setting the environment variable NXJ_HOME: 
 +
 +<code shell>
 +$ cd LEJOS_NXJ_DIRECTORY   # the files ACKNOWLEDGMENTS.txt, LICENSE.txt, RELEASENOTES.txt should be there
 +$ NXJ_HOME=$(pwd)
 +$ export NXJ_HOME
 +</code>
 +
 +Then go to the ''build'' directory and run ''ant''. This is for construct the USB support for java. 
 +
 +In my case, this command failed. The problem was in the ''build.xml'' file located in NXJ_HOME/build/libnxt. I've reconstructed the compiler command: 
 +
 +<code shell>
 +gcc -Wall -std=gnu99 -fPIC main_jlibnxt.c
 +</code>
 +
 +
 +And it fails with this error: 
 +
 +<code>
 +main_jlibnxt.c:28:17: fatal error: usb.h: No such file or directory
 +</code> 
 +
 +**Solution:**
 +
 +    - Locate the usb.h file in your filesystem: ''find / -iname usb.h 2>/dev/null'': in my system this appears in ''/usr/include/usb.h''
 +
 +I've fixed the solution executing the ''make'' command and then:
 +
 +<code shell>
 +$ cd NXJ_HOME/build
 +$ ant
 +</code>
 +
 +
  
  
linux/legomindstorms.txt · Last modified: 2022/12/02 22:02 by 127.0.0.1