50ButtonsEach / fliclib-linux-hci

Flic SDK for Linux
306 stars 53 forks source link

problem with one button #34

Open CheapB opened 8 years ago

CheapB commented 8 years ago

One of my buttons stopped working and it is flashing red twice when I am pressing it. I have tried to add it again with the startScanWizard and it does not see it. Even buttons in private mode normally shows and I am directed to press the button for 7 seconds, but not this one.

Removing the battery didnt change anything.

Any ideas?

Emill commented 8 years ago

Could you test to add it to the Flic app on Android or iOS? Just to see if the problem is with the button or with the Linux lib.

Den 2 sep. 2016 3:10 fm skrev "CheapB" notifications@github.com:

One of my buttons stopped working and it is flashing red twice when I am pressing it. I have tried to add it again with the startScanWizard and it does not see it. Even buttons in private mode normally shows and I am directed to press the button for 7 seconds, but not this one.

Removing the battery didnt change anything.

Any ideas?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/50ButtonsEach/fliclib-linux-hci/issues/34, or mute the thread https://github.com/notifications/unsubscribe-auth/ABlXaj32lhjzqcFUR5floa9LFmXSWncQks5ql3dogaJpZM4JzR0j .

CheapB commented 8 years ago

I was able to add it to my iphone and remove it again. Still no luck getting it recognized on linux

Emill commented 8 years ago

Can you send output from sudo btmon when it's not working?

Den 2 sep. 2016 1:47 em skrev "CheapB" notifications@github.com:

I was able to add it to my iphone and remove it again. Still no luck getting it recognized on linux

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/50ButtonsEach/fliclib-linux-hci/issues/34#issuecomment-244353943, or mute the thread https://github.com/notifications/unsubscribe-auth/ABlXanBALMfi2BjXCkIXM_S99b0xt24-ks5qmAzNgaJpZM4JzR0j .

CheapB commented 8 years ago

I started btmon and started a scan and pushed the button that does not work. Let me know if you need anything else

`Bluetooth monitor ver 5.23 = New Index: CC:79:DF:22:76:B4 (BR/EDR,UART,hci0) [hci0] 0.289464

HCI Event: Disconnect Complete (0x05) plen 4 [hci0] 483.181372 Status: Success (0x00) Handle: 19 Reason: Connection Timeout (0x08) < HCI Command: LE Create Connection (0x08|0x000d) plen 25 [hci0] 483.182156 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 [hci0] 483.185244 LE Create Connection (0x08|0x000d) ncmd 2 Status: Success (0x00) HCI Event: LE Meta Event (0x3e) plen 19 [hci0] 485.428133 LE Connection Complete (0x01) Status: Success (0x00) Handle: 19 Role: Master (0x00) Peer address type: Public (0x00) Peer address: 80:E4:DA:71:61:93 (OUI 80-E4-DA) Connection interval: 22.50 msec (0x0012) Connection latency: 0.00 msec (0x0000) Supervision timeout: 200 msec (0x0014) Master clock accuracy: 0x00 < ACL Data TX: Handle 19 flags 0x00 dlen 7 [hci0] 485.429124 ATT: Read Request (0x0a) len 2 Handle: 0x0012 < ACL Data TX: Handle 19 flags 0x00 dlen 9 [hci0] 485.429154 ATT: Write Command (0x52) len 4 Handle: 0x0013 Data: 0100 < ACL Data TX: Handle 19 flags 0x00 dlen 9 [hci0] 485.429161 ATT: Write Command (0x52) len 4 Handle: 0x0016 Data: 0100 HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 485.461716 Num handles: 1 Handle: 19 Count: 1 HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 485.462487 Num handles: 1 Handle: 19 Count: 1 HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 485.463158 Num handles: 1 Handle: 19 Count: 1 ACL Data RX: Handle 19 flags 0x02 dlen 25 [hci0] 485.485335 ATT: Read Response (0x0b) len 20 Value: 40ffc67537785622bb7a1a9bed72679edfd5898f < ACL Data TX: Handle 19 flags 0x00 dlen 27 [hci0] 485.485965 ATT: Write Command (0x52) len 22 Handle: 0x0012 Data: 09bc6aee1eb73a61a848314a8bcac9005ef43251 < ACL Data TX: Handle 19 flags 0x00 dlen 22 [hci0] 485.485992 ATT: Write Command (0x52) len 17 Handle: 0x0012 Data: 25320100000200000005011e344d05 < ACL Data TX: Handle 19 flags 0x00 dlen 21 [hci0] 485.485999 ATT: Write Command (0x52) len 16 Handle: 0x0012 Data: 06000000000000ff0102742274d1 HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 485.506911 Num handles: 1 Handle: 19 Count: 1 HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 485.507936 Num handles: 1 Handle: 19 Count: 1 HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 485.508710 Num handles: 1 Handle: 19 Count: 1 ACL Data RX: Handle 19 flags 0x02 dlen 22 [hci0] 485.529662 ATT: Handle Value Notification (0x1b) len 17 Handle: 0x0015 Data: 40072e606b6d27511208b035b7ee3a < HCI Command: LE Connection Update (0x08|0x0013) plen 14 [hci0] 485.530198 Handle: 19 Min connection interval: 87.50 msec (0x0046) Max connection interval: 100.00 msec (0x0050) Connection latency: 0x0013 Supervision timeout: 4010 msec (0x0191) Min connection length: 0.000 msec (0x0000) Max connection length: 0.000 msec (0x0000) HCI Event: Command Status (0x0f) plen 4 [hci0] 485.533031 LE Connection Update (0x08|0x0013) ncmd 2 Status: Success (0x00) HCI Event: LE Meta Event (0x3e) plen 10 [hci0] 485.776424 LE Connection Update Complete (0x03) Status: Success (0x00) Handle: 19 Connection interval: 97.50 msec (0x004e) Connection latency: 23.75 msec (0x0013) Supervision timeout: 4010 msec (0x0191) ACL Data RX: Handle 19 flags 0x02 dlen 22 [hci0] 485.778013 ATT: Handle Value Notification (0x1b) len 17 Handle: 0x0015 Data: 603201000200009c2644066d0db991 `

Emill commented 8 years ago

As far as I see there it gets connected as it should. So, you are not getting any connection state callback and the button events?

CheapB commented 8 years ago

Test_button.py does not record any events on this button. all others works

Emill commented 8 years ago

Does it notice the connect / disconnect events? Could you test "simpleclient"?

Also, do you see the events in btmon when you click the button and it's connected when the python client doesn't see them?

CheapB commented 8 years ago

in simpleclient I see the button in getInfo but no other activity. I have started with a fresh database and added all 4 buttons again and it seem to be working . I do have the old database saved if it make sense to compare. Otherwise I am up and running for now.

Emill commented 8 years ago

Would you mind send me the old db? Maybe it's something strange inside it.

CheapB commented 8 years ago

New and old: https://1drv.ms/f/s!AtqyXSTc4YfMllCcHDpSXSynKEkA

CheapB commented 8 years ago

Any suspicious entries in the DB? @Emill It happened again and was again fixed by deleting the db..

Emill commented 8 years ago

I find that strange... Note that if you restart with a new DB the button will overwrite the current bonding keys for the current peer device, so it won't work if you connect with the old db directly.

If it happens again, I want you to do a sudo btmon log (which you then send to me) from where you start flicd. Then open up your client, (try to) connect to the button and click your Flic a few times. Now, can you see the click events in btmon every time you click? So as I see it, the fact that the connection channel got connected is not sent to the app?

CheapB commented 8 years ago

One of my buttons lost the pairing again but regained by restarting the service. I will explore a little more and get back to you with some more specific scenarios if possible.

Emill commented 7 years ago

Any new info?

CheapB commented 7 years ago

I and trying to get my hands around this. At this point it stops working about once a day and I have to reboot. So the good news is the database is not getting corrupted and no need to do the pairing again. A reboot/Restart of the service is all it takes. Now I am on the C.H.I.P and not an RPI which may be why few others seems to have problems .

CheapB commented 7 years ago

Ok, I have done some more testing. the buttons that doesnt work show nothing in btmon. the bottons that does work is (obviously) recording as normal. Reboot seems to fix it for another day or so and then the buttons start to fail. sometimes a single, othertimes all o them. Any ideas?

Emill commented 7 years ago

I still need a btmon log to be able to analyse anything... With reboot, do you mean restart flicd, the Bluetooth adapter or the whole machine?

CheapB commented 7 years ago

I would think I could just kill the flicd and my python script, but I am currently rebooting the machine to get it working again. I will try to kill the processes instead of rebooting next time. I am attaching a log. not sure what you can read from it as buttons that have stopped working create no entries whatsoever in the long, where as a working button obviously does. `chip@chip:~$ sudo btmon [sudo] password for chip: Bluetooth monitor ver 5.23 = New Index: CC:79:DF:22:76:B4 (BR/EDR,UART,hci0) [hci0] 0.311526

ACL Data RX: Handle 16 flags 0x02 dlen 22 [hci0] 14.105333 ATT: Handle Value Notification (0x1b) len 17 Handle: 0x0015 Data: 01d901001d000000000000ad15f7cd ACL Data RX: Handle 16 flags 0x02 dlen 22 [hci0] 14.299885 ATT: Handle Value Notification (0x1b) len 17 Handle: 0x0015 Data: 08da01001d000000000000a5bf2dd7 ACL Data RX: Handle 16 flags 0x02 dlen 22 [hci0] 14.592391 ATT: Handle Value Notification (0x1b) len 17 Handle: 0x0015 Data: 02da01001d00000000000033d3c397 < ACL Data TX: Handle 16 flags 0x00 dlen 22 [hci0] 14.594440 ATT: Write Request (0x12) len 17 Handle: 0x0012 Data: 25da0100001d00000005039b2f46e0 HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 14.689684 Num handles: 1 Handle: 16 Count: 1 ACL Data RX: Handle 16 flags 0x02 dlen 5 [hci0] 14.884652 ATT: Write Response (0x13) len 0 ACL Data RX: Handle 16 flags 0x02 dlen 22 [hci0] 18.492294 ATT: Handle Value Notification (0x1b) len 17 Handle: 0x0015 Data: 01db01001d000000000000e0518213 ACL Data RX: Handle 16 flags 0x02 dlen 22 [hci0] 18.687269 ATT: Handle Value Notification (0x1b) len 17 Handle: 0x0015 Data: 08dc01001d00000000000006f02e86 ACL Data RX: Handle 16 flags 0x02 dlen 22 [hci0] 19.077254 ATT: Handle Value Notification (0x1b) len 17 Handle: 0x0015 Data: 02dc01001d00000000000017df4957 < ACL Data TX: Handle 16 flags 0x00 dlen 22 [hci0] 19.079310 ATT: Write Request (0x12) len 17 Handle: 0x0012 Data: 25dc0100001d0000000504514788c6 HCI Event: Number of Completed Packets (0x13) plen 5 [hci0] 19.174573 Num handles: 1 Handle: 16 Count: 1 ACL Data RX: Handle 16 flags 0x02 dlen 5 [hci0] 19.272015 ATT: Write Response (0x13) len 0 `

Emill commented 7 years ago

Hi. The log needs to be started before something fails. Otherwise it doesn't catch when the problem happens.

CheapB commented 7 years ago

btmon2.txt

This is the complete log. This time it ran for days. let me know if this makes sense to you

Emill commented 7 years ago

The log stopped in the middle of a packet. The timestamp is 202070 which is around 2.3 days.

What happened? I don't see anything strange in the log.