Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion failure #64

Closed
mrwhale opened this issue Jun 27, 2017 · 10 comments
Closed

Assertion failure #64

mrwhale opened this issue Jun 27, 2017 · 10 comments

Comments

@mrwhale
Copy link

mrwhale commented Jun 27, 2017

Available HCI devices found:
hci1
hci0
Trying hci1
hci1 is busy, shutting down and retrying...
Successfully bound HCI socket                                                       
Flic server is now up and running!
Initialization of Bluetooth controller done!
Accepted new client                                                                 
flicd: flicd.cpp:1596: void le_set_scan_enable_handler(uint8_t): Assertion `!status' failed.
Aborted

Getting this error on a raspberry pi 3, running latest raspbian, using onboard Bluetooth. Connecting to it via the node client library. Is there anything else I can do to help trouble shoot this one? I previously was running this on a C.H.I.P with no issues (2 releases behind)

@Emill
Copy link
Collaborator

Emill commented Jun 27, 2017

Do you have two bluetooth controllers? Usually there is only hci0.

@mrwhale
Copy link
Author

mrwhale commented Jun 27, 2017

Yeah I do. I have a little USB ble device that I'm using for another application. For some reason the onboard Bluetooth gets assigned hci1

@Emill
Copy link
Collaborator

Emill commented Jun 27, 2017

Please run "sudo btmon" in another tab and then start flicd and post the output.

@mrwhale
Copy link
Author

mrwhale commented Jun 27, 2017

Done. Doesn't look very helpful, but maybe it will make more sense to you! Started btmon, started flicd, started my client library and it crashed shortly afterwards

pi@openhab:~ $ sudo btmon > btmon.log
^Cpi@openhab:~ $ cat btmon.log
Bluetooth monitor ver 5.23
* Unknown packet (code 12 len 34)                           [hci65535] 0.786502
        4c 69 6e 75 78 20 76 65 72 73 69 6f 6e 20 34 2e  Linux version 4.
        39 2e 32 34 2d 76 37 2b 20 28 61 72 6d 76 37 6c  9.24-v7+ (armv7l
        29 00                                            ).
* Unknown packet (code 12 len 33)                           [hci65535] 0.786511
        42 6c 75 65 74 6f 6f 74 68 20 73 75 62 73 79 73  Bluetooth subsys
        74 65 6d 20 76 65 72 73 69 6f 6e 20 32 2e 32 32  tem version 2.22
        00                                               .
= New Index: B8:27:EB:86:CE:0D (BR/EDR,UART,hci1)               [hci1] 0.786514
= New Index: 00:15:83:E7:A8:22 (BR/EDR,USB,hci0)                [hci0] 0.786517
* Unknown packet (code 8 len 0)                                 [hci0] 0.786519
* Unknown packet (code 10 len 8)                                [hci0] 0.786522
        22 a8 e7 83 15 00 0a 00                          ".......
* Unknown packet (code 14 len 30)                               [hci1] 0.786527
        03 00 00 00 00 00 02 16 00 00 00 00 00 10 6e 6f  ..............no
        64 65 00 00 00 00 00 00 00 00 00 00 00 00        de............
* Unknown packet (code 14 len 30)                           [hci65535] 0.786573
        01 00 00 00 02 00 01 0e 00 01 00 00 00 10 62 74  ..............bt
        6d 6f 6e 00 00 00 00 00 00 00 00 00 00 00        mon...........
* Unknown packet (code 14 len 30)                           [hci65535] 7.601487
        02 00 00 00 00 00 02 16 00 01 00 00 00 10 66 6c  ..............fl
        69 63 64 00 00 00 00 00 00 00 00 00 00 00        icd...........
@ Index Removed
* Unknown packet (code 17 len 6)                                [hci1] 7.602045
        01 00 00 00 05 00                                ......
* Unknown packet (code 8 len 0)                                 [hci1] 7.602075
* Unknown packet (code 10 len 8)                                [hci1] 7.602082
        0d ce 86 eb 27 b8 0f 00                          ....'...
* Unknown packet (code 15 len 4)                            [hci65535] 7.602092
        02 00 00 00                                      ....
* Unknown packet (code 14 len 30)                               [hci1] 7.602097
        02 00 00 00 01 00 02 16 00 01 00 00 00 10 66 6c  ..............fl
        69 63 64 00 00 00 00 00 00 00 00 00 00 00        icd...........
< HCI Command: Reset (0x03|0x0003) plen 0                       [hci1] 7.602368
> HCI Event: Command Complete (0x0e) plen 4                     [hci1] 7.604792
      Reset (0x03|0x0003) ncmd 1
        Status: Success (0x00)
< HCI Command: Read Local Version Infor.. (0x04|0x0001) plen 0  [hci1] 7.604909
< HCI Command: Set Event Mask (0x03|0x0001) plen 8              [hci1] 7.605337
        Mask: 0x3dbff807fffbffff
          Inquiry Complete
          Inquiry Result
          Connection Complete
          Connection Request
          Disconnection Complete
          Authentication Complete
          Remote Name Request Complete
          Encryption Change
          Change Connection Link Key Complete
          Master Link Key Complete
          Read Remote Supported Features Complete
          Read Remote Version Information Complete
          QoS Setup Complete
          Command Complete
          Command Status
          Hardware Error
          Flush Occurred
          Role Change
          Mode Change
          Return Link Keys
          PIN Code Request
          Link Key Request
          Link Key Notification
          Loopback Command
          Data Buffer Overflow
          Max Slots Change
          Read Clock Offset Complete
          Connection Packet Type Changed
          QoS Violation
          Page Scan Mode Change
          Page Scan Repetition Mode Change
          Flow Specification Complete
          Inquiry Result with RSSI
          Read Remote Extended Features Complete
          Synchronous Connection Complete
          Synchronous Connection Changed
          Sniff Subrating
          Extended Inquiry Result
          Encryption Key Refresh Complete
          IO Capability Request
          IO Capability Request Reply
          User Confirmation Request
          User Passkey Request
          Remote OOB Data Request
          Simple Pairing Complete
          Link Supervision Timeout Changed
          Enhanced Flush Complete
          User Passkey Notification
          Keypress Notification
          Remote Host Supported Features Notification
          LE Meta
> HCI Event: Command Complete (0x0e) plen 12                    [hci1] 7.605842
      Read Local Version Information (0x04|0x0001) ncmd 1
        Status: Success (0x00)
        HCI version: Bluetooth 4.1 (0x07) - Revision 182 (0x00b6)
        LMP version: Bluetooth 4.1 (0x07) - Subversion 8713 (0x2209)
        Manufacturer: Broadcom Corporation (15)
< HCI Command: LE Read Supported States (0x08|0x001c) plen 0    [hci1] 7.605945
> HCI Event: Command Complete (0x0e) plen 4                     [hci1] 7.605988
      Set Event Mask (0x03|0x0001) ncmd 1
        Status: Success (0x00)
> HCI Event: Command Complete (0x0e) plen 12                    [hci1] 7.606429
      LE Read Supported States (0x08|0x001c) ncmd 1
        Status: Success (0x00)
        States: 0x000003ffffffffff
          Non-connectable Advertising State
          Scannable Advertising State
          Connectable Advertising State
          High Duty Cycle Directed Advertising State
          Passive Scanning State
          Active Scanning State
          Initiating State
            and Connection State (Master Role)
          Connection State (Slave Role)
          Non-connectable Advertising State
            and Passive Scanning State
          Scannable Advertising State
            and Passive Scanning State
          Connectable Advertising State
            and Passive Scanning State
          High Duty Cycle Directed Advertising State
            and Passive Scanning State
          Non-connectable Advertising State
            and Active Scanning State
          Scannable Advertising State
            and Active Scanning State
          Connectable Advertising State
            and Active Scanning State
          High Duty Cycle Directed Advertising State
            and Active Scanning State
          Non-connectable Advertising State
            and Initiating State
          Scannable Advertising State
            and Initiating State
          Non-connectable Advertising State
            and Connection State (Master Role)
          Scannable Advertising State
            and Connection State (Master Role)
          Non-connectable Advertising State
            and Connection State (Slave Role)
          Scannable Advertising State
            and Connection State (Slave Role)
          Passive Scanning State
            and Initiating State
          Active Scanning State
            and Initiating State
          Passive Scanning State
            and Connection State (Master Role)
          Active Scanning State
            and Connection State (Master Role)
          Passive Scanning State
            and Connection State (Slave Role)
          Active Scanning State
            and Connection State (Slave Role)
          Initiating State
            and Connection State (Master Role)
            and Master Role & Master Role
          Low Duty Cycle Directed Advertising State
          Low Duty Cycle Directed Advertising State
            and Passive Scanning State
          Low Duty Cycle Directed Advertising State
            and Active Scanning State
          Connectable Advertising State
            and Initiating State
            and Master Role & Slave Role
          High Duty Cycle Directed Advertising State
            and Initiating State
            and Master Role & Slave Role
          Low Duty Cycle Directed Advertising State
            and Initiating State
            and Master Role & Slave Role
          Connectable Advertising State
            and Connection State (Master Role)
            and Master Role & Slave Role
          High Duty Cycle Directed Advertising State
            and Connection State (Master Role)
            and Master Role & Slave Role
          Low Duty Cycle Directed Advertising State
            and Connection State (Master Role)
            and Master Role & Slave Role
          Connectable Advertising State
            and Connection State (Slave Role)
            and Master Role & Slave Role
          High Duty Cycle Directed Advertising State
            and Connection State (Slave Role)
            and Slave Role & Slave Role
          Low Duty Cycle Directed Advertising State
            and Connection State (Slave Role)
            and Slave Role & Slave Role
          Initiating State
            and Connection State (Slave Role)
            and Master Role & Slave Role
< HCI Command: Set Event Mask (0x03|0x0001) plen 8              [hci1] 7.606507
        Mask: 0x2000000000018010
          Disconnection Complete
          Hardware Error
          Flush Occurred
          LE Meta
> HCI Event: Command Complete (0x0e) plen 4                     [hci1] 7.606977
      Set Event Mask (0x03|0x0001) ncmd 1
        Status: Success (0x00)
< HCI Command: Set Controller To Host F.. (0x03|0x0031) plen 1  [hci1] 7.607050
        Flow control: Off (0x00)
> HCI Event: Command Complete (0x0e) plen 4                     [hci1] 7.607466
      Set Controller To Host Flow Control (0x03|0x0031) ncmd 1
        Status: Success (0x00)
< HCI Command: Read BD ADDR (0x04|0x0009) plen 0                [hci1] 7.607551
> HCI Event: Command Complete (0x0e) plen 10                    [hci1] 7.608042
      Read BD ADDR (0x04|0x0009) ncmd 1
        Status: Success (0x00)
        Address: B8:27:EB:86:CE:0D (Raspberry Pi Foundation)
< HCI Command: LE Read Buffer Size (0x08|0x0002) plen 0         [hci1] 7.609464
> HCI Event: Command Complete (0x0e) plen 7                     [hci1] 7.609919
      LE Read Buffer Size (0x08|0x0002) ncmd 1
        Status: Success (0x00)
        Data packet length: 251
        Num data packets: 8
< HCI Command: LE Read White List Size (0x08|0x000f) plen 0     [hci1] 7.610056
> HCI Event: Command Complete (0x0e) plen 5                     [hci1] 7.610465
      LE Read White List Size (0x08|0x000f) ncmd 1
        Status: Success (0x00)
        Size: 128
< HCI Command: LE Clear White List (0x08|0x0010) plen 0         [hci1] 7.610538
> HCI Event: Command Complete (0x0e) plen 4                     [hci1] 7.610959
      LE Clear White List (0x08|0x0010) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7      [hci1] 7.611030
        Type: Passive (0x00)
        Interval: 11.250 msec (0x0012)
        Window: 11.250 msec (0x0012)
        Own address type: Public (0x00)
        Filter policy: Accept all advertisement (0x00)
> HCI Event: Command Complete (0x0e) plen 4                     [hci1] 7.611497
      LE Set Scan Parameters (0x08|0x000b) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Event Mask (0x08|0x0001) plen 8           [hci1] 9.607267
        Mask: 0x000000000000001f
          LE Connection Complete
          LE Advertising Report
          LE Connection Update Complete
          LE Read Remote Used Features
          LE Long Term Key Request
> HCI Event: Command Complete (0x0e) plen 4                     [hci1] 9.607781
      LE Set Event Mask (0x08|0x0001) ncmd 1
        Status: Success (0x00)
* Unknown packet (code 14 len 30)                          [hci65535] 10.793909
        04 00 00 00 00 00 02 16 00 00 00 00 00 10 6e 6f  ..............no
        64 65 00 00 00 00 00 00 00 00 00 00 00 00        de............
* Unknown packet (code 15 len 4)                           [hci65535] 10.793969
        04 00 00 00                                      ....
* Unknown packet (code 14 len 30)                              [hci1] 10.793977
        04 00 00 00 00 00 02 16 00 00 00 00 00 10 6e 6f  ..............no
        64 65 00 00 00 00 00 00 00 00 00 00 00 00        de............
< HCI Command: Read Local Version Info.. (0x04|0x0001) plen 0  [hci1] 11.707356
> HCI Event: Command Complete (0x0e) plen 12                   [hci1] 11.707878
      Read Local Version Information (0x04|0x0001) ncmd 1
        Status: Success (0x00)
        HCI version: Bluetooth 4.1 (0x07) - Revision 182 (0x00b6)
        LMP version: Bluetooth 4.1 (0x07) - Subversion 8713 (0x2209)
        Manufacturer: Broadcom Corporation (15)
< HCI Command: Read BD ADDR (0x04|0x0009) plen 0               [hci1] 13.767269
> HCI Event: Command Complete (0x0e) plen 10                   [hci1] 13.767741
      Read BD ADDR (0x04|0x0009) ncmd 1
        Status: Success (0x00)
        Address: B8:27:EB:86:CE:0D (Raspberry Pi Foundation)
< HCI Command: LE Add Device To White... (0x08|0x0011) plen 7  [hci1] 15.738466
        Address type: Public (0x00)
        Address: 80:E4:DA:71:84:6B (OUI 80-E4-DA)
> HCI Event: Command Complete (0x0e) plen 4                    [hci1] 15.739144
      LE Add Device To White List (0x08|0x0011) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Create Connection (0x08|0x000d) plen 25      [hci1] 15.739547
        Scan interval: 60.000 msec (0x0060)
        Scan window: 30.000 msec (0x0030)
        Filter policy: White list is used (0x01)
        Peer address type: Public (0x00)
        Peer address: 00:00:00:00:00:00 (OUI 00-00-00)
        Own address type: Public (0x00)
        Min connection interval: 20.00 msec (0x0010)
        Max connection interval: 25.00 msec (0x0014)
        Connection latency: 0x0000
        Supervision timeout: 200 msec (0x0014)
        Min connection length: 0.000 msec (0x0000)
        Max connection length: 0.000 msec (0x0000)
> HCI Event: Command Status (0x0f) plen 4                      [hci1] 15.740676
      LE Create Connection (0x08|0x000d) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2         [hci1] 15.847286
        Scanning: Disabled (0x00)
        Filter duplicates: Enabled (0x01)
> HCI Event: Command Complete (0x0e) plen 4                    [hci1] 15.847714
      LE Set Scan Enable (0x08|0x000c) ncmd 1
        Status: Command Disallowed (0x0c)
* Unknown packet (code 15 len 4)                               [hci1] 15.849500
        02 00 00 00                                      ....
< HCI Command: Reset (0x03|0x0003) plen 0                      [hci1] 15.849662
> HCI Event: Command Complete (0x0e) plen 4                    [hci1] 15.852261
      Reset (0x03|0x0003) ncmd 1
        Status: Success (0x00)
* Unknown packet (code 9 len 0)                                [hci1] 17.937218
* Unknown packet (code 17 len 6)                               [hci1] 17.937266
        01 00 00 00 04 00                                ......
@ Index Added
pi@openhab:~ $```

@mrwhale
Copy link
Author

mrwhale commented Jun 27, 2017

To add, it also gets the assertion failed error even if I don't start a client. It eventually just crashes

@Emill
Copy link
Collaborator

Emill commented Jun 27, 2017

It seems you have some other Bluetooth application running that interferes with flicd. Please shutdown that.

@mrwhale
Copy link
Author

mrwhale commented Jun 27, 2017

Thanks Emill, I'll check it out but the other app should be ustilising hci0

@mrwhale
Copy link
Author

mrwhale commented Jun 27, 2017

I've stopped the other app that uses the other bluetooth controller but the issue still persists

@Emill
Copy link
Collaborator

Emill commented Jun 27, 2017

Well all I can say is that it's definitely not the flicd program that sends out the command

< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2         [hci1] 15.847286
    Scanning: Disabled (0x00)
    Filter duplicates: Enabled (0x01)

Have you really checked all processes running? What does "ps aux" say?

@mrwhale
Copy link
Author

mrwhale commented Jun 27, 2017

/facepalm. Yep Sorry. there was a rogue process not managed by systemd and I had previously looked under ps but wasn't looking for the right thing

Thanks for you help! Hopefully this can serve to anyone else getting this error. Make sure to check that there is not another process using the same bluetooth controller as flic!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants