LEGO Mindstorms programming with ev3dev

4 readers like this.
One bike ahead of the pack

Opensource.com

I was introduced to LEGO Mindstorms eighteen months ago while applying for a STEM grant at a local library. LEGO Mindstorms are kits to create customizable, programmable robots.

As I researched the product I discovered that the EV3 brick, which is at the core of the Mindstorms robots, runs on Linux. Despite that, all of the coding software distributed with the project runs on Windows, OS X, iOS, and Android. I found an open source project that allowed the EV3 brick software to be modified, ev3dev. ev3dev is an open source project that allows the Mindstorm user to create a Debian-based operating system (OS) that boots from a microSD card. Once the EV3 brick boots the Debian image, the user can interact with the EV3 via SSH using the command line in a terminal window.

The ev3dev site has a great Getting Started with ev3dev guide.

David Lechner is the lead developer for the project, and I had a chance to ask him a few questions. David's background is a bachelor's degree in electrical engineering from Oklahoma State, then he spent the next eight years doing industrial automation in the water and wastewater industry. Recently, for the last four years he's been doing freelance computer programming for primarily open source projects, such as ev3dev.

I asked him how the ev3dev project got started and he said his inspiration came from a blog post by Ralph Hempel, the founder of the EV3dev project. Being a tinkerer at heart, David couldn't resist. He said, "Even though I had no idea what I was doing, I jumped right in and started learning how to write kernel drivers (I had to start with "Hello World" in C because I didn't have any experience with the language) and how to maintain Debian packages and all sorts of other things that are needed to make an operating system." Fortunately for him he was in a position that allowed him to focus his efforts on that task. It wasn't long before Ralph realized that David had more time to devote and he made him a co-maintainer of the project.

I asked David how many people are involved with the project and he said, "It's hard to say exactly. Since LEGO robots are just a hobby for most people, we have quite a few people that show up for a weekend or two and then disappear. However, I would say that we have somewhere between 5 and 10 contributors that have been with us long term." I asked him if the project would consider allowing younger people to be involved since Mindstorm robots are used in so many schools. He said, "Of course. Unfortunately, at this point in time, we don't have much to offer that is very kid-friendly for younger students. Hopefully some day. On the other hand, it would be great to work with high school and/or college students that have just a little bit of programming experience already." He said that a potential developer in the project should not be frightened by lack of experience as he himself was very inexperienced when he got involved with ev3dev.

David said he enjoys working with students and has taught some after-school NXT robotics classes. He is currently serving as a coach of a First LEGO League team. I asked him what his most pressing needs are in the short term, and he said, "I would really like to see some other contributors that are willing to spend a significant amount of time making ev3dev better before the next generation LEGO Mindstorms robot comes along and everyone moves on to that. Perhaps some university students could make some aspect of ev3dev their senior design project, or companies that develop Mindstorms-compatible products could adopt ev3dev as a platform instead of developing their own."

When asked about his longterm goals, he said, "I would like to get our hardware drivers into the mainline Linux kernel. Jason Kridner (of BeagleBone) and Greg Kroah-Hartman (of The Linux Foundation) have been pushing me to do this in the short term. But, there is quite a bit to be done to even get the EV3 bootable from the mainline Linux kernel before we even get to the ev3dev-specific bits." David encourages users of ev3dev to try it and let the project know how they can improve, and let them know ideas that will yield iterations to the project.

To get started with your own ev3dev experience you need a LEGO Mindstorms Home or Education kit, the EV3 brick, and a 2GB or larger microSD card. Go to the ev3dev website and download the latest Debian Jessie image file. Download Etcher for your particular operating system to transfer the image to your microSD card, then after the image is on your card insert it into your EV3 and power on the unit. Follow the directions on the ev3dev website. Connect to the EV3 with the USB cable that comes with your kit and start having some fun.

The ev3dev source code is on GitHub, and is licensed under the GPLv2.

This Rubik's Cube solution is an example of a project based on ev3dev: Python Rubik's Cube Solver

User profile image.
Educator, entrepreneur, open source advocate, life long learner, Python teacher. M.A. in Educational Psychology, M.S. Ed. in Educational Leadership, Linux system administrator.

2 Comments

My kids are in a first lego league. I wish they have a version of the mindstorm software that ran on Linux. It really frustrates me that Lego felt Linux was good enough to run their robots but they didn't feel the need to give back to the community by supplying a version of mindstorm for Linux.

That might change in the future given who they have working in development for them. We can always hope. In the meantime EV3Dev is looking for help to make your dream a reality.

In reply to by Fargo (not verified)

Creative Commons LicenseThis work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.