[vox-tech] success with usb lego on linux!

Peter Jay Salzman vox-tech@lists.lugod.org
Sun, 7 Jul 2002 14:51:35 -0700


WOO HOO!  WOO HOO!  success!

this is totally brand spanking new.  be the first on your block to use
usb lego under linux.



step 1: getting the code
========================
i can now use usb lego mindstorms under linux.  the linux driver *just*
got released a few days ago.  the download url is in one of my previous
posts.


step 2: patching software
=========================
export $USB = "/usr/src/linux"

the code includes lego.c and lego_usb.h which go in $USB/drivers/usb.
there's also a patch for $USB/drivers/usb/Makefile.  the patch allows
you to choose "lego" from the kernel usb menu in make {menu|x|}config.

i pointed out some problems with the driver initialization.  the patch
was included in my last email.  the patch is appied in the "wrong
direction" so you need to install it as patch -R < linux.patch or else
do the patch by hand (it's like 1 or 2 lines).   hopefully, he'll
release the updated copy rather than the old copy and a (broken) patch.

you also need to patch nqc.  hopefully, nqc with usb enabled support
will be released soon.


step 3: the device file
=======================
the device file is hardcoded into nqc as "/dev/usb", whether you have
devfs or not.  so, contrary to the readme that comes with the driver,
you must create the device file there:

mknod /dev/usb/legotower c 180 64

this will hopefully change soon.  also, i'm pretty sure an official
linux kernel major number will be assigned to lego mindstorms sometime
soon.


step 4: insert the module
=========================
modprobe -a lego


step 5: download the firmware
=============================
./nqc -Susb -firmware ../../firm0309.lgo

nota bene: -S always refers to the device file you're using, like
/dev/ttyS0 or /dev/ttyS1.  except when you use USB.  then you just use
"usb".   make sense?  no?  me neither.  hopefully this will change soon.


here's what i've tested:

* downloaded firmware 0309 (mindstorms 1.5) to RCX 1.0 (mindstorms 1.0)
  using the USB tower from mindstorms 2.0.

* downloaded firmware 0309 (mindstorms 1.5) to RCX 2.0 (mindstorms 2.0)
  using the USB tower from mindstorms 2.0.


and then there was linux!
ooooooooooo-yeeeaaaaaahhhhhhhhhhhhhhhh.....

pete
-- 
GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E  70A9 A3B9 1945 67EA 951D