Send AT commands over serial in code for BLE

Does anybody have experience with sending AT commands to a BLE module over serial? I am able to send AT commands to the module through the Serial Monitor, but whenever I try to do it through code, I never get a response back. Here is my code: // Whatever is entered in the serial monitor is sent to the HM-10// Anything - Pastebin.com
I am using a Seeedstudio XIAO with an HM-10.

Please post your code inline, using code tags as explained in the introduction threads.

Welcome to the forum. First, check the "how to use the forum" notes on the matter of posting code. I'm not going to fartarse around in paste bin, but I can assure you that you should have no problem configuring Bluetooth via code, rather than command from the monitor. About the worst that can happen with code is that you need to get it right with any CR/NL, which may in fact be to do nothing. I cannot be sure, but I believe
Serial1.print("AT+NAMEladedah"); //CHANGE NAME
worked on HM-10.
The only procedural matter is to ensure that Bluetooth is not in communications mode. If Bluetooth has been communicating, you need to get back to the default AT mode by interrupting its power supply. I believe this may be just a matter of resetting Arduino under software.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.