BLE write to Arduino Nano 33 BLE is unsuccessful
Show older comments
Hello,
I am trying to communicate with a Arduino Nano 33 board using BLE. I have created BLE service and characetristic with read and write capability on the Arduino board. I can read from the characteristic into MATLAB, but when I try to write to it nothing is received on the Arduino. It works fine when I use a BLE app on my Android phone, and I can read or write without any issue. I have used the BLE toolbox in the past to communicate with Adafruit's Bluefruit LE and it worked fine. So, I am not sure if this an Arduino issue or MATLAB. I am using MATLAB R2020a on Windows 10PC. Any suggestions?
Here is a code snippet I use to write to the BLE -
Thanks,
-NB
bleobj = ble("BLEname")
ble_Characteristic = characteristic(bleobj,"19B10000-E8F2-537E-4F6C-D104768A1214","19B10001-E8F2-537E-4F6C-D104768A1214");
write(ble_Characteristic, WirelessMsg, "uint8");
...
val = read(ble_Characteristic);
Accepted Answer
More Answers (1)
Menghan
on 12 Aug 2020
0 votes
Hi Nikunj,
If you use BLEWrite in Arduino sketch, you can call characteristic write function with the "withresponse" parameter. This is an optional parameter and should default to "withresponse" if not specified. It is however not the case in current code, hence a bug.
Menghan
Categories
Find more on MATLAB Support Package for Arduino Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!