LEGO EV3 + Matlab/Simulink + WiFi: the Ubuntu experience

Facebooktwitterredditpinterestlinkedinmail


[In English]

Nuestros queridos LEGO NXT han cumplido más que suficiente con su misión, así que este año nos hemos pasado a la nueva versión del robot, la EV3.

Eso significa que ya no podemos programar los robots en NXC usando BricxCC, que en mi opinión formaban una combinación estupenda: software libre y programación en C, muy adecuada para alumnos de grados de Ingeniería Informática. Tras evaluar diferentes posibilidades, hemos decidido usar Simulink para programarlos. Y, por ahora, echo en falta dos cosas importantes, que me hacen pensar que la vida con el NXT era mejor (enorme suspiro):

  • En primer lugar, no hay soporte para trabajar con Matlab/Simulink usando el EV3 conectado con el USB en Ubuntu. Francamente, no entiendo esta decisión.
  • En segundo lugar, la conexión del EV3 con Matlab/Simulink usando wifi no es nada sencilla. Centrándome en el tema de la wifi, a continuación resumo las pruebas que he realizado hasta el momento, junto con la información que he recopilado preparando las mismas. El resumen corto es que no hay forma de trabajar con la wifi en Ubuntu y hay que irse a Windows; si estoy haciendo algo mal y un alma caritativa me saca de mi error se lo agradecería 🙂

Los dongles wifi que he probado son el Netgear 300 (el único que Lego recomienda es el Netgear 150, pero ya no se encuentra fácilmente), el Edimax N150 (que en muchas webs aparece como compatible con el anterior), y un TPLink que he encontrado en el laboratorio y del que desconozco el modelo. El EV3 necesita conectarse a un router. Con los tres dongles he podido conectarme al router de casa, pero sólo con el Netgear 300 y el Edimax los ordenadores que he empleado han sido capaces de detectar el robot (basta con hacer un ping desde el ordenador a la IP del EV3), así que todo lo que sigue se refiere a los dos primeros.

Algunas de las pruebas han requerido cambiar el firmware del EV3. Los diferentes firmware que he utilizado son las siguientes: 1.03 (descargable desde aquí), 1.03 adaptada para el dongle Edimax (descargada de aquí , aparece como 1.04 cuando se descarga en el robot), y 1.08 (descargada de aquí).

La tabla recoge todas las configuraciones de software que he probado junto con el resultado obtenido. Las figuras se incluyen al final de la entrada.


[En español]

Our beloved LEGO NXT have heroically fulfilled their mission, so this year we have moved on to the new version of the robot, the EV3 robot.

This means that we no longer can program the robots  in NXC using BricxCC, which in my opinion made a perfect match: open source software and C based programming, very suitable for students of Computer Science bachelors. After evaluating different options, we have chosen Simulink for programming the robots. And, for now, I miss two main things which make me think that life was better with the NXT (massive sigh):

  • To begin with, it is not possible to work in Ubuntu with Matlab/Simulink using the EV3 connected via USB. Frankly, I do not understand this decission.
  • Secondly, it is not easy to connect EV3 with Matlab/Simulink using WiFi. Focusing in the WiFi issues, in the following I sum up the tests I have done so far, along with the information I have gathered while preparing those tests. The short summary is that there is no way to work with the WiFi using Ubuntu and you have to move to Windows; if I am doing something wrong and some charitative soul takes me out of my mistake I would really appreciate it 🙂

The WiFi dongles I have tried are the Netgear 300 (the only that Lego supports is the Netgear 150, but it cannot be easily found nowadays),  the Edimax N150 (many webpages report that it is compatible with Netgear 150), and a TPLink  that I found in the lab (I unfortunately do not know the model). EV3 has to connect to a router. The three dongles connected the robot to my home router, but only Netgear 300 and Edimax 150 assured that my laptops could detect the robot (with a ping from the laptop to the EV3’s IP), so all that is explained in the following only refers to the first two dongles.

Some of the test required changing the firmware of the EV3. These are the firmwares I have used: 1.03 (available here), 1.03 adapted for the Edimax dongle (available here , it is numbered as 1.04 when downloaded into the robot), and 1.08 (available here).

The table shows all the software configurations I have tried along with the obtained result. Figures are included at the end of the post.

 

Fig 1.- WiFi error with Matlab R2015a

Fig 2.- WiFi error with Matlab R2016b

Fig 3.- Gcc error with Simulink R2016b