Bluetooth connection to Android App: How to send continuous data using Simulink?
Mostrar comentarios más antiguos
I am working in an autonomous car project, and I am responsible for the HMI integration. Basically, I have to retrieve information from our Simulink model, and send it via Bluetooth to the Android App I developed.
Regarding the APP, everything properly works. I'm able to establish connection, open the server and client sockets and retrieve information.
However, I'm facing problems with the basic Bluetooth commands on MatLab. I've followed the steps of this tutorial: http://www.mathworks.com/help/instrument/reading-and-writing-data-over-the-bluetooth-interface.html
When I use the function: fopen(bt), MatLab prompts the following error message: Error using icinterface/fopen (line 83) Unsuccessful open: Cannot connect to the device. Possible reasons are another application is connected or the device is not available.
Then, I chose a different smartphone(I was previously using a Galaxy S3), and I could open the connection. Nonetheless, when I tried to write and send data through the function: fwrite(bt,int8([2,0,1,155])); the error message was, due to the fact that I wasn't able to open a connection: Error using icinterface/fwrite (line 193)
I'm sure that I strictly followed the tutorial, and the devices were paired before I started writing the scripts. Therefore, which possible solution I can use in order to fix it?
2 comentarios
Divyendu Narayan
el 24 de Jul. de 2016
Hi Jorge
Can you please let me know if you got solution to this problem? I am facing some similar issue with Matlab bluetooth connectivity.
Thanks Divyendu
sampath R
el 4 de Feb. de 2017
I had the same problem. I then downloaded "bluetooth SPP" app on my android mobile. The point is to activate and use it in SPP mode. It worked for me then.
Respuestas (0)
Categorías
Más información sobre General Applications en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!