- To ensure that testing connection did not fail intermittently, try to click the Test connection again.
- If Test connection fails consistently, check that the Bluetooth device appears on the host computer and that it is paired correctly. If not, follow the documentation on how to pair a Bluetooth device and retrieve the Bluetooth device address to pair your device - https://in.mathworks.com/help/supportpkg/arduinoio/ug/instructions-on-pairing-bluetooth-device.html
- If you are using HC-05 or HC-06, use the ‘bluetoothlist’ in the MATLAB Command Window, and check that the Bluetooth device address appears on the RemoteIDs properties of the object.
- For information on troubleshooting, Bluetooth 4.0 for the boards: Nano 33 BLE, Nano 33 BLE Sense, Nano 33 IoT, MKR1010, ESP32-DevKitV1, and ESP32-DevKitC see troubleshooting Bluetooth for low energy - https://in.mathworks.com/help/matlab/import_export/troubleshooting-bluetooth-low-energy.html
How do I ensure reliable Bluetooth connections using Arduino Hardware tools?
2 ビュー (過去 30 日間)
古いコメントを表示
I must be missing something as I'm adding HC-06 bluetooth connection to an Arduino Uno based robot. There are frequent intermittent connection failures with code that works well via USB to fail from what appears to be lost connections. I'm working with many students and need for reliable BT connections is important for robot navigation.
Current strategy:
- One file creates the arduino connection using an existing bluetooth connection - COM = 'KARBT'; myKAR = arduino(COM), after previously running via USB - COM = 'COM3'; myKAR = arduino(COM,'Uno','BaudRate',115200,'Libraries',{'Ultrasonic','Servo'}; - This is followed by code that configures pin assignments. See attached.
- The second file completes testing of the connected hardware. All pins are being used. Servo and Tone reserves pins D3 and D9. Included items: button input, LED output, Tone output, voltage input (battery, temp & light), SSR control, servo control, ultrasonic sensor, Motor driver x2.
The HC-06 devices are set to baud: 115200 with individual NAME and PINs assigned via AT commands. (This needs a better tutorial for the less familar).
Typical error: Error using NewArduinoConnection (line 11) Unable to connect to the Arduino board wirelessly. Call arduinosetup to configure the Arduino board.
Unpair and re-pair: same result
Power down/Power up BT: Shows as connected briefly, then same result.
====Other troubleshooting
Check bluetoothlist and setup for loop-back test: shows as ready to connect - apply hc06 = bluetooth("KARBT", 1) in command window. SUCCESS!
Test loop-back - clc; write(hc06, 1:10); numbers = read(hc06, 10), write(hc06, "helloworld"); text = read(hc06, 10, "string"), SUCCESS!
Also shows as connected in BT devices
====Same device back on Arduino after clear
>> myKAR = arduino('KARBT') - Unable to connect to the Arduino board wirelessly. Call arduinosetup to configure the Arduino board.
????
I need clarification on how to effectively create the connection Bluetooth using MATLAB Support Package for Arduino Hardware - I've read everything available and worked to make sure the HC-06 devices are configured and named for use @ 115200 Baud.
Ideas?
0 件のコメント
回答 (1 件)
Vidip
2024 年 1 月 22 日
I understand that you are facing intermittent connection failures with HC-06 Bluetooth modules when interfacing with an Arduino, to solve this issue you can follow certain steps –
If the Test connection fails while you are setting up Arduino hardware to use Bluetooth connection in the arduinosetup interface, try the following steps:
For further information, refer to the documentation links below:
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で MATLAB Support Package for Arduino Hardware についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!