Problems with BLE Mesh
Hello,
I am currently working on porting an application to the "SAMA5D27 WLSOM1 Evaluation Kit" that uses the ATWILC3000 chipset.
I'm using: Kernel: linux4sam-2020.04 i.e., kernel 5.4 WILC Firmware: 15.4 OS: Minimal Ubuntu 20.04 (from here https://rcn-ee.com/rootfs/eewiki/minfs/ubuntu-20.04-minimal-armhf-2020-05-10.tar.xz) BlueZ 5.54 for the mesh implementation
Wifi seems to work without issues. BT firmware seems to be downloaded and started correctly. When the mesh stack starts I can see (using btmon) it query the device for supported features and commands and it then starts LE scanning (successfully).
I can see LE meta data coming in so the scanning seems to work. Eventually my application determines that it is unprovisioned and starts advertising itself as an unprovisioned mesh node. Trying to enable LE advertisement results in a "Command Disallowed" status.
When querying the states supported by the device (hciconfig hci0 lestates) I can see that advertising while passively or actively scanning is not supported. Is this expected to work (i.e., I have the wrong firmware or driver) or is this simply not supported by the chip?
Some output from hciconfig. I've also attached output from btmon from the start of my application.
hciconfig -a
hci0: Type: Primary Bus: UART BD Address: F8:F0:05:DF:18:11 ACL MTU: 27:30 SCO MTU: 0:0 UP RUNNING RX bytes:685351 acl:0 sco:0 events:13 errors:0 TX bytes:30163 acl:0 sco:0 commands:1869 errors:0 Features: 0x00 0x00 0x00 0x00 0x60 0x00 0x00 0x00 Packet type: DM1 DH1 HV1 Link policy: Link mode: SLAVE ACCEPT Can't read local name on hci0: Input/output error (5)
hciconfig hci0 features
hci0: Type: Primary Bus: UART BD Address: F8:F0:05:DF:18:11 ACL MTU: 27:30 SCO MTU: 0:0 Features: 0x00 0x00 0x00 0x00 0x60 0x00 0x00 0x00 <BR/EDR not supp.> <LE support>
hciconfig hcio commands
hci0: Type: Primary Bus: UART BD Address: F8:F0:05:DF:18:11 ACL MTU: 27:30 SCO MTU: 0:0 Commands: Octet 0 = 0x20 (Bit 5) Octet 2 = 0x80 (Bit 7) Octet 5 = 0xc0 (Bit 6 7) Octet 10 = 0x84 (Bit 2 7) Octet 14 = 0xa8 (Bit 3 5 7) Octet 15 = 0x22 (Bit 1 5) Octet 25 = 0xf7 (Bit 0 1 2 4 5 6 7) Octet 26 = 0xff (Bit 0 1 2 3 4 5 6 7) Octet 27 = 0xff (Bit 0 1 2 3 4 5 6 7) Octet 28 = 0x7f (Bit 0 1 2 3 4 5 6) 'Disconnect' 'Read Remote Version Information' 'Set Event Mask' 'Reset' 'Read Transmit Power Level' 'Host Number Of Completed Packets' 'Read Local Version Information' 'Read Local Supported Features' 'Read Buffer Size' 'Read BD ADDR' 'Read RSSI' 'LE Set Event Mask' 'LE Read Buffer Size' 'LE Read Local Supported Features' 'LE Set Random Address' 'LE Set Advertising Parameters' 'LE Read Advertising Channel TX Power' 'LE Set Advertising Data' 'LE Set Scan Response Data' 'LE Set Advertise Enable' 'LE Set Scan Parameters' 'LE Set Scan Enable' 'LE Create Connection' 'LE Create Connection Cancel' 'LE Read White List Size' 'LE Clear White List' 'LE Add Device To White List' 'LE Remove Device From White List' 'LE Connection Update' 'LE Set Host Channel Classification' 'LE Read Channel Map' 'LE Read Remote Used Features' 'LE Encrypt' 'LE Rand' 'LE Start Encryption' 'LE Long Term Key Request Reply' 'LE Long Term Key Request Negative Reply' 'LE Read Supported States' 'LE Receiver Test' 'LE Transmitter Test' 'LE Test End'
hciconfig hci0 lestates
Supported link layer states: YES Non-connectable Advertising State YES Scannable Advertising State YES Connectable Advertising State YES Directed Advertising State YES Passive Scanning State YES Active Scanning State YES Initiating State/Connection State in Master Role YES Connection State in the Slave Role NO Non-connectable Advertising State and Passive Scanning State combination NO Scannable Advertising State and Passive Scanning State combination NO Connectable Advertising State and Passive Scanning State combination NO Directed Advertising State and Passive Scanning State combination NO Non-connectable Advertising State and Active Scanning State combination NO Scannable Advertising State and Active Scanning State combination NO Connectable Advertising State and Active Scanning State combination NO Directed Advertising State and Active Scanning State combination NO Non-connectable Advertising State and Initiating State combination NO Scannable Advertising State and Initiating State combination YES Non-connectable Advertising State and Master Role combination YES Scannable Advertising State and Master Role combination YES Non-connectable Advertising State and Slave Role combination YES Scannable Advertising State and Slave Role combination NO Passive Scanning State and Initiating State combination NO Active Scanning State and Initiating State combination YES Passive Scanning State and Master Role combination YES Active Scanning State and Master Role combination YES Passive Scanning State and Slave Role combination YES Active Scanning State and Slave Role combination YES Initiating State and Master Role combination/Master Role and Master Role combination