MonoBrick EV3 Firmware

The MonoBrick EV3 firmware is a firmware replacement that allows you to program and debug the EV3 brick using the open source .Net framework called Mono. This let’s you program the EV3 in .Net compatible languages such as C#, F# and IronPython. Since the firmware fits on a single SD card you simply boot the MonoBrick firmware directly from the SD card without replacing the standard firmware.

As programs are executed on the Mono Framework programs can be written/compiled on Windows, Linux or Mac OS using either Xamarin Studio or Microsoft Visual Studio. The firmware supports all the features listed below.

  • Support for all Retail and Educational LEGO sensors – Example
  • Support for a number of HiTechnic sensors – Example
  • Motor support including speed, timer and power profiles – Example
  • Motor PID position controller – Example
  • Motor synchronisation – Example
  • Vehicle support - Example
  • Draw graphics on the LCD - Example
  • Write text to LCD including support for custom fonts - Example
  • LCD Screenshot dump to BMP file - Example
  • Build in Menu and Dialog support – Example
  • Detect when sensors are attached/detached – Example
  • SQLite support – Example
  • Button event support
  • Button LED support
  • USB support
  • Easy to use UART, I2C and analog sensor base classes
  • Automatic firmware updates over the internet
  • and more..

Getting started

It is fairly easy to get started with the MonoBrick firmware. All you have to do is to follow these steps:

If you want to use Visual Studio you can use this Visual Studio template created by Max Mustermann (rememeber to replace the firmware dll with the one from the download link) or create a new console project with a reference to the downloaded dll and use this guide on manually transfering programs to the EV3.

All guides related to the MonoBrick firmware can be found here

Sample Program

Below the sample program for the color sensor is shown. The program let’s you chose between the different color modes and print the sensor value to the LCD.

using System;
using MonoBrickFirmware;
using MonoBrickFirmware.Movement;
using MonoBrickFirmware.Display;
using MonoBrickFirmware.Sensors;
using MonoBrickFirmware.UserInput;
using System.Threading;
namespace ColorSensorExample
{
class MainClass
{
  public static void Main (string[] args)
  {
        EventWaitHandle stopped = new ManualResetEvent(false);
        ColorMode[] modes = {ColorMode.Color, ColorMode.Reflection, 
                             ColorMode.Ambient, ColorMode.Blue};
        int modeIdx = 0;
	    var sensor = new EV3ColorSensor(SensorPort.In1);
	    ButtonEvents buts = new ButtonEvents ();
		
	    buts.EscapePressed += () => { 
	        stopped.Set();
	    };
        buts.UpPressed += () => { 
	        LcdConsole.WriteLine("Sensor value: " + sensor.ReadAsString());
	    };
	    buts.DownPressed += () => { 
			LcdConsole.WriteLine("Raw sensor value: " + sensor.ReadRaw());
		};
		buts.EnterPressed += () => { 
			modeIdx = (modeIdx+1)%modes.Length;
			sensor.Mode = modes[modeIdx];
			LcdConsole.WriteLine("Sensor mode is: " + modes[modeIdx]);
		};  
		stopped.WaitOne();
	}
  }
}

Support and documentation

The MonoBrick EV3 firmware has its own forum where you can find answers and questions related to the EV3 firmware. Be sure to check out the documentation and source code examples before posting questions in the forum.

Contributors

The MonoBrick firmware is written and maintained by Lars Jeppesen and Anders Søborg. The Xamarin Studio Add-in is written by Bernhard Straub.

Source code

MonoBrick firmware is open source and can be found at these Github repositories. Here you will also find source code for the samples found on the firmware image.

Acknowledgment

The MonoBrick firmware image is based on the image created by the LeJOS Team. Without their hard work the MonoBrick firmware would never have seen the light of day… Thank you!

8 comments on “MonoBrick EV3 Firmware
  1. Hello mister Soborg,

    thank you very much for your valuable work!

    I am a teacher in a technical school and would like to experiment with my students your software platform.

    I have a question to submit:

    I tested the MonoBrick EV3 Firmware with NetGear WNA1000 WiFi / USB dongle that has the same chipset dell’Edimax EW-7811Un but does not work (does not connect to the WiFi network).

    Could it be a problem with the vendor/product identifiers (VID_0846&PID_9040)?
    MonoBrick EV3 Firmware performs this type of control on the WiFi dongle like the original LEGO firmware?

    Do you have any suggestion / advice about solving this problem?

    Thanks in advance.

    Prof. Daniele Trevisani
    I.T.I. “Copernico-Carpeggiani”
    Ferrara – Italy

  2. This is an amazing project. I have been playing with your code and firmware, everything works well so far.

    Some questions, specifically about the web server example. Can you provide some instructions on how to ‘publish and deploy’ the web server example to the brick. How do you deploy the files to the brick, can it be run under the debugger on the brick, and how do you start the web server and XSP server on the brick.

    I am a bit of a novice, but I have setup Mono and XSP on a couple of different linux machines. I am used to publishing my project via visual studio then copying to the target machine to /var/www/mysite or /usr/share/nginx.

    The folder structure of the mono brick firmware is strange compared to debian or cents.

    Thank you for this great website.

  3. Author Image Alexander Papsdorf says:

    Hi there,

    the links for downloading the firmware and the DLL seem to be inactive. I tried it with differnet browsers (IE, Firefox, Safari), but I could not download the software.
    Can anybody help me? Is there another loaction from which I could download the software?

    Thanks in advance

    Alex

  4. You can now download the images from a different site: ftp://soborg.net

    /Anders

  5. Author Image Lalith Shashank says:

    I have a challenge which i’m not able to do with LEGO stock firmware. I have two EV3 bricks. Both are communicating via Bluetooth to perform a task. I call them master and slave.

    I observed that, for Bluetooth, an EV3 with lego stock firmware can connect to only one device at a time. With monobrick, is it possible for the master to connect both to My PC and also the slave EV3?

    If not, is there a way with MONOBRICK, where EV3 can send realtime data and display it in my C# GUI application? I have a wifi dongle, is it possible to send messages over wifi dongle into my PC with monobrick firmware, despite having Bluetooth communication among two bricks.

    Basically, I am making an aircraft scanner, where an arm which is placed on a tank, is controlled by the Master and the tank is controlled by the slave when ever master sends move message. While scanning, I would want to display Color sensor data. Is this all possible with monobrick? If so, how can I do it?

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Xamarin Add-in

Xamarin Add-in1450 downloads

Download DLL

Screenshots

Make a donation