2.5 Remote Command Configuration

This section describes the procedure required to demonstrate the RNBD451 remote command feature. This feature allows the control of an RNBD451 module without the use of a host microcontroller remotely from either another RNBD451 module or a mobile application.

The remote command feature works by using a special BLE GATT service that emulates a wireless serial connection called transparent UART mode. This combined with a unique command set allows remote functionality of the module.

The remote command feature can be controlled by either RNBD451 module, or a mobile application.

For the first demonstration, two RNBD451 modules will be used. One will be called the Controller Module and the other will be Remote Module. The Controller Module is connected to the PC and is in control of the Remote Module. The Remote Module is connected to the PC for the status feedback.

Remote RNBD451 Module Configuration

Follow the below steps to configure the remote module

Step 1 ––– Enter command mode

Input Command: $$$

Expected response:CMD>

Step 2 ––- Set to Factory defaults

Input Command:SF,1<CR><LF>

Expected response: Reboot after Factory Reset<CR><LF>

%REBOOT%

Step 3 –– Enter command mode

Input Command: $$$

Expected response: CMD>

Step 4 –– Set name of module to "Remote"

Input Command:SN,Remote<CR><LF>

Expected response : AOK<CR><LF>

CMD>

Step 5 –– Enable device information and transparent and UART operation

Input Command: SS,C0<CR><LF>

Expected response : AOK<CR><LF>

CMD>

Step 6 –– Enable authentication/security

Input Command:SA,2,<CR><LF>

Expected response: AOK<CR><LF>

CMD>

Step 7 –– Set 4 digit PIN code

Input Command:SP,1234<CR><LF>

Expected response: AOK<CR><LF>

CMD>

Step 8 –– Save and reboot

Input Command:R,1<CR><LF>

Expected response: Rebooting<CR><LF>

%REBOOT%

Controller RNBD451 Module Configuration

Follow the below steps to configure the controller module

Step 1 ––– Enter command mode

Input Command: $$$

Expected response:CMD>

Step 2 ––- Set to Factory defaults

Input Command:SF,1<CR><LF>

Expected response: Reboot after Factory Reset<CR><LF>

%REBOOT%

Step 3 –– Enter command mode

Input Command: $$$

Expected response: CMD>

Step 4 –– Set name of module to "Controller"

Input Command:SN,Controller<CR><LF>

Expected response : AOK<CR><LF>

CMD>

Step 5 –– Enable device information and transparent and UART operation

Input Command: SS,C0<CR><LF>

Expected response : AOK<CR><LF>

CMD>

Step 6 –– Enable authentication/security

Input Command:SA,2,<CR><LF>

Expected response: AOK<CR><LF>

CMD>

Step 7 –– Set 4 digit PIN code

Input Command:SP,1234<CR><LF>

Expected response: AOK<CR><LF>

CMD>

Step 8 –– Save and reboot

Input Command:R,1<CR><LF>

Expected response: Rebooting<CR><LF>

%REBOOT%

Step 9 ––– Enter command mode

Input Command: $$$

Expected response:CMD>

Step 10 ––- Enter command to connect to the Remote module.

Input Command: C,0,<BDA><CR><LF>

Expected response: %CONNECT,0,xxxxxxxxxxxx,0071%%PHY_UPDATED,0071,02,02%%NOTI,0057,001400F710%%STREAM_OPEN%

Step 11 –- Enter command mode

Input Command: $$$

Expected response:CMD>

Step 12 –- Issue Bonding

Input Command: B<CR><LF>

Expected response: AOK<CR><LF>

CMD< %BONDED%%SECURED%

Step 13 –– Enter remote command mode

Input Command: !,1<CR><LF>

Expected Response: RMT>

Now the the RNBD451 Controller Module is in Remote Command mode of the RNBD451 Remote Module.

Remote Command mode testing

Now with the above steps the remote command mode is successfully configured.

Now lets try to control the RNBD451 Remote module with some sample example sections

Example 1

In this example the remote RNBD451 module will "Dump" its information like BDA Address, the module name, connection status, security settings,Enabled features and enabled services

Input Command: D<CR><LF>

Expected Resposne: BTA=3481F4AE0EA8

Name=Remote

Connected=FC0FE7801521,0

Authen=2

Features=0000

Services=C0

RMT>

Example 2

In this example the name of RNBD451 remote module will be returend to the Controller Module.

Input Command: GN<CR><LF>

Expected Resposne: Remote

RMT>

Example 3

In this example the firmware version of RNBD451 remote module will be returend to the Controller Module.

Input Command: V<CR><LF>

Expected Resposne: RNBD451 V1.0.0.10 Jul 20 2022 (c)Microchip Technology Inc

RMT>

NOTE: To exit Remote Command mode

Input Command: $$$

Expected response:CMD>

The CMD>indicate the remote command mode is turned off and the RNBD451 Controller device entered into command mode.

Remote command control from mobile appplicaiotn

In this section we will see how to control the remote module from the Microchip Bluetooth Data application using remote command mode control feature.

The most important step here is to make sure that a secure, bonded connection exists between Remote RNBD451 module and mobile. The steps captured below showcases the Microchip Bluetooth Data app in ios platform

First step here is to configure the remote RNBD451 device

Remote RNBD451 Module Configuration

Step 1 ––– Enter command mode

Input Command: $$$

Expected response:CMD>

Step 2 ––- Set to Factory defaults

Input Command:SF,1<CR><LF>

Expected response: Reboot after Factory Reset<CR><LF>

%REBOOT%

Step 3 –– Enter command mode

Input Command: $$$

Expected response: CMD>

Step 4 –– Enable device information and transparent and UART operation

Input Command: SS,C0<CR><LF>

Expected response : AOK<CR><LF>

CMD>

Step 5–– Enable authentication/security

Input Command:SA,2,<CR><LF>

Expected response: AOK<CR><LF>

CMD>

Step 6 –– Set 4 digit PIN code

Input Command:SP,1234<CR><LF>

Expected response: AOK<CR><LF>

CMD>

Step 7 –– Save and reboot

Input Command:R,1<CR><LF>

Expected response: Rebooting<CR><LF>

%REBOOT%

Microchip Bluetooth Data App configurations

Step 1 ––– Open the Microchip Bluetooth Data(MBD) app in ios device and click on BLE UARTsub app
Step 1 ––– In the new page, select PIC32CXBZ subapp
Step 3 –- Click on the START option to intiate the scanning.
Step 4 –– Click on the the remote device to which the connection needs to be established.
Step 5 –- Remtote device got connected. Click on the settings option on the right top corner of the connected page.

Upon connection following log will be displayed in the remote device. %CONNECT,2,XXXXXXXXXXXX,0072%%SECURED%%PHY_UPDATED,0072,02,02%%STREAM_OPEN%%PHY_UPDATED,0072,02,02%%CONN_PARAM,0010,0000,0048,0072%

Step 6 –– Scrool down and select the Remote Command Mode option.

Upon selecting the Remote Command mode option an pop up window opens up reminding about secure and bonded connection necessesity for the remote command mode to work.

Click on OK

Step 7 –– Intiate bonding from the Remote device by typing the B<CR><LF> command after entering int command mode.

This action initiate a pairing request to MBD app. Click on Pair
Step 8 –- Ener the same passkey(1234) set on the remote device under the PIN Code section and press Send

The remote command mode is successfully configured with the response RMT_CMD_ON

Step 9 –- Type the ASCII command that need to be ran on the remote device under thte Remote Control Command (ASCII) section an click Enter.

This respond back with the firmware version running on the Remote Module.