TI Bluetooth Mesh Host PC Tool¶
This section describes the functionality of the Bluetooth Mesh Host PC Tool features and provides a list of APIs eRPC uses to interface with Bluetooth Mesh.
Overview¶
The PC host application is a Python based tool created using the Embedded Remote Procedure Call (eRPC) system which is an open source Remote Procedure Call system. This application acts as the host processor with the goal of providing the option of getting started and performing the operations of the BLE Mesh examples.
Running Bluetooth Mesh Host PC Tool¶
This section covers the required libraries and installations prior to running the Host PC tool. In addition, it covers the steps on how to get the Host PC tool running on a PC.
Installation¶
Install Python version 3.7.6.
Download Python installer from: https://www.python.org/downloads/release/python-376/
Note
Utilize the Windows x86-64 executable installer.
Install eRPC.
Navigate to <SDK_ROOT>/source/third_party/erpc/erpc_python
Install Python library enum34 using the following command:
pip install enum34
Install Python library pyserial using the following command:
pip install pyserial
Install the eRPC packages by using the following command:
python setup.py install
Running Tool¶
Navigate to the location of the Host PC tool at <SDK_ROOT>/examples/rtos/ CC26X2R1_LAUNCHXL/ble5stack/mesh_app_python.
Run the ble_mesh_erpc_app script.
Open up a terminal such as Git Bash.
Run the ble_mesh_erpc_app script using the following command:
python ble_mesh_erpc_app.py
At this moment, if not already running, flash a CC26x2 device with the simple_mesh_node example project. ERPC uses UART2 on the device side. Ensure that simple_mesh_node is compiled with “Network Processor Mode” enabled in SysConfig as seen in Figure 157. in order to work with the host.
Determine the COM port the simple_mesh_node device is connected to. Enter the COM port when prompted as seen in Figure 158.
Note
When entering the device serial port name, include the phrase “COM”. For example, for a simple_mesh_node device connected to COM port 13, enter “COM13”.
Utilize the command menu seen in Figure 159. to select the proper commands needed.
Host PC Tool APIs¶
This section describes the APIs available on the Host PC Tool and the mapping of the APIs to the ones provided on the Bluetooth Mesh project. Upon the Host PC Tool startup and connecting to the correct device serial port, the following menu Figure 159. will appear in the terminal. Table 33. details these command descriptions.
Command |
API Description |
Bluetooth API Mapping |
---|---|---|
Mesh init and unprovisioned beacon |
Initialize Mesh data and call mesh_prov_enable to enable specific provisioning bearers |
bt_mesh_prov_raw_init bt_mesh_init_comp_raw_init bt_mesh_init_elem_raw_init bt_mesh_cfg_srv_raw_init bt_mesh_health_srv_raw_init bt_mesh_init_model_raw_init bt_mesh_init bt_mesh_prov_enable |
Mesh Init and static provisioning |
Initialize Mesh data and do static provisioning |
bt_mesh_prov_raw_init bt_mesh_init_comp_raw_init bt_mesh_init_elem_raw_init bt_mesh_cfg_srv_raw_init bt_mesh_cfg_cli_raw_init bt_mesh_health_srv_raw_init bt_mesh_init_model_raw_init bt_mesh_init bt_mesh_provision |
Mesh Init and load from NV |
Initialize the Mesh data and load from NV |
bt_mesh_prov_raw_init bt_mesh_init_comp_raw_init bt_mesh_init_elem_raw_init bt_mesh_cfg_srv_raw_init bt_mesh_health_srv_raw_init bt_mesh_init_model_raw_init bt_mesh_init settings_load |
Mesh load provisioning information from NV |
Call the Zephyr settings module load API settings_load |
settings_load |
Mesh is provisioned |
Check if the local node has been provisioned by calling bt_mesh_is_provisioned |
bt_mesh_is_provisioned |
Mesh Prov Enable |
Enable specific porivisoning bearers by calling bt_mesh_prov_enable ADV and GATT bearers. |
bt_mesh_prov_enable |
Mesh Reset |
Reset the state of the local Mesh node by calling bt_mesh_reset |
bt_mesh_reset |
Mesh Generic OnOff Client Menu |
Initialize and start the generic on/off client Menu Screen |
This command opens additional menu. For Bluetooth API mapping, please see the Generic OnOff Menu Commands and Bluetooth APIs table |
Mesh VND Model Menu |
Initialize and start the VND model example Menu Screen |
This command opens additional menu. For Bluetooth API mapping, please see the VND Menu Commands and Bluetooth APIs table |
Mesh find model index |
Find a SIG model in a specific element |
bt_mesh_model_find |
Mesh find vnd model index |
Find a VND model in a specific element |
bt_mesh_model_find_vnd |
Mesh LPN set |
Toggle the Low Power feature of the local device |
bt_mesh_lpn_set |
Mesh LPN poll |
Send out a Friend Poll message |
bt_mesh_lpn_poll |
Mesh PROXY Identity enable |
Enable advertising with Node Identity |
bt_mesh_proxy_identity_enable |
Generate Fault on Health server (for testing only) |
Used for adding a new fault to the fault array of the health server model, only used for testing purposes |
bt_mesh_fault_update |
Quit |
Exit menu application |
Figure 160. will appear when choosing command 8. Mesh Generic OnOff Client Menu on the main menu. Table 34. details the these command descriptions.
Command |
API Description |
Bluetooth API Mapping |
---|---|---|
Mesh Generic OnOff Client get msg |
Get Gen OnOff State |
bt_mesh_model_send_data |
Mesh Generic OnOff Client set msg |
Set Gen OnOff State |
bt_mesh_model_send_data |
Mesh Generic OnOff Client set msg with transition |
Set Gen OnOff State with Transition |
bt_mesh_model_send_data |
Mesh Generic OnOff Client set unack msg |
Set Gen OnOff Unacknowledged State |
bt_mesh_model_send_data |
Mesh Generic OnOff Client set unack msg with transition |
Set Gen OnOff Unacknowledged State with Transition |
bt_mesh_model_send_data |
Back |
Return to upper menu screen |
Figure 161. will appear when choosing command 9. Mesh VND Model Menu. Table 35. details the these command descriptions.
Command |
API Description |
Bluetooth API Mapping |
---|---|---|
Mesh VND LED ON |
Call VND Model API led_on |
led_on |
Mesh VND LED OFF |
Call VND Model API led_off |
led_off |
Mesh VND Notify LED Status |
Call VND Model API notify_led_status |
notify_led_status |
Mesh VND Get LED Status |
Call VND Model API get_led_status |
get_led_status |
Mesh VND Send Large MSG |
Call VND Model API vnd_large_msg |
vnd_large_msg |
Back |
Return to upper menu screen |