3

I am trying to use my old RCX 2.0 set on Linux (Xubuntu). The problem is that when I try to download the (official) firmware into the RCX via the command:

nqc -Susb:/dev/usb/legousbtower1 -firmware ./firm0332.lgo 

I get the error "Could not open serial port or USB device". Note that:

  • There is a module for the USB tower corresponding to my Linux kernel,
  • The USB tower is recognized as /dev/usb/leogusbtower1,
  • I changed the permissions with sudo chmod 666 /dev/usb/leogusbtower1,
  • When I do echo "Hello!" > /dev/usb/legousbtower1 the tower blinks,
  • My version of NQC is 3.1 r6 from the Ubuntu repositories,
  • The tower works like a charm in a Windows XP virtual machine.

Because of the list above, I don't understand why I can't communicate with the RCX yet. Can somebody help me? Thank you.

  • what happens if you leave off the usb: prefix? – David Lechner Mar 13 '18 at 15:42
  • @David Lechner: Thanks, I still get the error with the prefix removed, I don't understand. – bcoueraud87 Mar 14 '18 at 19:31
  • 1
    I use sudo chmod 666 /dev/usb/legousbtower0 and nqc -Susb -firmware firm0332.lgo. What about to try -Susb only – TomasKulhanek Mar 16 '18 at 6:12
  • @TomasKulhanek: Thanks, but still not working :( I really don't understand. – bcoueraud87 Mar 16 '18 at 20:02
2

New here but I just had the exact same problem you did, I can't be 100% sure this solution will work for you, but given that I also used the ubuntu repo version of the software I imagine it will.

Around the web I found the syntax you use -Susb:/dev/usb/legousbtower1...but I don't think this actually works (beyond the -Susb part).

What I ended up doing was simply using -Susb, but the important part is that you not have legousbtower1 at all, but rather legousbtower0. To achieve this you can remove any usb device that gets enumerated before the usb tower from its slot, then reconnect the usb tower before reconnecting the other device. (it's probably a keyboard or a mouse, and it will be shown in the /dev/usb/ directory, possibly as a usbhid or human interface device). If this is not possible then you can probably find another way to enumerate it first, but that is beyond the scope of my answer.

The following is untested: My guess would be that the patch applied in the article here https://pbrick.info/2013/10/configuring-the-lego-usb-tower-on-linux/ does allow for the syntax you tried, but the version built for the repo simply hardcodes the path to /dev/usb/legousbtower0.

3

Just as an aside you can also do the following:

sudo ln -s /dev/usb/legousbtower1 /dev/usb/legousbtower0

That worked for me, and my challenge now is that there is no firmware :-)

0

All this above wasn't working for me. A short analysis with strace command showed that nqc called with -Susb:/dev/usb/legousbtower0 wants to open /dev/legousbtower0. Though a symbolic link solved the problem. I'm using fedora30, nqc version 3.1 r6.

PS: try to use -S/dev/usb/legousbtower0 wasn't successfull because then nqc seems to believe that device is a normal serial device.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.