Bluetooth connection to Android App: How to send continuous data using Simulink?

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?
Mobile Phone: +1 248-996-3379 Email: contact@jorgechagas.com

댓글 수: 2

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

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 General Applications에 대해 자세히 알아보기

질문:

2014년 7월 10일

댓글:

2017년 2월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by