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 Comments

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.

Sign in to comment.

Answers (0)

Categories

Find more on General Applications in Help Center and File Exchange

Products

Asked:

on 10 Jul 2014

Commented:

on 4 Feb 2017

Community Treasure Hunt

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

Start Hunting!