Connecting RCX tower directly to EV3

This is where you talk about the EV3 hardware related topics such as the brick, sensors, LEGO pieces, etc.

Moderators: roger, gloomyandy, skoehler

Connecting RCX tower directly to EV3

Postby hugheaves » Tue Feb 11, 2014 6:31 pm

I'm probably the only person who cares, but I thought I'd let everyone know that I've ported the old RCX tower code to run directly on the EV3. With the ported code, it's possible to plug an RCX tower directly into the EV3 and use it to communicate between the two. The tower can also be used to receive commands from the old 16-button RCX remote. I've only tested with the USB tower, but it _should_ work with a serial tower with a USB/serial adapter as well.

From a technical perspective, I converted the old libirtrcx code into "pure java" on top of PureJavaComm / JNA. So, the native libraries are no longer needed. What _is_ needed, however, is the legousbtower.ko kernel module to support the USB tower. The kernel module is not currently included in the 0.5.0-alpha distribution, but it's easy to install.

My question is, is there any interest in adding this support into the main Lejos distribution? Right now, the code is a "stand alone" library on top of lejos, and duplicates a lot of code from the main distribution.

One issue is that the RCX communication classes in the main distrubtion (lejos.remote.rcx.*) are hard coded to use a concrete class ( lejos.hardware.device.RCXLink) which only supports the NRLink. There would need to be some refactoring to allow the RCX comm classes to work with other implementation layers.

If there's interest, I could put together a patch to lejos. Otherwise, I'll just publish the "standalone" code "as is" for anyone that might want it.

Hugh
hugheaves
New User
 
Posts: 16
Joined: Sun Dec 29, 2013 5:35 pm

Re: Connecting RCX tower directly to EV3

Postby lawrie » Tue Feb 11, 2014 10:38 pm

Well done, getting all that working. I wrote the lejos.remote.rcx code, and still have a couple of RCXs, a USB and a serial tower, and an RCX remote. I also wrote some of the original leJOS RCX code.

I would be interested in making your code part of the main leJOS distribution, but as you say, I doubt if there will be a great deal of interest,
lawrie
leJOS Team Member
 
Posts: 919
Joined: Mon Feb 05, 2007 1:27 pm

Re: Connecting RCX tower directly to EV3

Postby hugheaves » Fri Feb 14, 2014 3:44 am

Yeah, probably nobody other than me will ever use it, but I enjoy hardware hacking, even if it's on obsolete hardware. :) Also, my whole motivation for this is to be able to "slave" my RCX to my EV3 to make it easier to use my old 9V motors and sensors. (at least for stationary models - its hard to imagine an EV3/RCX/Tower bohemouth rolling around :) Sometimes the micro motors, 9V gear motors, and smaller sensors fit nicely into places that the EV3/NXT stuff won't fit.

BTW, your LLC code (in the firmware and Java code) is functioning very well. I've been "tuning things up" in the original PC side tower code (making more agressive use of non-blocking IO), and am able to get about 20ms single byte round trip times to the RCX with ~100% reliability. That's really quite amazing for a 2400bps half duplex IR connection, and says a lot for the design of the original hardware / firmware.

Hugh
hugheaves
New User
 
Posts: 16
Joined: Sun Dec 29, 2013 5:35 pm

Re: Connecting RCX tower directly to EV3

Postby hugheaves » Sat Feb 22, 2014 11:47 pm

Ok, I've pushed the sourecode for the RCX tower support to my git repo. The code is under the rcxcomm directory of lego.git:

Browse URL:
https://www.hugheaves.com/gitweb/lego.g ... r:/rcxcomm

Clone via HTTP:
git clone https://www.hugheaves.com/git/lego.git

Also, here's a small patch to the EV3 repo that enables support for the legousbtower.ko kernel module. It changes the kernel config and adds a config file for modprobe.d that sets some timings to more optimal values than the default:

https://www.hugheaves.com/gitweb/ev3.gi ... 210ae57204

Here is the lejos RCX code (latest from CVS) patched to use the new rcxcomm. (Basically, just replaces pcrcxcomm.jar with my version). This just makes it a little easier to use the command line tools and eclipse plug-in as no native libraries are required:

ttps//www.hugheaves.com/gitweb/lejos_rcx.git (Changed URL so as not to hit "URL limit" of forum)

In the end, I decided not to merge all this stuff into the EV3 tree as the package names would need to be changed, but it was easier to backport without changing them.

No need to do anything with it, but if you have time (and think it's worthwhile) to merge the legousbtower.ko patch, that would be helpful to me. :)

Thanks,
Hugh
hugheaves
New User
 
Posts: 16
Joined: Sun Dec 29, 2013 5:35 pm


Return to EV3 Hardware

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff