Other Parts Discussed in Thread: CC2340R5, CC2564
Tool/software:
Hi Expert,
I'm using LP-EM-CC2340R5 connecting to my ubuntu desktop. And got few problems when using ble_controller example firmware:
#1 Fail to initial CC2340R5 via script when usning command "advertise on". It's strange that command is workabel vi bluetoothctl but failure when using script via pipe. for failing script like that:
#!/bin/bash
DEVICE="${1:-/dev/ttyACM0}"
echo "Using device: $DEVICE"
sudo hciattach "$DEVICE" any 115200 &
sleep 2
echo -e "discoverable on\n" | bluetoothctl
sleep 1
echo -e "discoverable-timeout 0\n" | bluetoothctl
sleep 1
echo -e "system-alias EnGenius0V4111\n" | bluetoothctl
echo -e 'menu advertise\nname EnGenius0V4111\ntx-power on' | bluetoothctl
sleep 1
echo -e "pairable on\n" | bluetoothctl
sleep 1
#No error log promot and cannot be scanned via nRFconnect APP, but the command works via bluetoothctl cli interface
echo -e "advertise on\n" | bluetoothctl
sleep 3
#2 Fail to update advertising data via hcitool like following:
- sudo hcitool -i hci0 cmd 0x8 0x8 1e 02 01 06 0f 09 45 6e 47 65 6e 69 75 73 30 56 34 31 31 32 03 ff 00 01 00 00 00 00 00 00 00 00 00 00 00 00
I'm adding manufacturer specific data in the final payload.
#3 Some hci command seems not to be allowed in certain condition.
$ sudo btmon
Bluetooth monitor ver 5.64
= Note: Linux version 6.8.0-59-generic (x86_64) 0.725065
= Note: Bluetooth subsystem version 2.22 0.725067
= New Index: 40:F3:B0:44:EF:E3 (Primary,UART,hci0) [hci0] 0.725068
= Open Index: 40:F3:B0:44:EF:E3 [hci0] 0.725069
= Index Info: 40:F3:B0:44:EF:E3 (Texas Instruments Inc.) [hci0] 0.725069
@ MGMT Open: bluetoothd (privileged) version 1.22 {0x0001} 0.725070
@ RAW Open: btgatt-server (privileged) version 2.22 {0x0002} 4.177405
@ RAW Close: btgatt-server {0x0002} 4.177415
@ RAW Open: btgatt-server (privileged) version 2.22 {0x0002} 4.177427
@ RAW Close: btgatt-server {0x0002} 4.177429
@ RAW Open: hciconfig (privileged) version 2.22 {0x0002} 4.182425
@ RAW Open: hciconfig (privileged) version 2.22 {0x0003} [hci0] 4.182454
< HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1 #1 [hci0] 4.182479
Advertising: Disabled (0x00)
> HCI Event: Command Complete (0x0e) plen 4 #2 [hci0] 4.185458
LE Set Advertise Enable (0x08|0x000a) ncmd 1
Status: Command Disallowed (0x0c)
@ RAW Close: hciconfig {0x0003} [hci0] 4.185500
@ RAW Close: hciconfig {0x0002} 4.185696
@ RAW Open: hciconfig (privileged) version 2.22 {0x0002} 4.188276
@ RAW Open: hciconfig (privileged) version 2.22 {0x0003} [hci0] 4.188295
< HCI Command: LE Set Advertising Parameters (0x08|0x0006) plen 15 #3 [hci0] 4.188311
Min advertising interval: 1280.000 msec (0x0800)
Max advertising interval: 1280.000 msec (0x0800)
Type: Connectable undirected - ADV_IND (0x00)
Own address type: Public (0x00)
Direct address type: Public (0x00)
Direct address: 00:00:00:00:00:00 (OUI 00-00-00)
Channel map: 37, 38, 39 (0x07)
Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00)
> HCI Event: Command Complete (0x0e) plen 4 #4 [hci0] 4.192585
LE Set Advertising Parameters (0x08|0x0006) ncmd 1
Status: Command Disallowed (0x0c)
< HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1 #5 [hci0] 4.192683
Advertising: Enabled (0x01)
> HCI Event: Command Complete (0x0e) plen 4 #6 [hci0] 4.195702
LE Set Advertise Enable (0x08|0x000a) ncmd 1
Status: Command Disallowed (0x0c)
Thanks for reading and any suggestion will be appreciated.
BR,
George Lin