NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
WL18xx TI Bluetooth Stack iBeacon Demo App
Return to WL18xx AM335x TI Bluetooth Stack
Demo Overview[edit]
Note: : This instructions can be used to run this demo on the AM335x Platform.
The iBEACON profile is used to provide a different way of location-based information and services. There are two roles defined in this profile, Server and the Client. Any time the Client is in range of the Server advertisements, it will be defined as iBEACON and with special applications it can trigger different behaviors.
This application allows the user to use a console to use Bluetooth Low Energy (BLE) to advertise specific data that can be read by the client.
It is recommended that the user visits the kit setup Getting Started Guide for AM335x pages before trying the application described on this page.
Running the Bluetooth Code[edit]
Once the am335x is initialized on the terminal, follow the instructions;
Note: When using a CC256x controller you will need to change the init script in order to enable BLE.
You can use the following command in the AM335x device terminal
cp -f /lib/firmware/TIInit_6.7.16_ble_on.bts /lib/firmware/TIInit_6.7.16.bts
Enter to the Sample Application folder, for this example “cd BluetopiaPM/bin”
root@am335x-evm:~# cd BluetopiaPM/bin/ root@am335x-evm:~/BluetopiaPM/bin#
Start the Server and the Demo application by typing “./SS1BTPM & ./LinuxIBeacon”
root@am335x-evm:~/BluetopiaPM/bin# ./SS1BTPM & ./LinuxIBeacon [1] 1789
Now the help screen is displayed
****************************************************************** * Command Options: 1) SetDevicePower 2) QueryDevicePower 3) QueryLocalDeviceProperties 4) SetLocalDeviceName 5) SetLocalClassOfDevice 6) SetIbeaconUUID 7) SetIbeaconMajor 8) SetIbeaconMinor 9) SetIbeaconTxPower 10) QueryIbeaconParams 11) StartAdvertising 12) StopAdvertising 13) EnableBluetoothDebug * Help, Quit. ******************************************************************
Demo Application[edit]
The demo application provides a description on how to use the demo application to connect two configured boards and communicate over bluetoothLE. The included application registers a custom service on a board when the stack is initialized.
iBeacon[edit]
- To verify iBeacon functionality, after running the "LinuxIBeacon" executable, powering on the local device if necessary.
- a) Powering up the Bluetooth device by typing “9 1” or "SetDevicePower 1”, if the device is already powered up you’ll receive an error that the device is already powered up
TI-BT>SetDevicePower 1 [14245.254296] (hci_tty): inside hci_tty_open (ecc4d3c0, ecf4a800) [14245.260484] (stc): chnl_id list empty :4 [14245.264549] (stk) : st_kim_start(stk) :ldisc_install = 1uim:poll broke due to event 10(PRI:2/ERR:8) uim:read 1 from install uim:@ st_uart_config uim: signal received, opening /dev/ttyS1 uim:@ set_baud_rate uim:set_baud_rate() done uim:Setting speed to 3000000 uim:@ read_command_complete uim: Command complete started uim:@ read_hci_event uim: read_hci_event uim:Command complete done [14245.427653] (stc): st_tty_open uim:Speed changing to 3000000, 1 uim:@ set_custom_baud_rate (stk) :line discipline installeduim:Installed N_TI_WL Line displine [14245.441729] (stk) :TIInit_11.8.32.bts uim:begin polling... (stk) :change remote baud rate command in firmware [14245.454597] (stk) :skipping the wait event of change remote baud[14246.210372] (stc): add_channel_to_table: id 4 [14246.214807] (stc): add_channel_to_table: id 2 [14246.219184] (stc): add_channel_to_table: id 3 BT COMM PORT (/dev/hci_tty): 1 DEVM_PowerOnDevice() Success: 0. TI-BT> Device Powered On. TI-BT>
- b) before changing any of the iBeacon parameters, use QueryIbeaconParams command to check the current parameters
TI-BT>QueryIbeaconParams IbeaconParams:: UUID:: E2C56DB5-DFFB-48D2-B060-D0F5A71096E0 Major:: 1 Minor:: 1 TX Power:: -59 TI-BT>
In order to change any of the parameters, you can use the following commands and using StopAdvertise and then StartAdvertise in order the enable the changes.
- c) SetIbeaconUUID
TI-BT>SetIbeaconUUID SetIbeaconUUID (Error): Invalid UUID format Usage: Example SetIbeaconUUID: E2C56DB5-DFFB-4848-D2B060D0F5A71096 Function Error. TI-BT>SetIbeaconUUID 12345678-1234-1234-1234567890123456 SetIbeaconUUID (Success): 12 34 ... 34 56 TI-BT>
- d) SetIbeaconMajor
TI-BT>SetIbeaconMajor SetIbeaconMajor (Error): Invalid Parameter Usage: Example SetIbeaconMajor: 1000 Function Error. TI-BT>SetIbeaconMajor 2345 SetIbeaconMajor (Success): 2345 TI-BT>
- e) SetIbeaconMinor
TI-BT>SetIbeaconMinor SetIbeaconMinor (Error): Invalid Parameter Usage: Example SetIbeaconMinor: 1000 Function Error. TI-BT>SetIbeaconMinor 9874 SetIbeaconMinor (Success): 9874 TI-BT>
- f) SetIbeaconTxPower
TI-BT>SetIbeaconTxPower SetIbeaconTxPower (Error): Invalid Parameter Usage: SetIbeaconTxPower [Byte] Function Error. TI-BT>SetIbeaconTxPower 30 SetIbeaconTxPower (Success): 30 TI-BT>
- g) In order to start advertising use StartAdvertising command and enter the Duration of the advertising.
TI-BT>StartAdvertising Usage: StartAdvertising [Duration]. Function Error. TI-BT>StartAdvertising 60 Local Device Properties changed. TI-BT> LE Advertising Started. TI-BT>DEVM_StartAdvertising() Success: Duration 60 seconds. TI-BT>
- h) In order to stop advertising use StopAdvertising command.
TI-BT>StopAdvertising Local Device Properties changed. TI-BT> LE Advertising Stopped. TI-BT>DEVM_StopAdvertising() Success. TI-BT>