EV3.14

Jump to: navigation, search

Introduction

EV3.14 (pronounce "EV π") is an alternate firmware for the Lego EV3 brick developed for educational and research purpose at the ICube laboratory, University of Strasbourg, France. The original author was Maximilien LESELLIER. The current maintainer of this project is Jacques GANGLOFF.

The source code of this firmware is based on the original Lego firmware. It has been modified to support quad-precision encoder counting, -10000 to +10000 motor voltage control range, and USB distant control through a simple protocol. Furthermore, the way motor voltage is controlled and encoder value is acquired has been modified to drastically decrease latencies. Some bugs in the original firmware have also been corrected.

With the EV3.14 firmware, the EV3 brick behaves like a USB peripheral. Benchmarks show that the USB host can communicate with the EV3.14 at a maximal rate of 1000Hz.

So the typical usage of this firmware is with the EV3 brick connected to a host, a desktop PC or an embedded system like the Raspberry Pi (the name EV3.14 comes from there). Since the Raspberry Pi can be powered by the USB port of the EV3, the combination EV3.14+Raspberry Pi can be a powerful, flexible and autonomous setup to design varieties of robotics systems. An example code is given that explains how to communicate with the EV3.14. Multiple EV3.14's can be accessed simultaneously by the same host.

Note that the RPIt project now supports the EV3.14 firmware. With it, you can control multiple EV3s directly with Matlab/Simulink in external mode.

Releases

Version number Release date Download link Release notes Author
1.2 June 23th, 2016 ev3.14-1.2.tgz (~300MB) Avoid rare case of hang at shutdown. Jacques Gangloff
1.1 Apr. 27th, 2016 ev3.14-1.1.tgz (~300MB) LED of the light sensor ON by default. Minor bugfixes. Jacques Gangloff
1.0 Dec. 3th, 2014 ev3.14-1.0.tgz (~300MB) Initial public release Jacques Gangloff, Maximilien Lesellier

Installation

Prerequisites

  • You will need a recent Debian-based Linux machine (Debian or Ubuntu).
  • Install required packages by entering: sudo apt-get install build-essential libusb-1.0-0-dev u-boot-tools
  • On a 64 bits system, install 32 bits libraries support. On Ubuntu, this should be done by default. On Debian: sudo dpkg --add-architecture i386 and then sudo apt-get install libc6:i386 or sudo apt-get install libc6-i386

WiFi configuration

With this firmware you can use WiFi dongles based on Realtek's RTL8188CUS chipset like:

  • The Edimax EW-7811Un
  • The TP-Link TL-WN723N

To configure WAP2 access:

  • Go into the install/fs/etc directory
  • Edit the wpa_supplicant.conf file (nano wpa_supplicant.conf)
  • In the follwing fields input the SSID of your hotspot and the password in clear text:
network={
        ssid="Your SSID goes here"
        psk="The password in clear text"
        key_mgmt=WPA-PSK
        proto=RSN
        group=CCMP
}
  • Save and exit the editor.

Compiling EV3.14

  1. Download the latest version of EV3.14
  2. Extract the archive on a Linux system by entering tar zfxv ev3.14-x.y.tgz
  3. Go into the ev3.14-x.y/install directory
  4. Enter make all

This will cross-compile the kernel, the modules handling EV3 peripherals and the main program called ev314. The compilation lasts some time (approximately 5 minutes on an average machine). It should go smoothly up to the end, when you will be prompted to enter the superuser password. The last stage needs root privilege in order to flash the firmware on a SD card.

Flashing a SD card

At the end of the compilation procedure, a script called flash_sdcard.sh is launched. If you don't want to flash a SD card now, you can end this script with [CTRL-C]. Later, you can launch manually this script by entering ./flash_sdcard.sh. This script is straightforward. You will be asked for the name of the device corresponding to your SD card reader. Be warned that a mistake could yield the lost of all data on the corresponding device. This is why some characteristics of the target device are printed before going further. The SD card (in fact a microSD card) capacity should be at least 4 GB. When the flashing is finished, you can safely remove the SD card from the reader and put it into the EV3.

Booting EV3.14

When you boot the EV3 with a bootable microSD card in the slot, the boot loader looks for a kernel on this device. Then, the kernel mounts the root partition from the SD card. Booting from a SD card on the EV3 takes approximately the same time than booting on the internal flash memory. At the end of the EV3.14 boot procedure a splash screen indicates that the ev314 program has started. The LED switches from static red to static green and some indications are displayed on the screen (encoder values, sensor measurements, current motor voltage). These data are refreshed at a slow rate (approximately 3Hz) and some delay may exist between the change of the real value and the corresponding update of the screen.

Usage

EV3.14 user interface

  • Buttons:
    • Enter button: toogles the release/brake mode for the motors
    • Exit button: halts the system
  • LEDs:
    • Motors in brake mode:
      • Static green: watchdog activated
      • Blinking green: watchdog deactivated. USB remote control active (at least 3.3 packets per second).
    • Motors in floating mode:
      • Static orange: watchdog activated
      • Blinking orange: watchdog deactivated. USB remote control active (at least 3.3 packets per second)
    • Pulsing orange: battery level under warning level (~30 minutes remaining before critical)
    • Pulsing red: battery level under critical level (~20 minutes remaining before halt)

EV3.14 USB interface

You can communicate to the EV3 through USB with a pretty simple protocol. Connect one end of a USB cable to the EV3 and the other end to your Linux system.

In order to be able to open the EV3 USB device with user rights, create a file called 99-EV3.rules with the following content: ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0694", ATTRS{idProduct}=="0005", GROUP="users", MODE="0666"

Move this file in the folder /etc/udev/rules.d as root by entering: sudo mv ./99-EV3.rules /etc/udev/rules.d

Enter the following commands to setup the rights and ownership of this file:

sudo chown root.root /etc/udev/rules.d/99-EV3.rules
sudo chmod 644 /etc/udev/rules.d/99-EV3.rules

Go into the folder called ev314/source on the Linux machine. Compile both example by issuing the following commands:

gcc -Wall -o ev314_test_usb_com_single ev314_test_usb_com_single.c -lrt -lusb-1.0
gcc -Wall -o ev314_test_usb_com ev314_test_usb_com.c -lrt -lusb-1.0

If you have more than one EV3 connected to your Linux box, you can launch ev314_test_usb_com. If you have only one EV3 connected, you can use ev314_test_usb_com_single. These codes are self-explanatory and could be a starting point for a more complex interaction with the EV3.14.

The code of these two exmaples is given under the links below. There is also a header file that needs to be present in the same directory.

Telnet access

  • To log into your EV3 with telnet:
    • Issue the command: telnet <IP address of the EV3>
    • You will get this greeting form the EV3:
Trying <IP address>...
Connected <IP address>.
Escape character is '^]'.

 _____       _     _ ___
|  _  |_ _ _| |___| | __|
|    _| | | . | . | | _|
|__|__|___|___|___|_|_|

Rudolf 2011.01 EV3

login:
  • Then:
    • Log in as "root". At the password prompt simply hit [ENTER].
    • If you want to configure a password for the root account, type "passwd".
  • To activate ssh:
    • On the EV3 prompt type /etc/init.d/dropbear start
    • After that, you will be able to scp files on the EV3 with scp <my_file> root@<IP address of the EV3>:<directory>