LiNuXT: Linux + NXT
Since transitioning to Ubuntu Linux, I’ve continued working on my Lego NXT projects. I spent several hours figuring out how to configure my machine to write, debug, and upload code to the NXT brick. I found several sites and message board posts, each detailing a specific step in the process. I thought it would be a good idea to bring all of this information together and hopefully make it easy for anyone else who wishes to follow in my footsteps.
The entire process consists of setting up a Windows emulator (WINE), installing an IDE (BricxCC), and installing and running a communications tool between linux and the brick (Talk2NXT).
1. install WINE
2. install bricxCC
a. download from sourceforge: http://sourceforge.net/projects/bricxcc/files/bricxcc/
[UPDATE]At some point, Ubuntu required that all software not coming from a trusted repository be blocked unless the permissions were changed to “executable”. Explanation here. The only change is that the bricxccinstall.exe file will need to be chmod777′ed.[/UPDATE]
b. right click and select “Open with ‘Wine Windows Loader Program’ ”
c. complete the Windows-like installer
At this point, in the BricxCC GUI, try to compile some code and save it as a .NXT. If this works then you’re ready talk to the Brick.
3. get Talk2NXT
wget http://www-verimag.imag.fr/~raymond/edu/lego/t2n/t2n-0.2.src.tgz
tar -xzvf t2n-0.2.src.tgz
cd t2n-0.2.src
make
mv obj/t2n /usr/local/bin/
4. physically connect the NXT Brick via USB, and turn on the Brick
5. test connection
#### NXT INFOS ###############
protocol version=1.124 firmware version=1.1
NXT Name: NXT
Blutooth address: 16:53:00:23:74:00
Blutooth signal: 0
Free user flash: 115536
6. not necessary, but list the files on the NXT Brick
7. Generate .rxe files.
If you have any files uploaded from before (maybe under a Windows usage) you’ll see that the program files are .rxe even though BricxCC saves files as .nxc. We now need to generate .rxe files from the code, so that the Brick will know what to do. When you upload through BricxCC in Windows, it autmatically generates a .rxe file from the .nxc. We can do this easily during compiling. In BricxCC GUI
8. Upload a .rxe file, in terminal
9. List files on the brick to confirm that the upload was completed
I certainly can not claim any credit for this except for bringing it all together. Credit goes to:




Hi, I am having trouble accessing the page in france, the t2n file. Do you know if it is still accessible. If not, do you know of a mirror site.
Thanks
Corey
Comment by Corey — November 14, 2009 @ 12:26 pm
Corey,
Try this hotlink to the .tgz file
Comment by tir38 — November 15, 2009 @ 9:32 pm
t2n -put helloworld.rxe
Error :
usbnxt: upload: can’y initiate upload (reply=0×02,status=0xffffff92,error=0×0000)
Comment by Meir — May 19, 2010 @ 5:08 pm
loading files with other extension works.
Comment by Meir — May 19, 2010 @ 5:09 pm
At step 5, I’m getting:
Error :
usbnxt: usbmisc: fails to set config, errno=-1 (cf=1 vendor=0×0694 product=0×0002)
I’m running Ubuntu 9.04, nxt fw 1.29.
BTW, everything upto step 4 was working beautifully…
Comment by James — May 22, 2010 @ 11:04 am