HomeACcessoryKid / ESP8266-HomeKit-Demo

User part of the ESP8266-HomeKit foundation
https://www.youtube.com/watch?v=Xnr-utWDIR8
Apache License 2.0
125 stars 27 forks source link

Can not pair on IOS 11 #28

Closed onepas closed 7 years ago

onepas commented 7 years ago

It worked on IOS 10, but can't pair on IOS 11

HomeACcessoryKid commented 7 years ago

could you enable all debug levels and report the log? Personally I have very little time these days and didn’t even have time to upgrade to iOS11 Others are invited to help recovery (if it is a serious issue).

maccoylton commented 7 years ago

I have successfully paired a Sonoff Basic and a Sonoff S20 on IOS 11, had some initial teething troubles, but after deleting my home, and doing a factory reset on each device it worked ok

onepas commented 7 years ago

This is logs. After long time pairing, on Iphone I got message: Couldn't add HomeACcessory Home couldn't connect to this accessory.

FULL LOG: pairing 1, heap 31904, system time=208595 pairing 1, heap 31904, system time=211595 pairing 1, heap 31904, system time=214595 pairing 1, heap 31904, system time=217595 pairing 1, heap 31904, system time=220595 pairing 1, heap 31904, system time=223595 pairing 1, heap 31904, system time=226595 p_sema taken 3fff26f0 connects from 192.168.100.4:50491 id:00000001 p_sema locked server got a packet from 192.168.100.4:50491 at 228241 len:131 len:131 A_dat:6,tot:6,lenght:6 dsl: 6, tl: 6, hl: 125, len: 6 normal packet saved POST/S: pair-setup C: F: pParseB: 000100060101 pair-setup t:0-n:1 t:6-n:1 0:00 6:01 Free heap1:30536 srp pair step 1! Free heap:30096 s: 7c4bd5d3e1c7f15644034c43e58f6a26 i=0,t=6,l=1 i=8,t=2,l=16 i=32,t=3,l=384 chunked_len: 432 Priority:10 485454502f312e3120323030204f4b0d0a436f6e74656e742d747970653a206170706c69636174696f6e2f70616972696e672b746c76380d0a436f6e6e656374696f6e3a206b6565702d616c6976650d0a5472616e736665722d456e636f64696e673a206368756e6b65640d0a0d0a330d0a0601020d0a31320d0a02107c4bd5d3e1c7f15644034c43e58f6a260d0a3138340d0a03fffaa4883a28bb615257df85302544b10dbd05691aaa582bf7aee0d510117ea55702c913e7313a4910b6fbc19412d41c888dc3565e0f9b6c1f541071f502879400d74f2b00bef899ea58344357d9ca9531c9de18cbfadf84f2ff2e73fe2535d633f2dd24ec3e2d85d8ade5a74a6ea4df3b39dc8e878a45c1fa183746679dd3b6e65ce4b266dd9e37baa97c7c8d7acd5e8208273d8f2f0cb912fe3a5548444c9dd8a98aa71b4c68fa62955b3eff94fe2224c3b9c0dbe25566e5f127ce222179015c96c0c870f6960277f65edf22ca2cb7994144b655b29b9c320bf3a6a5090edb90b8c0473dbaf9bc9bdae2fc0ec503458422948742ddb4baf8d877808c6842fb03819be6bfcbaef07d0aa162ceb703e6fbe196aa0f6c64b167678c48f05f74354be3c8ed5aa40cb3ddfb59e6a3f94132eec580ba07bb69f65681acd0de280a3f163962396c3190f37944361de9be22ed07f924682f0c730cb4f68721938a29e3d920c8b485882df8b3295b4cac219d20885216bdf1986743b676b2309d7093453b389c0d0a300d0a0d0a to be sent by tlv8_send routine arg=3fff2960, ptrespconn=3fff26f0, pcryp=3fff2960 send result: 0 Free heap2:28928 server sent a packet to 192.168.100.4:50491 at 228402 pairing 1, heap 30688, system time=229595 3fff26f0 conn, rev:3fff05c8, nxt:00000000, act:3, 192.168.100.4:50491, cid:01 pairing 1, heap 30688, system time=232595 pairing 1, heap 30688, system time=235595 p_sema locked server got a packet from 192.168.100.4:50491 at 237852 len:584 len:584 A_dat:457,tot:457,lenght:457 dsl: 457, tl: 457, hl: 127, len: 457 normal packet saved POST/S: pair-setup C: F: pParseB: 06010303ff5c2940de64855cafdcc5ad0813c6ae26c1fc9dc735e54c16f3ae098364c3b014c109f97c5c8dc31f9789606578c91a1a8036db7312badd182bb8237f5e9dec987613a3ff7a646dfc721648aa9394566571dd5d8b6b293afa243059d8b05807d17578397cd2aa2c425ddcc59991be8fe76914fabf3f0023461fb46d6a14deb671874f62987c186ff80ebc89480af93b1f6eed52e7dbc36576accfb90dedf2a9540900e9feaf1f605eca165b4cc182693d16514395913ee429089d670d7c88bd5869a0c7c747c706e8a11ecac390b485e75d814aab129811a67b372f80cb267b297e3191b2d15011a3a88fb5ec982324cd15e0a31d9c4d0190e255b37dfb1397038178004d5270a66fe4cf57609ac924e1b3ed08ce4e8c7d4849026d54915981d3fe71c692e6defe5085b817e33bc873f40cbcdf08d226fa5dbfc25e30c60a4121875a6bba5140f4250e802d5f761d6f5c4d72f1ec546f72286ca378e5dc0a5b94a8c9fbdfde779178528a278d67e96b6429fd151aeb41695ebe1553d81620c4be9ef30440ed3f61a82f1ca5af3568a26e2549986ee4b175a4492512ac55b70cb42da2230e6d9e17aaf9f617b42bcecbcd3d4a1f0ec891f80bbb91b4db3c78e19ac439b882 pair-setup t:6-n:1 t:3-n:255 t:3-n:384 t:4-n:64 3:5c2940de64855cafdcc5ad0813c6ae26c1fc9dc735e54c16f3ae098364c3b014c109f97c5c8dc31f9789606578c91a1a8036db7312badd182bb8237f5e9dec987613a3ff7a646dfc721648aa9394566571dd5d8b6b293afa243059d8b05807d17578397cd2aa2c425ddcc59991be8fe76914fabf3f0023461fb46d6a14deb671874f62987c186ff80ebc89480af93b1f6eed52e7dbc36576accfb90dedf2a9540900e9feaf1f605eca165b4cc182693d16514395913ee429089d670d7c88bd5869a0c7c747c706e8a11ecac390b485e75d814aab129811a67b372f80cb267b297e3191b2d15011a3a88fb5ec982324cd15e0a31d9c4d0190e255b37dfb139778004d5270a66fe4cf57609ac924e1b3ed08ce4e8c7d4849026d54915981d3fe71c692e6defe5085b817e33bc873f40cbcdf08d226fa5dbfc25e30c60a4121875a6bba5140f4250e802d5f761d6f5c4d72f1ec546f72286ca378e5dc0a5b94a8c9fbdfde779178528a278d67e96b6429fd151aeb41695ebe1553d81620c4be9ef3 4:ed3f61a82f1ca5af3568a26e2549986ee4b175a4492512ac55b70cb42da2230e6d9e17aaf9f617b42bcecbcd3d4a1f0ec891f80bbb91b4db3c78e19ac439b882 6:03 Free heap3:29624 Free heap4:29624 srp pair step 3! Free heap:30968 pairing 1, heap 23184, system time=238595 pairing 1, heap 9176, system time=241595 3fff26f0 conn, rev:3fff05c8, nxt:00000000, act:3, 192.168.100.4:50491, cid:01 pairing 1, heap 9176, system time=244595 pairing 1, heap 9176, system time=247595 pairing 1, heap 9176, system time=250595 pairing 1, heap 11224, system time=253595 3fff26f0 conn, rev:3fff05c8, nxt:00000000, act:3, 192.168.100.4:50491, cid:01 pairing 1, heap 6976, system time=256595 pairing 1, heap 6976, system time=259595 pairing 1, heap 9024, system time=262595 key: a78eb358e693132e82da08a884c5b8a8a0419197ce923358c457184d56d5ab66d601e1128af55e634d8865a01d04b79d4404428513ece716c8447899b85a379e i=0,t=6,l=1 i=8,t=4,l=64 chunked_len: 85 485454502f312e3120323030204f4b0d0a436f6e74656e742d747970653a206170706c69636174696f6e2f70616972696e672b746c76380d0a436f6e6e656374696f6e3a206b6565702d616c6976650d0a5472616e736665722d456e636f64696e673a206368756e6b65640d0a0d0a330d0a0601040d0a34320d0a044078f81745d15f960ec41519d3a3981c0b73de298d61e5ade0271b6b8407e41678d9c2d1485adf52993f39ca0a51fe79aa3b72eb28b5cb8088f18d7477f66c521b0d0a300d0a0d0a to be sent by tlv8_send routine arg=3fff2960, ptrespconn=3fff26f0, pcryp=3fff2960 send result: 0 waiting for task server sent a packet to 192.168.100.4:50491 at 263627 p_sema locked server got a packet from 192.168.100.4:50491 at 263659 len:286 len:286 A_dat:159,tot:159,lenght:159 dsl: 159, tl: 159, hl: 127, len: 159 normal packet saved POST/S: pair-setup C: F: pParseB: 059a2a2b0d0b659a3257a2f47be00ce02b681bfd177115aae03374eb4e7f16865a94ba6cc822d279177f5523782313f9c40abcd2fdaf5db6b416e409463d564532201f9f89c07e86a4cba67f23620ffce5cd740a282d79f286ef555e5ed9d7bb513e9192ff8ccb3708e22473c43f6864bd07dd794c1f7bf5c5ed8a194547a81395fb6d2463de17e65cb9ea9328ecfb8d0d667ff3f7499e59b58a8f6d060105 pair-setup t:5-n:154 t:6-n:1 5:2a2b0d0b659a3257a2f47be00ce02b681bfd177115aae03374eb4e7f16865a94ba6cc822d279177f5523782313f9c40abcd2fdaf5db6b416e409463d564532201f9f89c07e86a4cba67f23620ffce5cd740a282d79f286ef555e5ed9d7bb513e9192ff8ccb3708e22473c43f6864bd07dd794c1f7bf5c5ed8a194547a81395fb6d2463de17e65cb9ea9328ecfb8d0d667ff3f7499e59b58a8f6d 6:05 Free heap5:30144 Free heap6:30144 srp pair step 5! Free heap:30784 encKey0:b8441391d8f6935ae56538c82f77c54ae573c903c5e093b5eb826cea55a15045 t:1-n:36 t:3-n:32 t:10-n:64 1:42443534323742412d304535462d343543432d423736442d433446363632333444344432 3:7aeeb734e09534b159da07d24b1e91c15ccc1e599f1b79c84cd7189fab87a1e7 10:595575931611d35c065f543439943bb1f8538a593d0743abb935a263dff6ae1e929cfc34f6a324635acf44e77b0bdeb6692010ec0bc908522ec1f977d4eed007 myLTPK: a4caf76e273b8f251a8b5acbb3808dc5df53fd9afb05c5787f96b0f29e0d7399 verified=1 r=0 i=0,t=6,l=1 i=8,t=5,l=135 chunked_len: 156 identify_task started led true led_task started { "accessories": [{ "aid": 1, "services": [{ "iid": 1, "type": "0000003E-0000-1000-8000-0026BB765291", "characteristics": [{ "iid": 2, "type": "00000023-0000-1000-8000-0026BB765291", "perms": ["pr"], "format": "string", "maxLen": 64, "value": "HomeACcessory" }, { "iid": 3, "type": "00000020-0000-1000-8000-0026BB765291", "perms": ["pr"], "format": "string", "maxLen": 64, "value": "HacK" }, { "iid": 4, "type": "00000021-0000-1000-8000-0026BB765291", "perms": ["pr"], "format": "string", "maxLen": 64, "value": "Rev-1" }, { "iid": 5, "type": "00000030-0000-1000-8000-0026BB765291", "perms": ["pr"], "format": "string", "maxLen": 64, "value": "1" }, { "iid": 6, "type": "00000014-0000-1000-8000-0026BB765291", "perms": ["pw"], "format": "bool" }] }, { "iid": 7, "type": "00000049-0000-1000-8000-0026BB765291", "characteristics": [{ "iid": 8, "type": "00000023-0000-1000-8000-0026BB765291", "perms": ["pr"], "format": "string", "maxLen": 64, "value": "led" }, { "iid": 9, "type": "00000025-0000-1000-8000-0026BB765291", "perms": ["pw", "pr", "ev"], "format": "bool", "events": true, "value": true }] }, { "iid": 10, "type": "00000043-0000-1000-8000-0026BB765291", "characteristics": [{ "iid": 11, "type": "00000023-0000-1000-8000-0026BB765291", "perms": ["pr"], "format": "string", "maxLen": 64, "value": "light" }, { "iid": 12, "type": "00000025-0000-1000-8000-0026BB765291", "perms": ["pw", "pr", "ev"], "format": "bool", "events": true, "value": false }, { "iid": 13, "type": "00000008-0000-1000-8000-0026BB765291", "perms": ["pw", "pr", "ev"], "minValue": 0, "maxValue": 100, "minStep": 1, "unit": "percentage", "format": "int", "events": true, "value": 0 }] }] }] } 485454502f312e3120323030204f4b0d0a436f6e74656e742d747970653a206170706c69636174696f6e2f70616972696e672b746c76380d0a436f6e6e656374696f6e3a206b6565702d616c6976650d0a5472616e736665722d456e636f64696e673a206368756e6b65640d0a0d0a330d0a0601060d0a38390d0a058782470756aab66a1d2d723dd9e4851efe63b3f5641f6c9ddfe5681317238c1c50995e21f22fecfcfe549ff5482784f170ce4d3ee81774feb2e1850197bdafcfc60732a51b0952a2eca663d28ff559e9c95168fbfa12cef4cd4652e56e5c20c0fe1c66b88cb5307e5bd9e4d71c5e494ec77b2614598328894f2294379275d3b18caf7881e3b2fdc70d0a300d0a0d0a to be sent by tlv8_send routine arg=3fff2960, ptrespconn=3fff26f0, pcryp=3fff2960 send result: 0 waiting for task server sent a packet to 192.168.100.4:50491 at 264449 client 192.168.100.4:50491 disconnected with status 0 Cleaning 3fff2960 @ 264518 CID: 1 Freeing 3fff2960 @ 264518 p_sema taken 3fff26f0 connects from 192.168.100.4:50492 id:00000001 p_sema locked server got a packet from 192.168.100.4:50492 at 264561 len:164 len:164 A_dat:37,tot:37,lenght:37 dsl: 37, tl: 37, hl: 127, len: 37 normal packet saved POST/S: pair-verify C: F: pParseB: 06010103201179795111a277504efb28dc5f1bebabf40c9d2c9d1019acfbfb84d1059d3e30 pair-verify t:6-n:1 t:3-n:32 3:1179795111a277504efb28dc5f1bebabf40c9d2c9d1019acfbfb84d1059d3e30 6:01 Free heap1:19408 Free heap2:19408 pair verify step 1 at 264591 Free heap:20000 mycurvekey: a67236a98d1359f12d25b139f72fe5bcb437156880b297f20fb03be57a9a6364 clcurvekey: 1179795111a277504efb28dc5f1bebabf40c9d2c9d1019acfbfb84d1059d3e30 system time: 264856 shared secret time: 260 sessionkey: 0c45fa9112db8ce2065104d54185f5f1862f49676be401dcd02604b1c561441d system time: 265117 sign message time: 94 edsign: 0 system time: 265212 i=0,t=6,l=1 i=8,t=5,l=101 i=117,t=3,l=32 chunked_len: 162 485454502f312e3120323030204f4b0d0a436f6e74656e742d747970653a206170706c69636174696f6e2f70616972696e672b746c76380d0a436f6e6e656374696f6e3a206b6565702d616c6976650d0a5472616e736665722d456e636f64696e673a206368756e6b65640d0a0d0a330d0a0601020d0a36370d0a0565e6467435814dfac38e33aadf25455860334d398ee206c164a7aec2ea08d7da356728dd117a2f9cb65de9f77adddcb761d9dd21bd82d49883050f15390b0eb8b9bad07ec5bfb581ec418e484e558ebaf74a56b3a8ece6a6b100e7d84bdd3b47fa335c072aea0d0a32320d0a0320a67236a98d1359f12d25b139f72fe5bcb437156880b297f20fb03be57a9a63640d0a300d0a0d0a to be sent by tlv8_send routine arg=3fff2a80, ptrespconn=3fff26f0, pcryp=3fff2a80 send result: 0 server sent a packet to 192.168.100.4:50492 at 265277 waiting for task p_sema locked server got a packet from 192.168.100.4:50492 at 265336 len:253 len:253 A_dat:125,tot:125,lenght:125 dsl: 125, tl: 125, hl: 128, len: 125 normal packet saved POST/S: pair-verify C: F: pParseB: 05780504c7f4662c10fa2f25a852ba228b42d8f688b4a21f6156a6409a7a29aebfc6e0947bea426e9c85a1d73876569836e9b64a802c96dfa93e4f8a882eb6dc33b204e964ef2deac38d54c270ca58e49174ab2dcce0e9dbbfef8fb61ca0bbebc72f86229ca1c9b79c76c5c8902e6ab812744e4907391772af8d060103 pair-verify t:5-n:120 t:6-n:1 5:0504c7f4662c10fa2f25a852ba228b42d8f688b4a21f6156a6409a7a29aebfc6e0947bea426e9c85a1d73876569836e9b64a802c96dfa93e4f8a882eb6dc33b204e964ef2deac38d54c270ca58e49174ab2dcce0e9dbbfef8fb61ca0bbebc72f86229ca1c9b79c76c5c8902e6ab812744e4907391772af8d 6:03 Free heap3:19232 Free heap4:19232 pair verify step 3 at 265393 Free heap:20000 t:1-n:36 t:10-n:64 1:42443534323742412d304535462d343543432d423736442d433446363632333444344432 10:b0d9896ace93cf4fddca964ade28278d5e88fad60043d6c4487ab35b8eb47bdb4e80eae570a6fb54bbca31144930c0cb4d853dd8e173780444523c85e44da80f BD5427BA-0E5F-45CC-B76D-C4F66234D4D2 -- 7fffffffffffffffffffffff42443534323742412d304535462d343543432d423736442d4334463636323334443444327aeeb734e09534b159da07d24b1e91c15ccc1e599f1b79c84cd7189fab87a1e7 key 0 loaded - result: 0 system time: 265437 system time: 265439 pairing 1, heap 19456, system time=265595 3fff26f0 conn, rev:3fff05c8, nxt:00000000, act:3, 192.168.100.4:50492, cid:01 verify message time: 305, verified=1 r=0 i=0,t=6,l=1 chunked_len: 13 485454502f312e3120323030204f4b0d0a436f6e74656e742d747970653a206170706c69636174696f6e2f70616972696e672b746c76380d0a436f6e6e656374696f6e3a206b6565702d616c6976650d0a5472616e736665722d456e636f64696e673a206368756e6b65640d0a0d0a330d0a0601040d0a300d0a0d0a to be sent by tlv8_send routine arg=3fff2a80, ptrespconn=3fff26f0, pcryp=3fff2a80 send result: 0 server sent a packet to 192.168.100.4:50492 at 265805 waiting for task pairing 1, heap 19624, system time=268595 pairing 1, heap 19624, system time=271595 pairing 1, heap 19624, system time=274595 pairing 1, heap 19624, system time=277595 3fff26f0 conn, rev:3fff05c8, nxt:00000000, act:3, 192.168.100.4:50492, cid:01 chas: 1.9=valF -> bool pairing 1, heap 19624, system time=280595 pairing 1, heap 19624, system time=283595 pairing 1, heap 19624, system time=286595 pairing 1, heap 19624, system time=289596 3fff26f0 conn, rev:3fff05c8, nxt:00000000, act:3, 192.168.100.4:50492, cid:01 pairing 1, heap 19624, system time=292595 chas: 1.9=valT -> bool pairing 1, heap 19624, system time=295595 pairing 1, heap 19624, system time=298595 pairing 1, heap 19624, system time=301595 3fff26f0 conn, rev:3fff05c8, nxt:00000000, act:3, 192.168.100.4:50492, cid:01 pairing 1, heap 19624, system time=304595 pairing 1, heap 19624, system time=307595 chas: 1.9=valF -> bool pairing 1, heap 19624, system time=310595 pairing 1, heap 19624, system time=313595 3fff26f0 conn, rev:3fff05c8, nxt:00000000, act:3, 192.168.100.4:50492, cid:01 pairing 1, heap 19624, system time=316595 pairing 1, heap 19624, system time=319595 pairing 1, heap 19624, system time=322595 chas: 1.9=valT -> bool pairing 1, heap 19624, system time=325595 3fff26f0 conn, rev:3fff05c8, nxt:00000000, act:3, 192.168.100.4:50492, cid:01 client 192.168.100.4:50492 disconnected with status 0 Cleaning 3fff2a80 @ 326106 CID: 1 Freeing 3fff2a80 @ 326106 pairing 1, heap 20848, system time=328595 pairing 1, heap 20848, system time=331595 pairing 1, heap 20848, system time=334595 pairing 1, heap 20848, system time=337595 chas: 1.9=valF -> bool pairing 1, heap 20848, system time=340595 pairing 1, heap 20848, system time=343595 pairing 1, heap 20848, system time=346595 pairing 1, heap 20848, system time=349595 pairing 1, heap 20848, system time=352595 chas: 1.9=valT -> bool pairing 1, heap 20848, system time=355595

evski commented 7 years ago

I have same issue in IOS11 :( any help very much appreciated, spent days getting this far.

evski commented 7 years ago

I just tried on an older device running iOS 10 and that doesn't pair either. Accessory shows up in home app, lets me enter code, tries to pair then says: "Home couldn't connect to this accessory" any ideas?

HomeACcessoryKid commented 7 years ago

The log shows no incorrect things. As maccoylton says, did you delete your home and factory reset the accessory? I think this is a thing in general with home kit. I had to do it myself recently, while still in iOS10.
Sorry to have no better explanation.

onepas commented 7 years ago

[Solved] Many thank @HomeACcessoryKid, final, I flashed ESP8266 with a blank firmware (completely erase esp8266 - http://www.pratikpanda.com/completely-format-erase-esp8266-flash-memory/) and then re-flash HomeACcessoryKid, now it worked.