Error when running programme on external Android

4 visualizaciones (últimos 30 días)
Kiat Nern Yeo
Kiat Nern Yeo el 7 de Jun. de 2019
Comentada: Kiat Nern Yeo el 19 de Jun. de 2019
Hello all
I have encountered this error repeatedly, without being able to find a solution at all.
The test app by MATLAB Connector works perfectly fine.
The applications i create are able to run when uploaded using "deploy to hardware"
However, when the play button is pressed, the following error is obtained, as a result, i cannot read my android's sensor data in my MATLAB PC.
""
Error occurred while executing External Mode MEX-file 'ext_comm': Failed to connect to the target. Possible reasons for the failure: a) The target is not switched on. b) The target is not connected to your host machine. c) The application for the model is not running on the target. You might have clicked the Stop button. If the Run button is not dimmed, click it. Otherwise, click the Build button, which downloads and runs your application on the target. Caused by: An error occurred attempting to open an rtIOStream. More detail may be reported in the MATLAB command window
""
Any help is greatly appreciated.
Thank you !

Respuesta aceptada

Kiat Nern Yeo
Kiat Nern Yeo el 10 de Jun. de 2019
Hi Sir
Yes i have used both the simulink display block, and the android data display, and have also set the mode to external and run time to inf.
Both these signals are coming out from the same android sensor block.
Best regards
  5 comentarios
Sruthi Yenugula
Sruthi Yenugula el 11 de Jun. de 2019
Please contact MathWorks technical support, they will help you resolve this issue.
Kiat Nern Yeo
Kiat Nern Yeo el 11 de Jun. de 2019
Ok got it. Will call them. Thank you very much !

Iniciar sesión para comentar.

Más respuestas (2)

Sruthi Yenugula
Sruthi Yenugula el 7 de Jun. de 2019
Hi,
Use this link to run the external mode
Make sure your device and pc are connected to same wifi network when running external mode.
  1 comentario
Kiat Nern Yeo
Kiat Nern Yeo el 19 de Jun. de 2019
Yup i got it. The solution is to make sure that both devices are connected to the same private and secured network !

Iniciar sesión para comentar.


Kiat Nern Yeo
Kiat Nern Yeo el 9 de Jun. de 2019
Hi Sir. Thank you for replying
I have went through the example and the app can indeed be deployed onto my phone, and the sensor values can be read within my phone's screen.
However, it still does not show up in simulink's scope or display blocks.
I have also performed androidhwsetup, and the test app can run.
The USB cable is also always attached, and both the phone and computer are connected to the same private network.
I also have the proper android driver installed, along with the required android studio SDK and NDK.
Is there something that i could have missed ?
Best regards sir.
  2 comentarios
Sruthi Yenugula
Sruthi Yenugula el 10 de Jun. de 2019
To see the results in Simulink, you should run the model in external mode, make sure the simulation time is set to inf by default it is 10s. Use display block(not android data display ) of Simulink block is see the data in Simulink.
Kiat Nern Yeo
Kiat Nern Yeo el 19 de Jun. de 2019
Yup i got it. The solution is to make sure that both devices are connected to the same private and secured network !

Iniciar sesión para comentar.

Categorías

Más información sobre Simulink Support Package for Android Devices en Help Center y File Exchange.

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by