Unable to connect Lego EV3 to Matlab via USB in Matlab R2017B

2 次查看(过去 30 天)
Matlab will not connect to my Lego EV3. I have two EV3 bricks, one with firmware 1.09H and the other with firmware 1.04H but fail to connect to Matlab with either. Latest versions (17.2.0) of Matlab and Simulink EV3 hardware support packages installed yesterday (in that order).
>> legoev3('usb') Error using legoev3 (line 308) Failed to connect to EV3 through USB. Please check your USB connection.
The USB connection is good since it operates the EV3 via the Lego Mindstorms (Labview) software. I also tried connecting via WiFi, which also works with the Mindstorms software, but not with Matlab. Suggestions?
  5 个评论
Bruce Abbott
Bruce Abbott 2018-1-30
There were some firmware and software updates since my original query; I do not know whether they are what has made the difference, but I am now able to establish a connection via WiFi. However, the connection routine often fails and has to be repeated until it succeeds. To get this far I (1) downloaded the latest version of the ev3 firmware, 109E (education version), available from https://education.lego.com/en-us/support/mindstorms-ev3/firmware-update. I also deleted the Matlab ev3 hardware support package and then downloaded it again, as it appears that the version I had was no longer the latest one. When making the connection in Matlab, make sure that you clear the workspace first of any ev3 object from a previous successful connection. Also, having your ev3 connected via the Mindstorms software will prevent Matlab from connecting. Finally, you may have to reboot your computer and/or WiFi router before the Matlab connection will establish. Due to the unreliability of the command, I have created a one-line Matlab script that just issues that command. In my case it looks like this: myev3 = legoev3('WiFi','192.168.0.14','00165347e3d9') Just keep executing the script until it succeeds. I then make sure the script I wish to run does not clear the workspace so that the ev3 object (myev3) is not cleared, thus preserving the connection.
Bruce Abbott
Bruce Abbott 2018-2-1
After installing the Simulink hardware package for the Lego EV3, I was no longer able to establish a WiFi link to the EV3. Uninstalling the Simulink EV3 package restored my ability to establish a WiFi connection using the Matlab EV3 hardware package. Whoever is tasked with maintaining these hardware support packages for EV3 (assuming there is such a person) needs to update them to work with the most recent firmware updates to the EV3 (currently 109E and 109H). I have read that the firmware's access via Telnet has been modified or blocked due to a vulnerability to malware infection via Telnet access.

请先登录,再进行评论。

回答(1 个)

Yu Li
Yu Li 2018-3-17
I connect by combintion of ‘USB' and 'Wifi’ simultaneously,There is no other way to do. by the way my firmware 1.09E. wish for help your work.
  2 个评论
Benjamin Cyr
Benjamin Cyr 2018-3-17
I was able to solve my issue in connecting with USB. I was using a Third Party Sensor (the HiTechnic Angle Sensor) with an ID that was not registered in the LEGO EV3 Support package. As far I as I understand, when MATLAB tries to connect, it goes through the IDs of the sensors that are connected to the EV3. Since it didn't recognize the 3rd Party ID, it would not connect. It would then give the very unhelpful error: 'Unable to connect'. I'm not sure if there is a better way to do it, but I had to modify the support package to include the ID for the new sensor in order to get it to connect. Then everything worked fine.
nathan guillou
nathan guillou 2018-10-13
Hello, I am facing the same issue : I want to use the Hitechnic Angle sensor but it doesn't work. Could you describe more precisly how you solved the issue ? thank you

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 MATLAB Support Package for LEGO MINDSTORMS EV3 Hardware 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by