Send at commands to bluetooth

Configuring Bluetooth module using AT commands

In the previous project, how Bluetooth module can be configured to operate in Order Response Work Mode was discussed. The previous project also detailed the AT commands available for the HC-05 Bluetooth module. The AT commands can only be used in Order Response Work Mode. The AT commands are very useful and can be used to change or set multiple control parameters of the module. In this project, some of the AT commands will be used and tested. The project will demonstrate using AT commands to change device name, password, mode and baud rate of the module. In the end of the demonstration, the default settings will be restored using the AT commands.

The circuit used for testing AT commands is similar to the circuit in the previous project. The Bluetooth module is interfaced to an Arduino Pro Mini and the Arduino board is connected to a computer. The AT commands are passed to the Arduino board through a hyper terminal application which is further passed to Bluetooth module serially by the Arduino board. The responses from the Bluetooth module are in turn serially read by the Arduino board and passed to the Hyper Terminal application for display on the desktop.

The Arduino Pro Mini manages to send AT commands and send back responses by controlling serial communication between the Bluetooth module and the computer. The Arduino sketch for this is written on Arduino IDE and burnt to the board using AVR Dude.

Источник

Comprehending AT Commands

To improve your device usage, it is recommended to read the manuals. However, based on the information provided, it seems like there may be an issue with the AT commands. Can you please clarify how to apply incoming AT commands on phone-B to execute the intended actions? Specifically, I am trying to establish Bluetooth connection between an Android device and another mobile phone over Handsfree profile. While I can successfully send commands as a String from phone-A to phone-B using input/output streams, I am uncertain of how to execute the incoming AT commands on phone-B.

Understanding AT commands?

I connected a mobile device to an Android device unit, however, certain AT commands are not providing the expected response.

""" I get an incoming call to the paired phone then i executed random commands" AT+BLDN AT+CLCC AT+CMOD 

After reading some information about AT commands, I’m still unsure whether these commands are executed from the device to which the phone is paired or from the paired phone side. In case of problems with AT command response, it’s unclear whether the issue lies with the phone or the Android device.

Читайте также:  Управление моторами ардуино через блютуз

Your device processes AT commands, which are not only understood by BT modules, but also by other modules such as WiFi (ESP8266 or GSM modules.

Typically, your chip reads, interprets, and executes them.

Sending AT commands as a Bluetooth payload is possible. However, it is not a widely adopted practice.

To provide a conclusive answer, it is crucial to have a complete understanding of the interaction between your device and phone. This will enable us to determine whether the issue solely lies with your device or if it is related to the phone.

Consultation of the manuals for your device can be beneficial. However, based on the information you have provided, it appears that incorrect usage of the AT commands may be the issue.

Bluetooth — How to Send AT commands to Android, I am also able to make a Bluetooth connection between these phones using the HandsFreeProfile by using the following UUID for connection: private …

Arduino Bluetooth AT commands HC 05 HC 06

$2 for 2-Layer PCBs & $5 for 4-Layer PCBs: https://jlcpcb.com/PCHStart Altium designer FREE TRIAL : https://www.altium.com/yt/diyguychrisThis is a full expl

HM10 BLE BLUETOOTH Module Part 1 -AT Commands

HM10 is BLE 4.0 BlueTooth LOW Energy module built on Texas CC2541 soc.In this first part we shall explore the AT commands with the ORIGINAL HM10 …

BT05 HM-10 AT Command

Connecting Arduino to BT05 Bluetooth Low Energy (BLE).BT05 is one of many compatible module of HM-10.It has a liitle different AT- Command code …

How to send AT commands based on BT Hands-Free profile in android?

My objective is to create a connection (Bluetooth connection) between an Android device and another mobile phone through the Handsfree profile. To achieve this, I am utilizing the subsequent code.

private static final UUID MY_UUID = UUID.fromString("0000111F-0000-1000-8000-00805F9B34FB"); // UUID for Hands free profile // Some code. // Get Bluetooth Adapter. m_oBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); // Some code. // For paired BT device, getting a connection established. if(null != m_oBluetoothDevice) < if(BluetoothDevice.BOND_BONDED == m_oBluetoothDevice.getBondState()) < try < m_oBluetoothSocket = m_oBluetoothDevice.createRfcommSocketToServiceRecord(MY_UUID); m_oBluetoothSocket.connect(); Log.i(TAG, "Socket Connected"); >catch(Exception e) < if(null != m_oBluetoothSocket) < Log.i(TAG, "Closing socket"); try < m_oBluetoothSocket.close(); >catch (Exception e1) < Log.i(TAG, "Error while closing socket : " + e1.getMessage()); >> > > > 

Using this code, it is possible for me to generate an RFCOMMSocket.

Читайте также:  Ноутбук звук через bluetooth

I am considering sending AT commands based via Bluetooth Hands-Free profile. This would allow my Android device to reject incoming phone calls on other mobile phones by sending the command «+CHUP». However, I am uncertain if this is a feasible option.

Currently, I find myself at a standstill as I have perused through Bluetooth APIs and encountered the following information —

 BluetoothHeadset.ACTION_VENDOR_SPECIFIC_HEADSET_EVENT 

Is it possible to utilize this Intent for transmitting AT commands? Is the AT command related to the Bluetooth Hands-Free profile identified as Proper way to send? I’m seeking assistance and guidance from anyone who can provide it.

Any contribution made by all of you would be immensely beneficial to me.

In order to communicate with the phone, it is essential to generate both InputStream and OutputStream.

mmInStream = m_oBluetoothSocket.getInputStream(); mmOutStream = m_oBluetoothSocket.getOutputStream(); 

To initiate the HFP connection, you begin by sending:

mmOutStream.write("AT+BRSF=20\r".getBytes()); 

The number 20 represents your endorsement of HFP.

And to read from the phone:

buffer = new byte[200]; mmInStream.read(buffer); command = new String(buffer).trim(); 

You can now communicate between the devices and find detailed information about the Handsfree profile at https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=238193.

Adding reference to AT commnads

Check out the discussion thread at XDA-Developers website with the URL: http://forum.xda-developers.com/showthread.php?t=1471241.

Here’s a document available at http://www.zeeman.de/wp-content/uploads/2007/09/ubinetics-at-command-set.pdf.

The Bluetooth Protocol Architecture, Service Discovery Protocol (SDP) − SDP takes care of service-related queries like device information so as to establish a connection between …

AT commands to hm10 over bluetooth with android

I am currently working on a project and would like to inquire whether it is feasible to send AT commands to an HM-10 BLE device from an Android app via Bluetooth without utilizing a microcontroller. If so, can you please provide instructions on how to do so?

In case someone attempts this in the future, it is possible to send a simple string «AT\r\n» to hm-10, which will prompt it to respond with OK.

How to Send AT commands to Android phone?

By utilizing the BluetoothChat example (input/output stream), I am able to establish communication between two android phones that are connected via Bluetooth.

By utilizing HandsFreeProfile , I can establish a Bluetooth connection between the phones with the assistance of UUID for connectivity.

 private static final UUID MY_UUID = UUID.fromString("0000111F-0000-1000-8000-00805F9B34FB"); // UUID for Hands free profile 

I am trying to send AT commands from Phone-A to Phone-B. I can successfully send the command as a String (using input/output streams) and receive it on Phone-B. However, I am unsure of how to execute the received AT command on Phone-B and make it perform the desired action.

I have read about the intent

android.bluetooth.BluetoothHeadset.ACTION_VENDOR_SPECIFIC_HEADSET_EVENT 

I am unsure about the method of sending AT commands to the phone as using the intent requires sending EXTRAS and CATEGORY, which I am uncertain about. The Android website provides an excerpt as an example for the above intent.

Читайте также:  Периферийные устройства блютуз установка драйверов

This particular intention is equipped with one category and four additional features.

The Bluetooth device remote is referred to as EXTRA_DEVICE. In regards to vendor-specific headset events, there is an AT command type known as EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_CMD_TYPE, which can be classified as one of the following: AT_CMD_TYPE_READ, AT_CMD_TYPE_TEST, AT_CMD_TYPE_SET, AT_CMD_TYPE_BASIC, or AT_CMD_TYPE_ACTION. Additionally, there are command arguments associated with EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_ARGS.

It would be greatly appreciated if someone could assist me and provide information on:

  1. Can AT commands be reliably sent between 2 android phones in this way
  2. Post some code to demonstrate how to do this?

See my answer on this question:

Is the Android BT Hands-Free profile the basis for How to send AT commands?

I hope that was the response you were seeking.

BT05 HM-10 AT Command, Connecting Arduino to BT05 Bluetooth Low Energy (BLE).BT05 is one of many compatible module of HM-10.It has a liitle different AT- Command code …

Источник

How to Send AT commands to Android phone?

I have 2 android phones connected with each other via Bluetooth and am able to communicate between them using the BluetoothChat example (using the input/output stream) I am also able to make a Bluetooth connection between these phones using the HandsFreeProfile by using the following UUID for connection:

 private static final UUID MY_UUID = UUID.fromString("0000111F-0000-1000-8000-00805F9B34FB"); // UUID for Hands free profile 

Now I want to send AT commands to one phone(Phone-B) from the other(Phone-A). I can send the command from phone-A to phone-B as String (using input/output streams) and receive it by the phone-B, but I do NOT know how to apply the incoming AT command on phone-B i.e. I don’t know how to make phone-B do what AT command wants it to do. I have read about the intent

android.bluetooth.BluetoothHeadset.ACTION_VENDOR_SPECIFIC_HEADSET_EVENT 

but I’m not sure how to use this to send AT commands to the phone coz to use the intent some EXTRAS and a CATEGORY needs to be sent and I’m not sure what to send in those. For example below is the excerpt from the android website for the above intent: *This intent will have 4 extras and 1 category.

EXTRA_DEVICE — The remote Bluetooth Device EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_CMD — The vendor specific command EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_CMD_TYPE — The AT command type which can be one of AT_CMD_TYPE_READ, AT_CMD_TYPE_TEST, or AT_CMD_TYPE_SET, AT_CMD_TYPE_BASIC,AT_CMD_TYPE_ACTION. EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_ARGS — Command arguments.*

  1. Can AT commands be reliably sent between 2 android phones in this way
  2. Post some code to demonstrate how to do this?

Источник

Оцените статью
Adblock
detector