# Dual Mode Bluetooth&#x20;

### Introduction

The Bluetooth module is a standard transparent transmission module, which sends serial port data to devices connected to Bluetooth.

You can wirelessly upload firmware or control the motion of the robot through a Bluetooth connection. You can even control the robot using our smartphone app [Petoi](https://docs.petoi.com/mobile-app/app-guide). We have included our official Bluetooth module in the standard robot kit. As shown below:

![](https://1565080149-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQ6a951Q6Jn1Zzt5Ajr-887967055%2Fuploads%2Fs6HZyEtmcwXU8c92e9Tb%2Fbluetooth.png?alt=media\&token=b421c7dd-e912-45df-8b6a-b019ff69c0a9)

### Connection with NyBoard

The connection between the Bluetooth module and the NyBoard is shown in the figure below, you need to plug the Bluetooth module into the 6-pin socket on the NyBoard. Note the pin order of the Bluetooth module. Once the battery is connected to the NyBoard, press and hold the button on the battery to power the robot. A blinking LED on the Bluetooth module indicates waiting for a connection.

![](https://1565080149-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQ6a951Q6Jn1Zzt5Ajr-887967055%2Fuploads%2FvLqMtwJuOZn273ojeJmi%2Fblue.jpg?alt=media\&token=f5855ef0-603f-403b-ae47-58745ed70d6f)

### Connect the dongle with your phone

You need to connect the dongle within the Petoi App, rather than your phone's system Bluetooth settings. On some phones, you need to grant Bluetooth and location services permissions to the app.&#x20;

A more detailed setup can be found in the [mobile app](https://docs.petoi.com/mobile-app/app-guide) section.&#x20;

### Connect the dongle with your computer

In your system's Bluetooth settings, search for a Bluetooth device name started with Petoi or Bittle, and connect. The default PIN for pairing is “0000“ or “1234”. After the pairing is successful, the system will assign a serial port name.

{% hint style="info" %}
On Mac, go to System Preference -> Bluetooth, find a device name started with Petoi or Bittle, and connect.&#x20;
{% endhint %}

![](https://1565080149-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQ6a951Q6Jn1Zzt5Ajr-887967055%2Fuploads%2F8xAsf4MGVm0wDSIW8LWj%2FMacBlue.JPG?alt=media\&token=9175be1d-aae8-4b97-893e-4d859673720d)

{% hint style="info" %}
On Windows, add the Bluetooth device in the system settings.
{% endhint %}

![](https://1565080149-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQ6a951Q6Jn1Zzt5Ajr-887967055%2Fuploads%2FDmayTzTJPEK8XUtZcxW9%2Fbluetooth-config01.png?alt=media\&token=309865b6-447f-48fe-84f0-8b39a03fa624) ![](https://1565080149-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQ6a951Q6Jn1Zzt5Ajr-887967055%2Fuploads%2Funm0me6cjTeExKsU01qb%2Fbluetooth-config02.png?alt=media\&token=df3f71f2-cfb3-4063-9dd4-580fc7cd7914)

![](https://1565080149-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQ6a951Q6Jn1Zzt5Ajr-887967055%2Fuploads%2FxmqMWrLKQrsJGdHwQjf9%2Fbluetooth-config_en03.png?alt=media\&token=cdf0f3a2-478f-4dcb-bd85-26f4a31272c0)

![](https://1565080149-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQ6a951Q6Jn1Zzt5Ajr-887967055%2Fuploads%2FFrEBZbRhjzlvDuVJ0VLV%2Fbluetooth-config04.png?alt=media\&token=5f47b2e2-99e5-4946-a77a-a91cfb3bc60e) ![](https://1565080149-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQ6a951Q6Jn1Zzt5Ajr-887967055%2Fuploads%2FhhzrmRlyTrL7gOOek7dx%2Fbluetooth-config-en05.png?alt=media\&token=4a9b6056-5504-446f-a33f-2b095a4b557a)

![](https://1565080149-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQ6a951Q6Jn1Zzt5Ajr-887967055%2Fuploads%2FaztKw8h1fPcUqKFdVl3O%2Fbluetooth-config06.png?alt=media\&token=725b0b84-0037-4875-8825-d97842d2d720)

![](https://1565080149-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQ6a951Q6Jn1Zzt5Ajr-887967055%2Fuploads%2FXsmIjdGZ7n5ZcBohRhCF%2FDevice_manager_Bt_en.png?alt=media\&token=952c23bf-6c4f-4787-9c47-2882412d8aed)

{% hint style="info" %}
For Win10 users, the system will assign the "incoming" COM port and the "outgoing" COM port to Bluetooth. Please use the "outgoing" COM port. For details, please check in the "More Bluetooth options" of Win10 as below:
{% endhint %}

![](https://1565080149-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQ6a951Q6Jn1Zzt5Ajr-887967055%2Fuploads%2FpmX29NIp849K36GYQ0NW%2FBluetooth_port_check01_en.jpg?alt=media\&token=f8446a22-eeaf-4add-bdba-43fe845cb817)

![](https://1565080149-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQ6a951Q6Jn1Zzt5Ajr-887967055%2Fuploads%2FWp4RslfL8wf9UMqinWeE%2FBluetooth_port_check02_en.jpg?alt=media\&token=1aa9b6a3-c4ef-4941-9d18-4076bee107a1)

You can then select it under **Tools**->**Port** in the Arduino IDE, using the same method as the USB uploader. After opening the serial monitor, please select: **No line ending**, and the baud rate is set to **115200**.

{% hint style="info" %}
The Bluetooth connection with the computer may occasionally drop. Keeping the serial monitor open can make it more stable. But note it will also occupy the port and block other applications that want to connect.&#x20;
{% endhint %}

### Configure the Bluetooth module

If you want to configure the Bluetooth module, please refer to "JDY-23 AT Command List". Plug the Bluetooth module into the USB adapter debugging interface. As shown below:

![](https://1565080149-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQ6a951Q6Jn1Zzt5Ajr-887967055%2Fuploads%2FpnZG7S3oivgaL8KFchLS%2FconfigBlue.jpeg?alt=media\&token=f3d91e78-d06d-4b1d-9abc-68ba9c2ffc74)

The commonly used commands are listed below:

| Usage                        | Command                                           | Demo                                                                                            |
| ---------------------------- | ------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| Check BT module version      | AT+VER                                            | <p>AT+VER</p><p>>+VER=JDY-23A-V2.21,Bluetooth V3.0+BLE</p><p>（BT module version infomation）</p> |
| Check BT broadcast name      | AT+NAME                                           | <p>AT+NAME</p><p>>+NAME=BITTLE</p>                                                              |
| Change BT broadcast name     | AT+NAME(name)                                     | <p>AT+NAMEPuppy</p><p>>+OK</p><p>AT+NAME</p><p>>+NAME=Puppy</p>                                 |
| Change BT BLE broadcast name | AT+NAM<mark style="color:red;">**B**</mark>(name) | <p>AT+NAMBPuppy</p><p>>+OK</p><p>AT+NAMB</p><p>>+NAMB=Puppy</p>                                 |
| Check serial baud rate       | AT+BAUD                                           | <p>AT+BAUD</p><p>>+BAUD=8 （8 = 115200， 7=57600）</p>                                             |
| Change serial baud rate      | AT+BAUD                                           | <p>AT+BAUD7</p><p>>+OK （Set serial monitor to 57600）</p><p>AT+BAUD</p><p>>+BAUD=7</p>           |

When you use the serial terminal like "Arduino serial monitor" to set JDY-23 with AT commands, you must set "**NL and CR**",  and the baud rate is set to **115200,** or the JDY-23 module will not identify any AT command you send.

![](https://1565080149-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fdocs%2F-MX5hN5QRCo1pe5MUiRr%2F-MX5he3vsd-zAJM-lcTT%2F2.png?generation=1617167821712441\&alt=media)

{% hint style="info" %}
If you are a developer, you can use Lightblue or other tools to connect the dongle's BLE service.
{% endhint %}
