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).
Lego NXT Ubuntu Linux from Jason Atwood on Vimeo.
1.) install WINE
sudo apt-get 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
apt-get install g++ libusb-dev
tar -xzvf t2n-0.2.src.tgz
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
Edit->Preferences->General->Save compiler output
8.) Upload a .rxe file, in terminal
t2n -put do_something.rxe
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:
- Christophe Nowicki, Talk2NXT install method
- Pascal Raymond
- Bricx Command Center
- NXT Boy, .nxc to .rxe method
- BricxCC on Wine
8 thoughts on “LiNuXT: Linux + NXT”
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.
Try this hotlink to the .tgz file
t2n -put helloworld.rxe
usbnxt: upload: can’y initiate upload (reply=0x02,status=0xffffff92,error=0x0000)
loading files with other extension works.
At step 5, I’m getting:
usbnxt: usbmisc: fails to set config, errno=-1 (cf=1 vendor=0x0694 product=0x0002)
I’m running Ubuntu 9.04, nxt fw 1.29.
BTW, everything upto step 4 was working beautifully…
I have trouble with making t2n
Can anyone help
Sorry but I am not familiar enough with make to help. You may try to contact t2n creator
I was having exactly the same problem. usbnxt: usbmisc: fails to set config, errno=-1 (cf=1 vendor=0x0694 product=0x0002) I was curious, and tried putting sudo in front of the whole thing. It works!
sudo t2n -ls