Tuesday, July 29, 2014

Lego Mindstorms EV3: LeJOS and Groovy - how to get started!



I've recently given a workshop for Lego Workshop at Gr8Conf.eu and Gr8Conf.us this year showing how to integrate Groovy and Mindstorms together. I have slides available here, however they don't have a getting started (I pre-setup the robots and microSD cards before the workshop) tutorial: So how do I set  this up with my Lego EV3 I just ran home to buy after seeing this? Baruch Sadogursky (@jbaruch) asked me to write this post and and kindly offered to post the ISOs in Bintray so when people get home they are ready to roll with their Groovy Robots! here is the download link https://t.co/PEqmSYZNoI

Step 1: Buy a Edimax 7811un wireless adapter like this one. They are less than $10USD on Amazon and Newegg. Likely you don't find these at the local store. They are very tiny and cause least amount of issues with building the robots.

Step 2: Get a 2GB or larger microsd card. Delete all of the partitions. Create 2 partitions (I use gparted on Linux):
1) 477 MB fat32 partition
2) 600 MB ext2 partition

Use the dd command in linux (I think this will work with MacOSX too).
dd if= lejos-part1-fat32-477mb-lba.iso.iso (Get this from bintray) /of=/dev/XXXX

where XXX=destination device partition  (mounted on your computer)

Also
dd if=lejos-part2-ext2-600mb.iso (Get this from bintray) /of=/dev/XXXX

where XXX=destination device partition  (mounted on your computer)

If you SD card is larger, you can expand the 600MB partition to fill your SD card if you like without much risk.

Step 3: Check out my lejos fork:
git clone git://git.code.sf.net/u/ryanv78665/lejos u-ryanv78665-lejos

Step 4: build the "EV3GroovyTest" file with the following command:
'gradlew ":EV3GroovyTest:jar"

Step 5: Boot robot up with the Edimax adapter and setup on your wifi network using the menu.

Step 6: scp the jar (under EV3GroovyTest/build/libs) to root@x.x.x.x:/home/lejos/tools(fastest) or  /home/lejos/samples or /home/lejos/programs (safest)

Step 7: if you want to tweak ev3classes libs or DBusJava you can build those with gradle too, and update the jars on the sd card via SCP if you'd like.

Follow the slides for more in depth info!

Webrover1 repo: https://github.com/rvanderwerf/webrover1/

Bintray repo for ISOs: https://t.co/PEqmSYZNoI

Happy Groovy Roboting! Thanks @ALittleOfJoe for the robot selfie pic from the US workshop! And @rappelg for the robot pic.