Home / Robots / EV3 / Breathtaking: Debian Wheezy on the EV3!

Breathtaking: Debian Wheezy on the EV3!

Ralph Hempel is no stranger to MINDSTORMS and he’s been quietly working on something very special: a port of Debian Wheezy on the EV3.  The folks of the Debian organisation wouldn’t let him use the Debian name (for copyright reasons), so this project is called ev3dev.

What is ev3dev?

It’s a complete Linux distribution for the EV3.  What do I mean by complete?  Well, it has a Linux 3.3.0 kernel, a proper file system, a package management system (apt, dpkg, etc.).  You can easily keep it up to date with online repositories for Embedded Debian.  You can run (almost) anything on the EV3 you can imagine. You could even install Apache, PHP and Postgresql and host your blog on there.  I doubt you’ll get any kind of performance, but it’ll install at least.  You could, if you were the patient kind, put a compiler on there and compile programs for the EV3 on the EV3 in an editor running on it as well.  How would you like a fully automated network sniffer in the shape of a robot that waves its arms about excitedly whenever it has cracked a WEP or WPA password?

The serial console output

Starting up

What is this? A console for ants?ev3dev runs from SD card.  I would recommend you create it on a class 10 card.  I am using a 4GB class 4 right now and it’s very slow.  Instructions on how to install it can be found here: [LINK].  I hooked up a serial console cable doodad, like the on here: [LINK].  When you power on the brick, you’ll be presented with a bunch of kernel output, followed by the init process and finally a login prompt like the one above.

A very cool touch was the teeny tiny login screen on the actual LCD.  It’s barely readable but it’s fun to see.

You can login with either root (pass: r00tme) or ev3dev (pass: 3v3d3v).  I would advise you to change it as soon as you login.

When you’re in, you can explore the system.  Currently, all driver are compiled into the kernel, so there are no modules.  I am sure as time progresses, we’ll see many improvements and enhancements made to ev3dev, including loadable modules.  This will also make it much easier to add your own additional drivers, without recompiling all of the kernel.

I made some small modification to the WPA2 setup.  Rather than putting all the configuration info in /etc/network/interfaces, I put it all in /etc/wpa_supplicant.conf.  That seemed “cleaner” to me.

root@ev3dev:~# cat /etc/network/interfaces 
auto lo 
iface lo inet loopback

auto wlan0 
iface wlan0 inet dhcp 
    wpa-conf /etc/wpa_supplicant.conf

root@ev3dev:~# cat /etc/wpa_supplicant.conf 
ctrl_interface=/var/run/wpa_supplicant 
network={ 
       ssid="Your SSID Here" 
       scan_ssid=1 
       proto=WPA RSN 
       key_mgmt=WPA-PSK 
       pairwise=CCMP TKIP 
       group=CCMP TKIP 
       psk="Your text key here" 
}

This also makes it easier to add a second WiFI network.

I have a Sitecom Wi-Fi USB Adapter N150 (WLA-1100), which doesn’t seem to work out of the box, even when the right drivers are compiled in.  This is probably because the USB IDs were not know at the time the driver was written.  No worries, though, Linux has a mechanism for adding additional USB ids to drivers.  To have these added when the dongle is plugged in, you need create a udev rule file:

root@ev3dev:~# cat /etc/udev/rules.d/95-sitecom.rules 
SUBSYSTEM=="usb", ATTRS{idVendor}=="0df6", ATTRS{idProduct}=="006b", RUN="/etc/udev/scripts/sitecom.sh"

This instructs udev to start a script called sitecom.sh whenever a device with that that specific USB ID is inserted.  The script does the following:

root@ev3dev:~# cat /etc/udev/scripts/sitecom.sh 
#!/bin/sh 
/bin/echo "0df6 006b" > /sys/bus/usb/drivers/r8712u/new_id

Voltage level in your bash prompt!Pretty simple, right?  I rebooted and the dongle was detected and configured without a problem.  Note, you may experience weird connectivity issues with your dongle when the voltage in your battery starts getting low, at least that was my experience.  It would be super cool if you could add the current battery voltage in your bash prompt.  Maybe even have it change colour from green to orange to red, depending on the levels.

The future of ev3dev (and how you can help)

Ralph is busy working on the kernel drivers that will make it possible to interface with the various hardware in there.  I believe he has motor control and various other bits and pieces working already and will be uploading those shortly.  If you’re keen to contribute, why not take a peek at the four Git repos that he’s made:

ev3dev – Assorted scripts to build the kernel and rootfs, format a microSD card, install the distribution on the card and customize the rootfs. Download this repository regardless of which operating system you have.

ev3dev-rootfs – A copy of all the files you’ll need to install on the microSD card. Download this repository regardless of which operating system you have.

ev3dev-kernel – The source for the kernel. You don’t need to download this unless you are going to actually build the kernel. It’s a lot easier to just get the kernel image from the ev3dev repo.

ev3dev-modules – The source for the LEGO MINDSTORMS EV3 drivers. You don’t need to download this unless you are going to build the modules, or you want to know a bit more about how the drivers work. The pre-compiled modules are already in the ev3-rootfs repository.

I’ll write more about ev3dev when I’ve had a little more time to play with it.  This is pretty awesome stuff, great job Ralph!

You can find all of Ralph’s ev3dev related posts here: [LINK].

About Xander

Xander Soldaat is a Software Engineer and former Infrastructure Architect. He loves building and programming robots. He recently had the opportunity to turn his robotics hobby into his profession and has started working for Robomatter, the makers of ROBOTC and Robot Virtual Words.