8/24/2023 0 Comments Arduino bluetooth dongle tutorial![]() To test the BC127 with a smartphone's audio Bluetooth, the BC127 needed to be set to discoverable by issuing the following command: DISCOVERABLE ON To ensure that the BC127 was set to sink, the following commands were issued: set classic_role=0 To view if the name has been saved after reset, the following command was issued: get nameĪs a result, the BC127 responded with the configuration parameter and value: name=BlueTank1750 It will respond with the "ERROR" notification. Note: If you add a space between the "=" sign for the command, the BC127 will not recognize the command. The following commands were issued: set name=BlueTank1750 To set the name of the BC127 from the default BlueCreation-XXXXXX to a custom name, the manual indicated that a set command needed to be issued with the configuration parameter equal to the new value. I decided to name the Bluetooth "BlueTank1750". Next up was setting up the audio Bluetooth's name to make it easier to recognize. The BC127 should respond with an "OK" after each command: restore Make sure to press "Enter" on a keyboard when typing the commands and the serial terminal was not sending additional characters. In order to send a command, a carriage return was required. Just in case, the BC127 was restored to its default state with the commands listed below. Once the FTDI was connected to a computer using a mini-B USB cable and the drivers were installed, the commands were tested through a serial terminal set at 9600 baud, 8-data bits, no parity, 1-stop bits, and no flow control. ![]() Keep in mind that the micro-B USB connector on the Purpletooth Jamboree development board is used for firmware upgrades and they are connected to the USB data pins of the BC127.įor advanced users, you can also use a microcontroller with a serial passthrough code to configure. if (Serial.Note: This is only one way to connect to the device. If there are, send that information via Bluetooth to the connected device. In the first if statement, we check if there are bytes being received in the serial port. In the loop(), send and receive data via Bluetooth Serial. SerialBT.begin("ESP32test") //Bluetooth device name loop() By default it’s called ESP32test but you can rename it and give it a unique name. Initialize the Bluetooth serial device and pass as an argument the Bluetooth Device name. In the setup() initialize a serial communication at a baud rate of 115200. Then, create an instance of BluetoothSerial called SerialBT: BluetoothSerial SerialBT setup() #if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED) The next three lines check if Bluetooth is properly enabled. The code starts by including the BluetoothSerial library. This code establishes a two-way serial Bluetooth communication between two devices. Serial.println("The device started, now you can pair it with bluetooth!") SerialBT.begin("ESP32test") //Bluetooth device name #error Bluetooth is not enabled! Please run `make menuconfig` to and enable it and also demonstrate that SerialBT have the same functionalities of a normal Serial This example creates a bridge between Serial and Classical Bluetooth (SPP) This example code is in the Public Domain (or CC0 licensed, at your option.) ![]() Open your Arduino IDE, and go to File > Examples > BluetoothSerial > SerialtoSerialBT. Mac and Linux: instructions – ESP32 Board in Arduino IDE.Windows: instructions – ESP32 Board in Arduino IDE.We’ll program the ESP32 using Arduino IDE, so make sure you have the ESP32 add-on installed before proceeding:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |