Penguin
Diff: LegoMindstorms
EditPageHistoryDiffInfoLikePages

Differences between version 13 and predecessor to the previous major change of LegoMindstorms.

Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History

Newer page: version 13 Last edited on Tuesday, February 2, 2010 1:19:01 pm by LawrenceDoliveiro Revert
Older page: version 12 Last edited on Tuesday, February 2, 2010 12:51:24 pm by LawrenceDoliveiro Revert
@@ -7,9 +7,21 @@
 For Linux users, the best option for programming these seems to be a pair of languages called NBC (a low-level assembler) and NXC (a higher-level C-like language). NXC compiles to the NBC bytecodes, which in turn are interpreted by firmware on-board the NXT controller. These languages are part of the open-source [Bricx Command Center|http://bricxcc.sourceforge.net/] project, the main part of which is Windows-only. However, the [nbc|http://bricxcc.sourceforge.net/nbc/] command-line tool can be built for Linux, and this implements both languages as well as functions for uploading compiled programs into a connected NXT microcontroller. 
  
 A useful library is [NXT_Python|http://home.comcast.net/~dplau/nxt_python/index.html]. This provides functions that can be used to directly examine and manipulate the state of the NXT controller from the host PC. Notwithstanding its requirements specifically mentioning Python 2.4, it does seem to work fine with Python 2.5. 
  
-Another compiler is [NXTGCC|http://nxtgcc.sourceforge.net/wiki/index.php/NXTGCC]. Unlikes NBC/NXC, this compiles to actual machine language for the ARM CPU. It can be used to write completely new firmware for the NXT controller 
+Another compiler is [NXTGCC|http://nxtgcc.sourceforge.net/wiki/index.php/NXTGCC]. Unlikes NBC/NXC, this compiles to actual machine language for the ARM CPU. It can be used to write completely new firmware for the NXT controller.  
+  
+!! Device Permissions Setup  
+  
+You don’t need any special drivers to connect the NXT controller to a Linux box (at least via USB; I haven’t tried Bluetooth); all communication is done through the userland <tt>libusb</tt> library. However, by default, <tt>udev</tt> will create the device entry as only accessible by root. To fix this, create a new group in your <tt>/etc/group</tt> file called, say <tt>legonxt</tt>. Add your own nonprivileged username to this group (you will need to logout and login again to become a member of this group). Then, create a new file in your <tt>/etc/udev/rules.d</tt> (for example, call it <tt>70-lego.rules</tt>) containing the following line:  
+  
+<pre>  
+ SUBSYSTEM=="usb", ATTR{idVendor}=="0694", GROUP="legonxt", MODE="0660"  
+</pre>  
+  
+This gives read/write access to the device to all members of the <tt>legonxt</tt> group.  
+  
+You may find versions of the above <tt>udev</tt> rule elsewhere on the Web which also create a symlink for the device with a name like <tt>/dev/legonxt-</tt>''xxx''. As far as I can tell, this is unnecessary. <tt>libusb</tt> certainly doesn’t need it.  
  
 !! NBC/NXC Building Notes 
  
 Ignore the source release tarballs linked from the NBC Beta Releases page above; they are all out of date. Instead, get the latest source out of SubVersion (note you will need [Free Pascal|http://www.freepascal.org/] to compile it):