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 UART, I2C and analog sensors
  • Support for all LEGO sensors that comes with the Retail and Educational sets
  • Support for a number of HiTechnic sensors
  • Motor support including speed, timer and power profiles
  • Motor PID position controller
  • Motor synchronisation
  • Vehicle support
  • Draw graphics on the LCD
  • Write text to LCD including support for custom fonts
  • LCD Screenshot dump
  • Button support
  • Button LED support
  • WiFi tested with the NetGear WNA1100 and the Edimax EW-7811UN dongles
  • USB support
  • 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 simply download the firmware dll and 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

The MonoBrick EV3 firmware has its own forum where you can find answers and questions related to the EV3 firmware.

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!

6 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. Please post this question in the forum. Thanks

    Anders

  3. Author Image Sunil says:

    Hi – I cannot download the EV3 firmware from http://www.monobrick.dk/software/ev3firmware/ site. Can you please check if there is a problem with the server hosting the firmware files.
    Thanks in advance for your help.

    Regards,
    Sunil

  4. 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.

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-in184 downloads

Download DLL

Screenshots

Make a donation