<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.zenerves.net/skins/common/feed.css?301"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
		<id>http://wiki.zenerves.net/index.php?action=history&amp;feed=atom&amp;title=Nxt%3A%3Ausb</id>
		<title>Nxt::usb - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.zenerves.net/index.php?action=history&amp;feed=atom&amp;title=Nxt%3A%3Ausb"/>
		<link rel="alternate" type="text/html" href="http://wiki.zenerves.net/index.php?title=Nxt::usb&amp;action=history"/>
		<updated>2026-08-02T08:11:47Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.17.0</generator>

	<entry>
		<id>http://wiki.zenerves.net/index.php?title=Nxt::usb&amp;diff=14&amp;oldid=prev</id>
		<title>Admin: 1 revision</title>
		<link rel="alternate" type="text/html" href="http://wiki.zenerves.net/index.php?title=Nxt::usb&amp;diff=14&amp;oldid=prev"/>
				<updated>2011-10-14T20:49:21Z</updated>
		
		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='1' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='1' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 20:49, 14 October 2011&lt;/td&gt;
		&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://wiki.zenerves.net/index.php?title=Nxt::usb&amp;diff=13&amp;oldid=prev</id>
		<title>Lola: /* Little script: */</title>
		<link rel="alternate" type="text/html" href="http://wiki.zenerves.net/index.php?title=Nxt::usb&amp;diff=13&amp;oldid=prev"/>
				<updated>2011-04-09T13:42:36Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Little script:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Mother-Of-All-Them-Threads on the NXTasy.org forum to get USB and BT speaking to your brick ''WAS'' [http://forums.nxtasy.org/index.php?showtopic=2143&amp;amp;view=findpost&amp;amp;p=16723 here] - but they moved to a new website called [http://mindboards.sourceforge.net/ MindBoards]  -- HEY John H. &amp;amp; Minboards staff, feel free to contact me on lola@''_this_server_name.net'' to rectify this and share the fun.&lt;br /&gt;
&lt;br /&gt;
Newer thread [http://sourceforge.net/apps/phpbb/mindboards/viewtopic.php?f=3&amp;amp;t=631&amp;amp;start=0 here]&lt;br /&gt;
&lt;br /&gt;
==Welcome folks==&lt;br /&gt;
&lt;br /&gt;
The above thread ''WAS'' is the one that got my several machines here speak with my NXT brick (succeeded with Slackware, Debian, Arch, Fedora and Ubuntu), so what's written down here is pretty much Tried &amp;amp; Tested. I did some simplifications, used GUI apps for, well, stuff you can do in a GUI (And that happened not to work on my Fedora machines at the time).&lt;br /&gt;
&lt;br /&gt;
'buntu users around: you have to add ''sudo'' in front of an instruction when here below it starts by '''#'''. And, yes, for everybody other *nixer around, '''#''' means a command that you run as ''ROOT''; whenever your average user is enough, it is ''$''.&lt;br /&gt;
&lt;br /&gt;
==Tools of the Trade==&lt;br /&gt;
&lt;br /&gt;
Hosted in my own small server for ease of use - please do not trust me, try to find the original binaries by yourself, and at least be aware that these, while working with my NXT 1.0, may not be latest version. You enter WORK-FOR-ME territory here, you can do better.&lt;br /&gt;
&lt;br /&gt;
[http://nxt.zenerves.net/nbc nbc] is the compiler, find it here in static binary version, as are the following executables:&lt;br /&gt;
&lt;br /&gt;
[http://nxt.zenerves.net/t2n t2n] is a lightweight tool to send files to the brick&lt;br /&gt;
&lt;br /&gt;
[http://nxt.zenerves.net/nexttool nexttool] is a full-featured file manipulation tool for your NXT brick.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Find here official releases from John H.: [http://bricxcc.sourceforge.net/nbc/]&lt;br /&gt;
&lt;br /&gt;
New kid on the block is the GUI-based [http://bricxcc.sourceforge.net/nxtcc.zip nxtcc] - haven't extensively tested as of now.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==OK, Let's find that Brick first==&lt;br /&gt;
&lt;br /&gt;
You start with a terminal, as root or with sudo. A lot of this must be done as root, so forget about it if you are not King of your Kingdom. Plug your NXT brick, wait for it to boot (as soon as the logo disappears &amp;amp; you see ''files'' you're good) and do (or sudo, I won't say it again):&lt;br /&gt;
&lt;br /&gt;
          # lsusb&lt;br /&gt;
&lt;br /&gt;
it should return something like:&lt;br /&gt;
&lt;br /&gt;
          [root@DC266 ~]# lsusb&lt;br /&gt;
          Bus 005 Device 001: ID 0000:0000  &lt;br /&gt;
          Bus 007 Device 003: ID 0c76:0005 JMTek, LLC. USBdisk&lt;br /&gt;
          Bus 007 Device 001: ID 0000:0000  &lt;br /&gt;
          Bus 002 Device 001: ID 0000:0000  &lt;br /&gt;
          Bus 003 Device 001: ID 0000:0000  &lt;br /&gt;
          '''Bus 004 Device 002: ID 0694:0002 Lego Group''' &lt;br /&gt;
          Bus 004 Device 001: ID 0000:0000  &lt;br /&gt;
          Bus 006 Device 001: ID 0000:0000  &lt;br /&gt;
          Bus 001 Device 002: ID 1131:1001 Integrated System Solution Corp. KY-BT100 Bluetooth Adapter&lt;br /&gt;
          Bus 001 Device 001: ID 0000:0000&lt;br /&gt;
&lt;br /&gt;
Of this, obviously, '''Bus 004 Device 002: ID 0694:0002 Lego Group''' is the one that matters here. Obviously, the figures with ''Bus 004'' and ''Device 002'' are hardware dependent &amp;amp; are probably different on your system; it doesn't matter, just for the sake of stability while going through this tutorial, leave the brick on and plugged in the same port. Now try:&lt;br /&gt;
&lt;br /&gt;
          $ dmesg|tail &lt;br /&gt;
&lt;br /&gt;
should return something like this as last line(s) if the '''last thing you did was plug in/power on''' your brick:&lt;br /&gt;
&lt;br /&gt;
          usb 4-1: new full speed USB device using uhci_hcd and address 3&lt;br /&gt;
          usb 4-1: configuration #1 chosen from 1 choice&lt;br /&gt;
&lt;br /&gt;
So, yes, your computer (if you have a 2.6 kernel &amp;amp; a functional UDEV subsystem) does recognize your brick; it just doesn't really know what to do with it.&lt;br /&gt;
&lt;br /&gt;
If the brick hasn't showed up after 20 (twenty) seconds of being &amp;quot;On&amp;quot; and Plugged in USB, then I can't help I am afraid; don't waste your time on this document anymore. You may have to plug - unplug the USB wire with the brick &amp;quot;On&amp;quot; just to be safe, even plug in another port; then 20 secs is really a maximum. Your lsusb and dmesg|tail output should be way faster than that if it works as expected. Don't forget to do that as '''Root'''; for everybody but *buntu distros, even sudo won't do it since Linux may not like end-users messing with Hardware Layers! Unfortunately, the Brick itself won't tell nothing about being &amp;quot;hooked&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Now, get it plugged for real==&lt;br /&gt;
From here on, everything is liberally, and shamelessly, sucked out from John Hansen' [http://forums.nxtasy.org/index.php?showtopic=2143&amp;amp;view=findpost&amp;amp;p=16723 post] '''--deadlink--''' on NXTasy.org [http://forums.nxtasy.org/index.php?showforum=5 forum] '''--deadlink---''' look [http://mindboards.sourceforge.net/ here now for newer info].&lt;br /&gt;
&lt;br /&gt;
For all recent linux distributions here is John's procedure, slightly simplified though, that is recommended to configure your Linux box for use with the NXT:&lt;br /&gt;
&lt;br /&gt;
1. Add/create an nxt group and add yourself to it. &lt;br /&gt;
&lt;br /&gt;
 For KDE users, use '''kuser'''; gnome people should use '''config-system-users'''. &lt;br /&gt;
 Original tute on NXTAsy forum recommends CLI that didn't work on Fedora (don't alsk!).&lt;br /&gt;
 Create a group called '''nxt''' (WARNING: LINUX IS CASE SENSITIVE!) then go to the users management tab and &lt;br /&gt;
 add the group ''nxt'' to all users on this machine that will need it.&lt;br /&gt;
&lt;br /&gt;
1.b Super-nerds may do &lt;br /&gt;
&lt;br /&gt;
  groupadd nxt&lt;br /&gt;
  gpasswd -a ''&amp;lt;Your_Login_Name&amp;gt;'' nxt&lt;br /&gt;
&lt;br /&gt;
'''This part is quite crucial in order to avoid being ''As Root'' all the time when dealing with the brick.'''&lt;br /&gt;
&lt;br /&gt;
2. As root, navigate to '''/etc/udev/rules.d''' and create there a file called '''70-nxt.rules'''; the easyiest way of doing that is, from a terminal:&lt;br /&gt;
&lt;br /&gt;
          $ su -&lt;br /&gt;
          [Password]&lt;br /&gt;
          # cd /etc/udev/rules.d&lt;br /&gt;
          # nano 70-nxt.rules                        or '''gedit''', or '''kate''' or '''mousepad''', anything, even vim if you feel like.&lt;br /&gt;
&lt;br /&gt;
Its contents should look like this, you can Copy'N'paste after reviewing to be sure I am not planting something in your system:&lt;br /&gt;
&lt;br /&gt;
          SUBSYSTEM==&amp;quot;usb_device&amp;quot;, ACTION==&amp;quot;add&amp;quot;, SYSFS{idVendor}==&amp;quot;0694&amp;quot;,&lt;br /&gt;
          SYSFS{idProduct}==&amp;quot;0002&amp;quot;, SYMLINK+=&amp;quot;nxt-%k&amp;quot;, GROUP=&amp;quot;nxt&amp;quot;, MODE=&amp;quot;0660&amp;quot;, RUN+=&amp;quot;/etc/udev/nxt.sh&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3. Still using your ''Rootly-Powered'' Text Editor, create there a file called '''nxt.sh''' the same way, and save in up one directory into '''/etc/udev'''. Its contents should look like this:&lt;br /&gt;
&lt;br /&gt;
          #!/bin/bash&lt;br /&gt;
          #&lt;br /&gt;
          GROUP=nxt&lt;br /&gt;
          if [ &amp;quot;${ACTION}&amp;quot; = &amp;quot;add&amp;quot; ] &amp;amp;&amp;amp; [ -f &amp;quot;${DEVICE}&amp;quot; ]&lt;br /&gt;
          then&lt;br /&gt;
              chmod o-rwx &amp;quot;${DEVICE}&amp;quot;&lt;br /&gt;
              chgrp &amp;quot;${GROUP}&amp;quot; &amp;quot;${DEVICE}&amp;quot;&lt;br /&gt;
              chmod g+rw &amp;quot;${DEVICE}&amp;quot;&lt;br /&gt;
          fi&lt;br /&gt;
&lt;br /&gt;
4. Shut down the Text Editor; we'll re-use the terminal you used to fire it up to Make the little nxt.sh script executable. From a terminal prompt type&lt;br /&gt;
&lt;br /&gt;
          # chmod a+x /etc/udev/nxt.sh&lt;br /&gt;
&lt;br /&gt;
'''You MAY or MAY NOT have to reboot at this time, I cannot tell'''&lt;br /&gt;
&lt;br /&gt;
That should be all you need to do to make sure that your NXT will always be accessible via USB for any user who is a member of the nxt group. Whenever you plug in your NXT it should show up in /dev (you can go back to &amp;quot;user&amp;quot; mode now, with ''exit'' for instance:&lt;br /&gt;
&lt;br /&gt;
          $ ls /dev/nx* &lt;br /&gt;
''returns (lots of):''&lt;br /&gt;
          /dev/nxt-x-y&lt;br /&gt;
&lt;br /&gt;
where '''x''' and '''y''' depend on which USB port you plug the NXT into. There will be other entries such as /dev/nxt-usbdevx.y where y increments but you should be able to use the above device alias without any problems.&lt;br /&gt;
&lt;br /&gt;
!! That should take care of USB support!!&lt;br /&gt;
&lt;br /&gt;
==Yeah, Let's Speak to The Brick now==&lt;br /&gt;
&lt;br /&gt;
Just for the sake of testing, go to your nexttool folder, fire up the brick, plugged into your PC, and try (that is, if you did not linked it or copied in somewhere in your path): &lt;br /&gt;
&lt;br /&gt;
          ./nexttool /COM=USB -deviceinfo&lt;br /&gt;
&lt;br /&gt;
So that you know if everything went right if you get an output (reminder: [[NexTTool manual|NexTTool]] doesn't give an output in case of failure). And if it did, then it's all thanks to [http://forums.nxtasy.org/index.php?showuser=395 John] '''--deadlink--''' [http://mindboards.sourceforge.net/ Look here now], not me. I am just spreading the word, that's my contribution to it. Remember Linux is case-sensitive, and John's original name for this is NexTTool.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Some personal tips: '''Clean Up''' &amp;amp;&amp;amp; '''make it easy'''==&lt;br /&gt;
&lt;br /&gt;
You really don't need much to start programming the next NXT-based MarsRover: you do not need a powerful machine or that much of ram (Way, way less than with NXT-G), you can do it with a text editor, a decent USB stack and the above mentioned '''[[Nbc manual|nbc]]''', '''[[NexTTool manual|Nexttool]]''' and '''[[T2n manual|t2n]]'''; and if you feel like going Python or whatever, you won't need more anyway. One thing though that started to annoy me was the sheer number of micro-apps that I had to keep in one single place &amp;amp; start with ./ + the need to have the not-yet-compiled candidate there too if I did not want to change folders all the time; so:&lt;br /&gt;
&lt;br /&gt;
* [[NexTTool manual|Nexttool]] is a completely anti-Linux name, I renamed it to nexttool;&lt;br /&gt;
* Added a line in .bashrc with ''alias nexttool='nexttool /COM=USB''' because I only use USB anyway.&lt;br /&gt;
(to have your system aware of the new alias do ''$ source .bashrc'' now)&lt;br /&gt;
* All these are to be chmod'ed +x to be able to execute;&lt;br /&gt;
* Of the three programs that you'll use, '''[[Nbc manual|nbc]], [[NexTTool manual|Nexttool]]''' &amp;amp; '''[[T2n manual|t2n]]''', I made them part of the ''wheel'' group (that my user belongs to too) and moved/linked them to /usr/bin so that I can really type '''t2n -put myfile.rxe''' ... or '''nbc this.nxc -O=that.rxe'''... like they are just normal executables, part of my system. ''Which they are, after all''.&lt;br /&gt;
&lt;br /&gt;
Just do something like this to link them without messing up your system too much: &lt;br /&gt;
&lt;br /&gt;
 #ln -s /home/jarch/bin/ld/nexttool /usr/bin/nexttool&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now i am working from a neat ''~/mindstorms/compile/'' folder where the only non-nxc/nbc/rxe thingie is a subminimal &lt;br /&gt;
===Little script===&lt;br /&gt;
&lt;br /&gt;
  #!/bin/bash&lt;br /&gt;
  nbc x1.nxc -O=output.rxe&lt;br /&gt;
  t2n -put output.rxe&lt;br /&gt;
  nexttool /COM=USB -run=output.rxe&lt;br /&gt;
  nexttool /COM=USB -runningprogram&lt;br /&gt;
  t2n -b&lt;br /&gt;
&lt;br /&gt;
This script assumes you are working on the '''x1''' project, and that you want to put it &amp;amp; start it on the brick as '''output.rxe'''; I do this with every &amp;quot;draft&amp;quot; snippet, and then I name them properly and compile them with the appropriate output name for archival/sharing when I am happy with the result.&lt;br /&gt;
&lt;br /&gt;
OK, that was the '''HowTo Plug''', now for the '''WhatToDoWithIt''', may I recommend my [[Success Story]]?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[User:Lola|Lola]] 17:21, 7 July 2008 (UTC)&lt;br /&gt;
&lt;br /&gt;
Sample [[NXT Snippets|Snippets]] are here.&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
Brickcc and nbc: http://bricxcc.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
t2n: http://www-verimag.imag.fr/~raymond/edu/lego/t2n&lt;br /&gt;
&lt;br /&gt;
NexTTool is now quoted here as a Mac software (?) http://bricxcc.sourceforge.net/utilities.html&lt;br /&gt;
''The one linked on my server is intended for linux''&lt;br /&gt;
&lt;br /&gt;
New kid on the block, by John H. again: http://bricxcc.sourceforge.net/nxtcc.zip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]][[Category:Hardware]][[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>Lola</name></author>	</entry>

	</feed>