Yurik72 / ESPHap

ESP32/ESP8266 Arduino library for native Apple Homekit Accessory Protocol (HAP)
MIT License
265 stars 60 forks source link

Memory leak? #81

Open BbIKTOP opened 3 years ago

BbIKTOP commented 3 years ago

Looks like there's a memory leak. Did some connects/disconnects to the ihone home.app, observe heap size is getting smaller. After a night working, could not pair, SRP computing failed. Did pair/remove a 5-10 times. The log is a bit large, but you could observe as free heap size is getting lower with each new pairing:

>>> HomeKit: find pairings
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 23784
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
>>> HomeKit: Configuring mDNS
>>> HomeKit: Wifi Sleep type:2
>>> HomeKit: Set Wifi Sleep type :0
>>> HomeKit: MDNS.begin: ES-F184, IP: 172.16.5.158
>>> HomeKit: Init server over
Started at 160 MHz
--------------------------
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53196
>>> HomeKit: [Client 1073702588] Got client content from the cache 0
>>> HomeKit: [Client 1073702588] new client accepted
>>> HomeKit: [Client 1073702588] Pair Setup Step 1/3
>>> HomeKit: [Client 1073702588] Disconnected!
>>> HomeKit: [Client 1073702588] Closing client connection
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 0] Clear the pairing context
>>> HomeKit: [Client 0] client content free
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 22048
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53197
>>> HomeKit: [Client 1073703276] Got client content from the cache 0
>>> HomeKit: [Client 1073703276] new client accepted
>>> HomeKit: [Client 1073703276] Pair Setup Step 1/3
>>> HomeKit: [Client 1073703276] Connection: close received, client will be disconnected
>>> HomeKit: [Client 1073703276] Closing client connection
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 0] Clear the pairing context
>>> HomeKit: [Client 0] client content free
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 21320
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53198
>>> HomeKit: [Client 1073699268] Got client content from the cache 0
>>> HomeKit: [Client 1073699268] new client accepted
>>> HomeKit: [Client 1073699268] Pair Setup Step 1/3
>>> HomeKit: [Client 1073699268] Connection: close received, client will be disconnected
>>> HomeKit: [Client 1073699268] Closing client connection
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 0] Clear the pairing context
>>> HomeKit: [Client 0] client content free
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 21560
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
Exception in thread rx:

--- exit ---
Traceback (most recent call last):
  File "/Users/viktor/.platformio/penv/lib/python3.9/site-packages/serial/serialposix.py", line 575, in read
    buf = os.read(self.fd, size - len(read))
OSError: [Errno 6] Device not configured

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/viktor/.platformio/python3/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/Users/viktor/.platformio/python3/lib/python3.9/threading.py", line 892, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/viktor/.platformio/penv/lib/python3.9/site-packages/serial/tools/miniterm.py", line 499, in reader
    data = self.serial.read(self.serial.in_waiting or 1)
  File "/Users/viktor/.platformio/penv/lib/python3.9/site-packages/serial/serialposix.py", line 581, in read
    raise SerialException('read failed: {}'.format(e))
serial.serialutil.SerialException: read failed: [Errno 6] Device not configured

Terminal will be reused by tasks, press any key to close it.

> Executing task in folder Homekit8266: platformio device monitor <

--- Available filters and text transformations: colorize, debug, default, direct, esp8266_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at http://bit.ly/pio-monitor-filters
--- Miniterm on /dev/cu.usbserial-14540  115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53282
>>> HomeKit: [Client 1073703220] Got client content from the cache 0
>>> HomeKit: [Client 1073703220] new client accepted
>>> HomeKit: [Client 1073703220] Pair Setup Step 1/3
>>> HomeKit: [Client 1073703220] Connection: close received, client will be disconnected
>>> HomeKit: [Client 1073703220] Closing client connection
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 0] Clear the pairing context
>>> HomeKit: [Client 0] client content free
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 21568
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53285
>>> HomeKit: [Client 1073699244] Got client content from the cache 0
>>> HomeKit: [Client 1073699244] new client accepted
>>> HomeKit: [Client 1073699244] Pair Setup Step 1/3
>>> HomeKit: [Client 1073699244] Connection: close received, client will be disconnected
>>> HomeKit: [Client 1073699244] Closing client connection
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 0] Clear the pairing context
>>> HomeKit: [Client 0] client content free
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 20960
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53286
>>> HomeKit: [Client 1073699268] Got client content from the cache 0
>>> HomeKit: [Client 1073699268] new client accepted
>>> HomeKit: [Client 1073699268] Pair Setup Step 1/3
>>> HomeKit: [Client 1073699268] Pair Setup Step 2/3
>>> HomeKit: [Client 1073699268] Computing SRP shared secret
>>> HomeKit: [Client 1073699268] Verifying peer's proof
>>> HomeKit: [Client 1073699268] Generating own proof
>>> HomeKit: [Client 1073699268] Pair Setup Step 3/3
>>> HomeKit: Added pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 1073699268] Successfully paired
>>> HomeKit: [Client 1073699268] Disconnected!
>>> HomeKit: WiFiServer receives a new client (current 1, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53287
>>> HomeKit: [Client 1073703764] Got client content from the cache 1
>>> HomeKit: [Client 1073703764] new client accepted
>>> HomeKit: [Client 1073703764] Pair Verify Step 1/2
>>> HomeKit: Free heap: 23016
>>> HomeKit: [Client 1073703764] Pair Verify Step 2/2
>>> HomeKit: [Client 1073703764] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073703764] Verification successful, secure session established
>>> HomeKit: Free heap: 23264
>>> HomeKit: [Client 1073703764] Get Accessories
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 23224
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 23320
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 23320
>>> HomeKit: [Client 1073703764] Get Characteristics
>>> HomeKit: WiFiServer receives a new client (current 2, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.1.35:60437
>>> HomeKit: [Client 1073703220] Got client content from the cache 2
>>> HomeKit: [Client 1073703220] new client accepted
>>> HomeKit: [Client 1073703220] Pair Verify Step 1/2
>>> HomeKit: Free heap: 22920
>>> HomeKit: [Client 1073703220] Pair Verify Step 2/2
>>> HomeKit: [Client 1073703220] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073703220] Verification successful, secure session established
>>> HomeKit: Free heap: 22928
>>> HomeKit: [Client 1073703220] Get Accessories
>>> HomeKit: [Client 1073703220] Get Characteristics
>>> HomeKit: [Client 1073699268] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: WiFiServer receives a new client (current 2, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.201:59243
>>> HomeKit: [Client 1073699244] Got client content from the cache 0
>>> HomeKit: [Client 1073699244] new client accepted
>>> HomeKit: [Client 1073699244] Pair Verify Step 1/2
>>> HomeKit: Free heap: 22320
>>> HomeKit: WiFiServer receives a new client (current 3, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.136:54267
>>> HomeKit: [Client 1073702580] Got client content from the cache 3
>>> HomeKit: [Client 1073702580] new client accepted
>>> HomeKit: [Client 1073702580] Pair Verify Step 1/2
>>> HomeKit: Free heap: 21560
>>> HomeKit: [Client 1073699244] Pair Verify Step 2/2
>>> HomeKit: [Client 1073699244] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073699244] Verification successful, secure session established
>>> HomeKit: Free heap: 22088
>>> HomeKit: [Client 1073702580] Pair Verify Step 2/2
>>> HomeKit: [Client 1073702580] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073702580] Verification successful, secure session established
>>> HomeKit: Free heap: 22456
>>> HomeKit: [Client 1073699244] Get Accessories
>>> HomeKit: [Client 1073702580] Get Accessories
>>> HomeKit: [Client 1073702580] Socket not available to write size:1037,available:947
>>> HomeKit: [Client 1073702580] Socket send chunked :947,available:0
!!! HomeKit: [Client 1073702580] socket.write, data_size=1037, write_size=947
!!! HomeKit: [Client 1073702580] error_in_write_data is true, abort write data
>>> HomeKit: [Client 1073703764] Get Characteristics
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 22576
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 22576
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 22504
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 22728
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 22728
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 22616
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 22728
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 22264
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 22592
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 22328
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 22328
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 22592
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 22704
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 22704
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 22592
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 22728
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 22728
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 22576
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 22688
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 22688
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 22576
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Remove Pairing
>>> HomeKit: Removed pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: Last admin pairing was removed, enabling pair setup
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 19496
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
>>> HomeKit: [Client 1073702580] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073699244] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073703220] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073703764] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53290
>>> HomeKit: [Client 1073699244] Got client content from the cache 0
>>> HomeKit: [Client 1073699244] new client accepted
>>> HomeKit: [Client 1073699244] Pair Setup Step 1/3
>>> HomeKit: [Client 1073699244] Disconnected!
>>> HomeKit: [Client 1073699244] Closing client connection
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 0] Clear the pairing context
>>> HomeKit: [Client 0] client content free
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 20912
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53292
>>> HomeKit: [Client 1073699268] Got client content from the cache 0
>>> HomeKit: [Client 1073699268] new client accepted
>>> HomeKit: [Client 1073699268] Pair Setup Step 1/3
>>> HomeKit: [Client 1073699268] Connection: close received, client will be disconnected
>>> HomeKit: [Client 1073699268] Closing client connection
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 0] Clear the pairing context
>>> HomeKit: [Client 0] client content free
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 20256
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53293
>>> HomeKit: [Client 1073699268] Got client content from the cache 0
>>> HomeKit: [Client 1073699268] new client accepted
>>> HomeKit: [Client 1073699268] Pair Setup Step 1/3
>>> HomeKit: [Client 1073699268] Connection: close received, client will be disconnected
>>> HomeKit: [Client 1073699268] Closing client connection
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 0] Clear the pairing context
>>> HomeKit: [Client 0] client content free
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 20576
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53294
>>> HomeKit: [Client 1073702556] Got client content from the cache 0
>>> HomeKit: [Client 1073702556] new client accepted
>>> HomeKit: [Client 1073702556] Pair Setup Step 1/3
>>> HomeKit: [Client 1073702556] Pair Setup Step 2/3
>>> HomeKit: [Client 1073702556] Computing SRP shared secret
>>> HomeKit: [Client 1073702556] Verifying peer's proof
>>> HomeKit: [Client 1073702556] Generating own proof
>>> HomeKit: [Client 1073702556] Pair Setup Step 3/3
>>> HomeKit: Added pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 1073702556] Successfully paired
>>> HomeKit: [Client 1073702556] Disconnected!
>>> HomeKit: WiFiServer receives a new client (current 1, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53295
>>> HomeKit: [Client 1073702588] Got client content from the cache 1
>>> HomeKit: [Client 1073702588] new client accepted
>>> HomeKit: [Client 1073702588] Pair Verify Step 1/2
>>> HomeKit: Free heap: 22864
>>> HomeKit: [Client 1073702588] Pair Verify Step 2/2
>>> HomeKit: [Client 1073702588] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073702588] Verification successful, secure session established
>>> HomeKit: Free heap: 22968
>>> HomeKit: [Client 1073702588] Get Accessories
>>> HomeKit: [Client 1073702588] Update Characteristics
>>> HomeKit: Free heap: 22928
>>> HomeKit: [Client 1073702588] Update Characteristics
>>> HomeKit: Free heap: 23024
>>> HomeKit: [Client 1073702588] Update Characteristics
>>> HomeKit: Free heap: 23024
>>> HomeKit: [Client 1073702588] Get Characteristics
>>> HomeKit: WiFiServer receives a new client (current 2, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.1.35:60490
>>> HomeKit: [Client 1073700708] Got client content from the cache 2
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Verify Step 1/2
>>> HomeKit: Free heap: 21800
>>> HomeKit: [Client 1073700708] Pair Verify Step 2/2
>>> HomeKit: [Client 1073700708] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073700708] Verification successful, secure session established
>>> HomeKit: Free heap: 22672
>>> HomeKit: [Client 1073700708] Get Accessories
>>> HomeKit: [Client 1073700708] Get Characteristics
>>> HomeKit: WiFiServer receives a new client (current 3, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.201:59255
>>> HomeKit: [Client 1073703764] Got client content from the cache 3
>>> HomeKit: [Client 1073703764] new client accepted
>>> HomeKit: [Client 1073703764] Pair Verify Step 1/2
>>> HomeKit: Free heap: 22112
>>> HomeKit: [Client 1073703764] Pair Verify Step 2/2
>>> HomeKit: [Client 1073703764] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073703764] Verification successful, secure session established
>>> HomeKit: Free heap: 22280
>>> HomeKit: [Client 1073703764] Get Accessories
>>> HomeKit: [Client 1073702556] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: WiFiServer receives a new client (current 3, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.136:54274
>>> HomeKit: [Client 1073700268] Got client content from the cache 0
>>> HomeKit: [Client 1073700268] new client accepted
>>> HomeKit: [Client 1073700268] Pair Verify Step 1/2
>>> HomeKit: Free heap: 22096
>>> HomeKit: [Client 1073700268] Pair Verify Step 2/2
>>> HomeKit: [Client 1073700268] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073700268] Verification successful, secure session established
>>> HomeKit: Free heap: 22208
>>> HomeKit: [Client 1073700268] Get Accessories
>>> HomeKit: [Client 1073700268] Get Characteristics
>>> HomeKit: [Client 1073702588] Get Characteristics
>>> HomeKit: [Client 1073702588] Update Characteristics
>>> HomeKit: Free heap: 22464
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073702588] Remove Pairing
>>> HomeKit: Removed pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: Last admin pairing was removed, enabling pair setup
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 20176
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
>>> HomeKit: [Client 1073700268] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073703764] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073702588] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53301
>>> HomeKit: [Client 1073700708] Got client content from the cache 0
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Setup Step 1/3
>>> HomeKit: [Client 1073700708] Pair Setup Step 2/3
>>> HomeKit: [Client 1073700708] Computing SRP shared secret
>>> HomeKit: [Client 1073700708] Verifying peer's proof
>>> HomeKit: [Client 1073700708] Generating own proof
>>> HomeKit: [Client 1073700708] Pair Setup Step 3/3
>>> HomeKit: Added pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 1073700708] Successfully paired
>>> HomeKit: [Client 1073700708] Disconnected!
>>> HomeKit: WiFiServer receives a new client (current 1, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53303
>>> HomeKit: [Client 1073703764] Got client content from the cache 1
>>> HomeKit: [Client 1073703764] new client accepted
>>> HomeKit: [Client 1073703764] Pair Verify Step 1/2
>>> HomeKit: Free heap: 23096
>>> HomeKit: [Client 1073703764] Pair Verify Step 2/2
>>> HomeKit: [Client 1073703764] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073703764] Verification successful, secure session established
>>> HomeKit: Free heap: 23208
>>> HomeKit: [Client 1073703764] Get Accessories
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 23168
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 23264
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 23264
>>> HomeKit: [Client 1073703764] Get Characteristics
>>> HomeKit: WiFiServer receives a new client (current 2, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.1.35:60574
>>> HomeKit: [Client 1073701468] Got client content from the cache 2
>>> HomeKit: [Client 1073701468] new client accepted
>>> HomeKit: [Client 1073701468] Pair Verify Step 1/2
>>> HomeKit: Free heap: 22888
>>> HomeKit: [Client 1073701468] Pair Verify Step 2/2
>>> HomeKit: [Client 1073701468] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073701468] Verification successful, secure session established
>>> HomeKit: Free heap: 22888
>>> HomeKit: [Client 1073701468] Get Accessories
>>> HomeKit: [Client 1073701468] Get Characteristics
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: WiFiServer receives a new client (current 2, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.201:59271
>>> HomeKit: [Client 1073700708] Got client content from the cache 0
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Verify Step 1/2
>>> HomeKit: Free heap: 22696
>>> HomeKit: [Client 1073700708] Pair Verify Step 2/2
>>> HomeKit: [Client 1073700708] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073700708] Verification successful, secure session established
>>> HomeKit: Free heap: 22520
>>> HomeKit: [Client 1073700708] Get Accessories
>>> HomeKit: [Client 1073703764] Get Characteristics
>>> HomeKit: WiFiServer receives a new client (current 3, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.136:54286
>>> HomeKit: [Client 1073702508] Got client content from the cache 3
>>> HomeKit: [Client 1073702508] new client accepted
>>> HomeKit: [Client 1073702508] Pair Verify Step 1/2
>>> HomeKit: Free heap: 22336
>>> HomeKit: [Client 1073702508] Pair Verify Step 2/2
>>> HomeKit: [Client 1073702508] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073702508] Verification successful, secure session established
>>> HomeKit: Free heap: 21688
>>> HomeKit: [Client 1073702508] Get Accessories
>>> HomeKit: [Client 1073702508] Get Characteristics
>>> HomeKit: [Client 1073703764] Remove Pairing
>>> HomeKit: Removed pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: Last admin pairing was removed, enabling pair setup
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 19888
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
>>> HomeKit: [Client 1073702508] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073701468] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073703764] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.201:59278
>>> HomeKit: [Client 1073700708] Got client content from the cache 0
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Verify Step 1/2
>>> HomeKit: Free heap: 19616
>>> HomeKit: [Client 1073700708] Disconnected!
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53311
>>> HomeKit: [Client 1073700708] Got client content from the cache 0
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Setup Step 1/3
>>> HomeKit: [Client 1073700708] Pair Setup Step 2/3
>>> HomeKit: [Client 1073700708] Computing SRP shared secret
>>> HomeKit: [Client 1073700708] Verifying peer's proof
>>> HomeKit: [Client 1073700708] Generating own proof
>>> HomeKit: [Client 1073700708] Pair Setup Step 3/3
>>> HomeKit: Formatting flash at 0x200000
>>> HomeKit: Added pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 1073700708] Successfully paired
>>> HomeKit: [Client 1073700708] Disconnected!
>>> HomeKit: WiFiServer receives a new client (current 1, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53312
>>> HomeKit: [Client 1073703764] Got client content from the cache 1
>>> HomeKit: [Client 1073703764] new client accepted
>>> HomeKit: [Client 1073703764] Pair Verify Step 1/2
>>> HomeKit: Free heap: 19096
>>> HomeKit: [Client 1073703764] Pair Verify Step 2/2
>>> HomeKit: [Client 1073703764] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073703764] Verification successful, secure session established
>>> HomeKit: Free heap: 19096
>>> HomeKit: [Client 1073703764] Get Accessories
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 19168
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 19264
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 19264
>>> HomeKit: [Client 1073703764] Get Characteristics
>>> HomeKit: WiFiServer receives a new client (current 2, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.136:54291
>>> HomeKit: [Client 1073702332] Got client content from the cache 2
>>> HomeKit: [Client 1073702332] new client accepted
>>> HomeKit: [Client 1073702332] Pair Verify Step 1/2
>>> HomeKit: Free heap: 18312
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: WiFiServer receives a new client (current 2, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.201:59286
>>> HomeKit: [Client 1073702244] Got client content from the cache 0
>>> HomeKit: [Client 1073702244] new client accepted
>>> HomeKit: [Client 1073702244] Pair Verify Step 1/2
>>> HomeKit: Free heap: 17360
>>> HomeKit: [Client 1073702332] Pair Verify Step 2/2
>>> HomeKit: [Client 1073702332] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073702332] Verification successful, secure session established
>>> HomeKit: Free heap: 17784
>>> HomeKit: WiFiServer receives a new client (current 3, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.1.35:60663
>>> HomeKit: [Client 1073700708] Got client content from the cache 3
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Verify Step 1/2
>>> HomeKit: Free heap: 17392
>>> HomeKit: [Client 1073702244] Pair Verify Step 2/2
>>> HomeKit: [Client 1073702244] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073702244] Verification successful, secure session established
>>> HomeKit: Free heap: 17016
>>> HomeKit: [Client 1073702332] Get Accessories
>>> HomeKit: [Client 1073700708] Pair Verify Step 2/2
>>> HomeKit: [Client 1073700708] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073700708] Verification successful, secure session established
>>> HomeKit: Free heap: 15720
>>> HomeKit: [Client 1073702244] Get Accessories
>>> HomeKit: [Client 1073700708] Get Accessories
>>> HomeKit: [Client 1073700708] Get Characteristics
>>> HomeKit: [Client 1073702332] Get Characteristics
>>> HomeKit: [Client 1073703764] Get Characteristics
>>> HomeKit: [Client 1073703764] Remove Pairing
>>> HomeKit: Removed pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: Last admin pairing was removed, enabling pair setup
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 15992
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073702244] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073702332] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073703764] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.201:59290
>>> HomeKit: [Client 1073700708] Got client content from the cache 0
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Verify Step 1/2
>>> HomeKit: Free heap: 15440
>>> HomeKit: [Client 1073700708] Disconnected!
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53316
>>> HomeKit: [Client 1073700708] Got client content from the cache 0
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Setup Step 1/3
>>> HomeKit: [Client 1073700708] Connection: close received, client will be disconnected
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 0] Clear the pairing context
>>> HomeKit: [Client 0] client content free
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 15776
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53317
>>> HomeKit: [Client 1073703220] Got client content from the cache 0
>>> HomeKit: [Client 1073703220] new client accepted
>>> HomeKit: [Client 1073703220] Pair Setup Step 1/3
>>> HomeKit: [Client 1073703220] Pair Setup Step 2/3
>>> HomeKit: [Client 1073703220] Computing SRP shared secret
>>> HomeKit: [Client 1073703220] Verifying peer's proof
>>> HomeKit: [Client 1073703220] Generating own proof
>>> HomeKit: [Client 1073703220] Pair Setup Step 3/3
>>> HomeKit: Added pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 1073703220] Successfully paired
>>> HomeKit: [Client 1073703220] Disconnected!
>>> HomeKit: WiFiServer receives a new client (current 1, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53318
>>> HomeKit: [Client 1073700708] Got client content from the cache 1
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Verify Step 1/2
>>> HomeKit: Free heap: 17792
>>> HomeKit: [Client 1073700708] Pair Verify Step 2/2
>>> HomeKit: [Client 1073700708] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073700708] Verification successful, secure session established
>>> HomeKit: Free heap: 18016
>>> HomeKit: [Client 1073700708] Get Accessories
>>> HomeKit: [Client 1073700708] Update Characteristics
>>> HomeKit: Free heap: 17976
>>> HomeKit: [Client 1073700708] Update Characteristics
>>> HomeKit: Free heap: 18072
>>> HomeKit: [Client 1073700708] Update Characteristics
>>> HomeKit: Free heap: 18072
>>> HomeKit: [Client 1073700708] Get Characteristics
>>> HomeKit: WiFiServer receives a new client (current 2, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.136:54299
>>> HomeKit: [Client 1073703764] Got client content from the cache 2
>>> HomeKit: [Client 1073703764] new client accepted
>>> HomeKit: [Client 1073703764] Pair Verify Step 1/2
>>> HomeKit: Free heap: 17552
>>> HomeKit: [Client 1073703764] Pair Verify Step 2/2
>>> HomeKit: [Client 1073703764] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073703764] Verification successful, secure session established
>>> HomeKit: Free heap: 16104
>>> HomeKit: [Client 1073703764] Get Accessories
>>> HomeKit: [Client 1073703220] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073703764] Get Characteristics
>>> HomeKit: WiFiServer receives a new client (current 2, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.201:59298
>>> HomeKit: [Client 1073702468] Got client content from the cache 0
>>> HomeKit: [Client 1073702468] new client accepted
>>> HomeKit: [Client 1073702468] Pair Verify Step 1/2
>>> HomeKit: Free heap: 17296
>>> HomeKit: [Client 1073702468] Pair Verify Step 2/2
>>> HomeKit: [Client 1073702468] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073702468] Verification successful, secure session established
>>> HomeKit: Free heap: 17408
>>> HomeKit: [Client 1073702468] Get Accessories
>>> HomeKit: [Client 1073700708] Get Characteristics
>>> HomeKit: [Client 1073700708] Update Characteristics
>>> HomeKit: Free heap: 17624
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073700708] Update Characteristics
>>> HomeKit: Free heap: 17624
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073700708] Update Characteristics
>>> HomeKit: Free heap: 17512
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073700708] Update Characteristics
>>> HomeKit: Free heap: 17624
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073700708] Remove Pairing
>>> HomeKit: Removed pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: Last admin pairing was removed, enabling pair setup
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 14920
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
>>> HomeKit: [Client 1073702468] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073703764] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53321
>>> HomeKit: [Client 1073705652] Got client content from the cache 0
>>> HomeKit: [Client 1073705652] new client accepted
>>> HomeKit: [Client 1073705652] Pair Setup Step 1/3
>>> HomeKit: [Client 1073705652] Pair Setup Step 2/3
>>> HomeKit: [Client 1073705652] Computing SRP shared secret
>>> HomeKit: [Client 1073705652] Verifying peer's proof
>>> HomeKit: [Client 1073705652] Generating own proof
>>> HomeKit: [Client 1073705652] Socket not available to write size:172,available:0
>>> HomeKit: [Client 1073705652] Attempt :0, available:0
>>> HomeKit: [Client 1073705652] Attempt :1, available:0
>>> HomeKit: [Client 1073705652] Attempt :2, available:0
>>> HomeKit: [Client 1073705652] Attempt :3, available:0
>>> HomeKit: [Client 1073705652] Attempt :4, available:0
!!! HomeKit: [Client 1073705652] socket.write, data_size=172, write_size=0
>>> HomeKit: WiFiServer receives a new client (current 1, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53322
>>> HomeKit: [Client 1073700708] Got client content from the cache 1
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Setup Step 1/3
>>> HomeKit: [Client 1073700708] Refusing to pair: another pairing in progress
>>> HomeKit: [Client 1073705652] Disconnected!
>>> HomeKit: [Client 1073700708] Disconnected!
>>> HomeKit: [Client 1073705652] Closing client connection
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 0] Clear the pairing context
>>> HomeKit: [Client 0] client content free
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 16264
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53324
>>> HomeKit: [Client 1073700708] Got client content from the cache 0
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Setup Step 1/3
>>> HomeKit: [Client 1073700708] Connection: close received, client will be disconnected
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 0] Clear the pairing context
>>> HomeKit: [Client 0] client content free
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 16080
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53325
>>> HomeKit: [Client 1073700708] Got client content from the cache 0
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Setup Step 1/3
>>> HomeKit: [Client 1073700708] Connection: close received, client will be disconnected
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 0] Clear the pairing context
>>> HomeKit: [Client 0] client content free
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 16160
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53326
>>> HomeKit: [Client 1073705652] Got client content from the cache 0
>>> HomeKit: [Client 1073705652] new client accepted
>>> HomeKit: [Client 1073705652] Pair Setup Step 1/3
>>> HomeKit: [Client 1073705652] Pair Setup Step 2/3
>>> HomeKit: [Client 1073705652] Computing SRP shared secret
>>> HomeKit: [Client 1073705652] Verifying peer's proof
>>> HomeKit: [Client 1073705652] Generating own proof
>>> HomeKit: [Client 1073705652] Socket not available to write size:172,available:0
>>> HomeKit: [Client 1073705652] Attempt :0, available:0
>>> HomeKit: [Client 1073705652] Attempt :1, available:0
>>> HomeKit: [Client 1073705652] Attempt :2, available:0
>>> HomeKit: [Client 1073705652] Attempt :3, available:0
>>> HomeKit: [Client 1073705652] Attempt :4, available:0
!!! HomeKit: [Client 1073705652] socket.write, data_size=172, write_size=0
>>> HomeKit: WiFiServer receives a new client (current 1, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53327
>>> HomeKit: [Client 1073703764] Got client content from the cache 1
>>> HomeKit: [Client 1073703764] new client accepted
>>> HomeKit: [Client 1073703764] Pair Setup Step 1/3
>>> HomeKit: [Client 1073703764] Refusing to pair: another pairing in progress
>>> HomeKit: [Client 1073705652] Disconnected!
>>> HomeKit: [Client 1073703764] Disconnected!
>>> HomeKit: [Client 1073705652] Closing client connection
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 0] Clear the pairing context
>>> HomeKit: [Client 0] client content free
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 16296
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
>>> HomeKit: [Client 1073703764] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53328
>>> HomeKit: [Client 1073703764] Got client content from the cache 0
>>> HomeKit: [Client 1073703764] new client accepted
>>> HomeKit: [Client 1073703764] Pair Setup Step 1/3
>>> HomeKit: [Client 1073703764] Pair Setup Step 2/3
>>> HomeKit: [Client 1073703764] Computing SRP shared secret
>>> HomeKit: [Client 1073703764] Verifying peer's proof
>>> HomeKit: [Client 1073703764] Generating own proof
>>> HomeKit: [Client 1073703764] Pair Setup Step 3/3
>>> HomeKit: Added pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 1073703764] Successfully paired
>>> HomeKit: [Client 1073703764] Disconnected!
>>> HomeKit: WiFiServer receives a new client (current 1, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53329
>>> HomeKit: [Client 1073700708] Got client content from the cache 1
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Verify Step 1/2
>>> HomeKit: Free heap: 18248
>>> HomeKit: [Client 1073700708] Pair Verify Step 2/2
>>> HomeKit: [Client 1073700708] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073700708] Verification successful, secure session established
>>> HomeKit: Free heap: 18360
>>> HomeKit: [Client 1073700708] Get Accessories
>>> HomeKit: [Client 1073700708] Update Characteristics
>>> HomeKit: Free heap: 18320
>>> HomeKit: [Client 1073700708] Update Characteristics
>>> HomeKit: Free heap: 18416
>>> HomeKit: [Client 1073700708] Update Characteristics
>>> HomeKit: Free heap: 18416
>>> HomeKit: [Client 1073700708] Get Characteristics
>>> HomeKit: WiFiServer receives a new client (current 2, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.1.35:60850
>>> HomeKit: [Client 1073702540] Got client content from the cache 2
>>> HomeKit: [Client 1073702540] new client accepted
>>> HomeKit: [Client 1073702540] Pair Verify Step 1/2
>>> HomeKit: Free heap: 17864
>>> HomeKit: [Client 1073702540] Pair Verify Step 2/2
>>> HomeKit: [Client 1073702540] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073702540] Verification successful, secure session established
>>> HomeKit: Free heap: 17944
>>> HomeKit: [Client 1073702540] Get Accessories
>>> HomeKit: [Client 1073702540] Get Characteristics
>>> HomeKit: WiFiServer receives a new client (current 3, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.201:59311
>>> HomeKit: [Client 1073701356] Got client content from the cache 3
>>> HomeKit: [Client 1073701356] new client accepted
>>> HomeKit: [Client 1073701356] Pair Verify Step 1/2
>>> HomeKit: Free heap: 17704
>>> HomeKit: [Client 1073701356] Pair Verify Step 2/2
>>> HomeKit: [Client 1073701356] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073701356] Verification successful, secure session established
>>> HomeKit: Free heap: 17816
>>> HomeKit: [Client 1073703764] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073701356] Get Accessories
>>> HomeKit: [Client 1073700708] Get Characteristics
>>> HomeKit: [Client 1073700708] Update Characteristics
>>> HomeKit: Free heap: 17616
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: WiFiServer receives a new client (current 3, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.136:54311
>>> HomeKit: [Client 1073703764] Got client content from the cache 0
>>> HomeKit: [Client 1073703764] new client accepted
>>> HomeKit: [Client 1073703764] Pair Verify Step 1/2
>>> HomeKit: Free heap: 16984
>>> HomeKit: [Client 1073700708] Update Characteristics
>>> HomeKit: Free heap: 17232
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Pair Verify Step 2/2
>>> HomeKit: [Client 1073703764] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073703764] Verification successful, secure session established
>>> HomeKit: Free heap: 17368
>>> HomeKit: [Client 1073703764] Get Accessories
>>> HomeKit: [Client 1073703764] Get Characteristics
>>> HomeKit: [Client 1073700708] Update Characteristics
>>> HomeKit: Free heap: 17632
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073700708] Update Characteristics
>>> HomeKit: Free heap: 17744
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073700708] Update Characteristics
>>> HomeKit: Free heap: 17744
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073700708] Update Characteristics
>>> HomeKit: Free heap: 17632
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073700708] Update Characteristics
>>> HomeKit: Free heap: 17744
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073700708] Remove Pairing
>>> HomeKit: Removed pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: Last admin pairing was removed, enabling pair setup
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 15176
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
>>> HomeKit: [Client 1073703764] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073701356] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073702540] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.201:59316
>>> HomeKit: [Client 1073700708] Got client content from the cache 0
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Verify Step 1/2
>>> HomeKit: Free heap: 14480
>>> HomeKit: [Client 1073700708] Disconnected!
Yurik72 commented 3 years ago

Yes, I should fix , this is only related to pairing, which usually once, in production , paired mode tested well and no memory leak, be sure as well that you are using latest version

Sent from my iPhone

On 22 Mar 2021, at 15:25, Viktr @.***> wrote:

 Looks like there's a memory leak. Did some connects/disconnects to the ihone home.app, observe heap size is getting smaller. After a night working, could not pair, SRP computing failed. Did pair/remove a 5-10 times. The log is a bit large, but you could observe as free heap size is getting lower with each new pairing:

HomeKit: find pairings HomeKit: Preinit pairing context HomeKit: Using user-specified password: 111-11-111 HomeKit: Free heap: 23784 HomeKit: Calculating public key len=384 HomeKit: .Calculating public key result 0 HomeKit: arduino_homekit_preinit success HomeKit: Configuring mDNS HomeKit: Wifi Sleep type:2 HomeKit: Set Wifi Sleep type :0 HomeKit: MDNS.begin: ES-F184, IP: 172.16.5.158 HomeKit: Init server over Started at 160 MHz

HomeKit: WiFiServer receives a new client (current 0, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53196 HomeKit: [Client 1073702588] Got client content from the cache 0 HomeKit: [Client 1073702588] new client accepted HomeKit: [Client 1073702588] Pair Setup Step 1/3 HomeKit: [Client 1073702588] Disconnected! HomeKit: [Client 1073702588] Closing client connection HomeKit: Free saved_preinit_pairing_context HomeKit: [Client 0] Clear the pairing context HomeKit: [Client 0] client content free HomeKit: Preinit pairing context HomeKit: Using user-specified password: 111-11-111 HomeKit: Free heap: 22048 HomeKit: Calculating public key len=384 HomeKit: .Calculating public key result 0 HomeKit: arduino_homekit_preinit success HomeKit: WiFiServer receives a new client (current 0, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53197 HomeKit: [Client 1073703276] Got client content from the cache 0 HomeKit: [Client 1073703276] new client accepted HomeKit: [Client 1073703276] Pair Setup Step 1/3 HomeKit: [Client 1073703276] Connection: close received, client will be disconnected HomeKit: [Client 1073703276] Closing client connection HomeKit: Free saved_preinit_pairing_context HomeKit: [Client 0] Clear the pairing context HomeKit: [Client 0] client content free HomeKit: Preinit pairing context HomeKit: Using user-specified password: 111-11-111 HomeKit: Free heap: 21320 HomeKit: Calculating public key len=384 HomeKit: .Calculating public key result 0 HomeKit: arduino_homekit_preinit success HomeKit: WiFiServer receives a new client (current 0, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53198 HomeKit: [Client 1073699268] Got client content from the cache 0 HomeKit: [Client 1073699268] new client accepted HomeKit: [Client 1073699268] Pair Setup Step 1/3 HomeKit: [Client 1073699268] Connection: close received, client will be disconnected HomeKit: [Client 1073699268] Closing client connection HomeKit: Free saved_preinit_pairing_context HomeKit: [Client 0] Clear the pairing context HomeKit: [Client 0] client content free HomeKit: Preinit pairing context HomeKit: Using user-specified password: 111-11-111 HomeKit: Free heap: 21560 HomeKit: Calculating public key len=384 HomeKit: .Calculating public key result 0 HomeKit: arduino_homekit_preinit success Exception in thread rx:

--- exit --- Traceback (most recent call last): File "/Users/viktor/.platformio/penv/lib/python3.9/site-packages/serial/serialposix.py", line 575, in read buf = os.read(self.fd, size - len(read)) OSError: [Errno 6] Device not configured

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/viktor/.platformio/python3/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/Users/viktor/.platformio/python3/lib/python3.9/threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "/Users/viktor/.platformio/penv/lib/python3.9/site-packages/serial/tools/miniterm.py", line 499, in reader data = self.serial.read(self.serial.in_waiting or 1) File "/Users/viktor/.platformio/penv/lib/python3.9/site-packages/serial/serialposix.py", line 581, in read raise SerialException('read failed: {}'.format(e)) serial.serialutil.SerialException: read failed: [Errno 6] Device not configured

Terminal will be reused by tasks, press any key to close it.

Executing task in folder Homekit8266: platformio device monitor <

--- Available filters and text transformations: colorize, debug, default, direct, esp8266_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time --- More details at http://bit.ly/pio-monitor-filters --- Miniterm on /dev/cu.usbserial-14540 115200,8,N,1 --- --- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---

HomeKit: WiFiServer receives a new client (current 0, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53282 HomeKit: [Client 1073703220] Got client content from the cache 0 HomeKit: [Client 1073703220] new client accepted HomeKit: [Client 1073703220] Pair Setup Step 1/3 HomeKit: [Client 1073703220] Connection: close received, client will be disconnected HomeKit: [Client 1073703220] Closing client connection HomeKit: Free saved_preinit_pairing_context HomeKit: [Client 0] Clear the pairing context HomeKit: [Client 0] client content free HomeKit: Preinit pairing context HomeKit: Using user-specified password: 111-11-111 HomeKit: Free heap: 21568 HomeKit: Calculating public key len=384 HomeKit: .Calculating public key result 0 HomeKit: arduino_homekit_preinit success HomeKit: WiFiServer receives a new client (current 0, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53285 HomeKit: [Client 1073699244] Got client content from the cache 0 HomeKit: [Client 1073699244] new client accepted HomeKit: [Client 1073699244] Pair Setup Step 1/3 HomeKit: [Client 1073699244] Connection: close received, client will be disconnected HomeKit: [Client 1073699244] Closing client connection HomeKit: Free saved_preinit_pairing_context HomeKit: [Client 0] Clear the pairing context HomeKit: [Client 0] client content free HomeKit: Preinit pairing context HomeKit: Using user-specified password: 111-11-111 HomeKit: Free heap: 20960 HomeKit: Calculating public key len=384 HomeKit: .Calculating public key result 0 HomeKit: arduino_homekit_preinit success HomeKit: WiFiServer receives a new client (current 0, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53286 HomeKit: [Client 1073699268] Got client content from the cache 0 HomeKit: [Client 1073699268] new client accepted HomeKit: [Client 1073699268] Pair Setup Step 1/3 HomeKit: [Client 1073699268] Pair Setup Step 2/3 HomeKit: [Client 1073699268] Computing SRP shared secret HomeKit: [Client 1073699268] Verifying peer's proof HomeKit: [Client 1073699268] Generating own proof HomeKit: [Client 1073699268] Pair Setup Step 3/3 HomeKit: Added pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: Free saved_preinit_pairing_context HomeKit: [Client 1073699268] Successfully paired HomeKit: [Client 1073699268] Disconnected! HomeKit: WiFiServer receives a new client (current 1, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53287 HomeKit: [Client 1073703764] Got client content from the cache 1 HomeKit: [Client 1073703764] new client accepted HomeKit: [Client 1073703764] Pair Verify Step 1/2 HomeKit: Free heap: 23016 HomeKit: [Client 1073703764] Pair Verify Step 2/2 HomeKit: [Client 1073703764] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073703764] Verification successful, secure session established HomeKit: Free heap: 23264 HomeKit: [Client 1073703764] Get Accessories HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 23224 HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 23320 HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 23320 HomeKit: [Client 1073703764] Get Characteristics HomeKit: WiFiServer receives a new client (current 2, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.1.35:60437 HomeKit: [Client 1073703220] Got client content from the cache 2 HomeKit: [Client 1073703220] new client accepted HomeKit: [Client 1073703220] Pair Verify Step 1/2 HomeKit: Free heap: 22920 HomeKit: [Client 1073703220] Pair Verify Step 2/2 HomeKit: [Client 1073703220] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073703220] Verification successful, secure session established HomeKit: Free heap: 22928 HomeKit: [Client 1073703220] Get Accessories HomeKit: [Client 1073703220] Get Characteristics HomeKit: [Client 1073699268] Closing client connection HomeKit: [Client 0] client content free HomeKit: WiFiServer receives a new client (current 2, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.201:59243 HomeKit: [Client 1073699244] Got client content from the cache 0 HomeKit: [Client 1073699244] new client accepted HomeKit: [Client 1073699244] Pair Verify Step 1/2 HomeKit: Free heap: 22320 HomeKit: WiFiServer receives a new client (current 3, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.136:54267 HomeKit: [Client 1073702580] Got client content from the cache 3 HomeKit: [Client 1073702580] new client accepted HomeKit: [Client 1073702580] Pair Verify Step 1/2 HomeKit: Free heap: 21560 HomeKit: [Client 1073699244] Pair Verify Step 2/2 HomeKit: [Client 1073699244] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073699244] Verification successful, secure session established HomeKit: Free heap: 22088 HomeKit: [Client 1073702580] Pair Verify Step 2/2 HomeKit: [Client 1073702580] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073702580] Verification successful, secure session established HomeKit: Free heap: 22456 HomeKit: [Client 1073699244] Get Accessories HomeKit: [Client 1073702580] Get Accessories HomeKit: [Client 1073702580] Socket not available to write size:1037,available:947 HomeKit: [Client 1073702580] Socket send chunked :947,available:0 !!! HomeKit: [Client 1073702580] socket.write, data_size=1037, write_size=947 !!! HomeKit: [Client 1073702580] error_in_write_data is true, abort write data HomeKit: [Client 1073703764] Get Characteristics HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 22576 led_callback set_led notify hap found characteristic HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 22576 led_callback set_led notify hap found characteristic HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 22504 led_callback set_led notify hap found characteristic HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 22728 led_callback set_led notify hap found characteristic HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 22728 led_callback set_led notify hap found characteristic HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 22616 led_callback set_led notify hap found characteristic HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 22728 led_callback set_led notify hap found characteristic HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 22264 led_callback set_led notify hap found characteristic HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 22592 led_callback set_led notify hap found characteristic HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 22328 led_callback set_led notify hap found characteristic HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 22328 led_callback set_led notify hap found characteristic HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 22592 led_callback set_led notify hap found characteristic HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 22704 led_callback set_led notify hap found characteristic HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 22704 led_callback set_led notify hap found characteristic HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 22592 led_callback set_led notify hap found characteristic HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 22728 led_callback set_led notify hap found characteristic HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 22728 led_callback set_led notify hap found characteristic HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 22576 led_callback set_led notify hap found characteristic HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 22688 led_callback set_led notify hap found characteristic HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 22688 led_callback set_led notify hap found characteristic HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 22576 led_callback set_led notify hap found characteristic HomeKit: [Client 1073703764] Remove Pairing HomeKit: Removed pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: Last admin pairing was removed, enabling pair setup HomeKit: Preinit pairing context HomeKit: Using user-specified password: 111-11-111 HomeKit: Free heap: 19496 HomeKit: Calculating public key len=384 HomeKit: .Calculating public key result 0 HomeKit: arduino_homekit_preinit success HomeKit: [Client 1073702580] Closing client connection HomeKit: [Client 0] client content free HomeKit: [Client 1073699244] Closing client connection HomeKit: [Client 0] client content free HomeKit: [Client 1073703220] Closing client connection HomeKit: [Client 0] client content free HomeKit: [Client 1073703764] Closing client connection HomeKit: [Client 0] client content free HomeKit: WiFiServer receives a new client (current 0, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53290 HomeKit: [Client 1073699244] Got client content from the cache 0 HomeKit: [Client 1073699244] new client accepted HomeKit: [Client 1073699244] Pair Setup Step 1/3 HomeKit: [Client 1073699244] Disconnected! HomeKit: [Client 1073699244] Closing client connection HomeKit: Free saved_preinit_pairing_context HomeKit: [Client 0] Clear the pairing context HomeKit: [Client 0] client content free HomeKit: Preinit pairing context HomeKit: Using user-specified password: 111-11-111 HomeKit: Free heap: 20912 HomeKit: Calculating public key len=384 HomeKit: .Calculating public key result 0 HomeKit: arduino_homekit_preinit success HomeKit: WiFiServer receives a new client (current 0, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53292 HomeKit: [Client 1073699268] Got client content from the cache 0 HomeKit: [Client 1073699268] new client accepted HomeKit: [Client 1073699268] Pair Setup Step 1/3 HomeKit: [Client 1073699268] Connection: close received, client will be disconnected HomeKit: [Client 1073699268] Closing client connection HomeKit: Free saved_preinit_pairing_context HomeKit: [Client 0] Clear the pairing context HomeKit: [Client 0] client content free HomeKit: Preinit pairing context HomeKit: Using user-specified password: 111-11-111 HomeKit: Free heap: 20256 HomeKit: Calculating public key len=384 HomeKit: .Calculating public key result 0 HomeKit: arduino_homekit_preinit success HomeKit: WiFiServer receives a new client (current 0, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53293 HomeKit: [Client 1073699268] Got client content from the cache 0 HomeKit: [Client 1073699268] new client accepted HomeKit: [Client 1073699268] Pair Setup Step 1/3 HomeKit: [Client 1073699268] Connection: close received, client will be disconnected HomeKit: [Client 1073699268] Closing client connection HomeKit: Free saved_preinit_pairing_context HomeKit: [Client 0] Clear the pairing context HomeKit: [Client 0] client content free HomeKit: Preinit pairing context HomeKit: Using user-specified password: 111-11-111 HomeKit: Free heap: 20576 HomeKit: Calculating public key len=384 HomeKit: .Calculating public key result 0 HomeKit: arduino_homekit_preinit success HomeKit: WiFiServer receives a new client (current 0, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53294 HomeKit: [Client 1073702556] Got client content from the cache 0 HomeKit: [Client 1073702556] new client accepted HomeKit: [Client 1073702556] Pair Setup Step 1/3 HomeKit: [Client 1073702556] Pair Setup Step 2/3 HomeKit: [Client 1073702556] Computing SRP shared secret HomeKit: [Client 1073702556] Verifying peer's proof HomeKit: [Client 1073702556] Generating own proof HomeKit: [Client 1073702556] Pair Setup Step 3/3 HomeKit: Added pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: Free saved_preinit_pairing_context HomeKit: [Client 1073702556] Successfully paired HomeKit: [Client 1073702556] Disconnected! HomeKit: WiFiServer receives a new client (current 1, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53295 HomeKit: [Client 1073702588] Got client content from the cache 1 HomeKit: [Client 1073702588] new client accepted HomeKit: [Client 1073702588] Pair Verify Step 1/2 HomeKit: Free heap: 22864 HomeKit: [Client 1073702588] Pair Verify Step 2/2 HomeKit: [Client 1073702588] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073702588] Verification successful, secure session established HomeKit: Free heap: 22968 HomeKit: [Client 1073702588] Get Accessories HomeKit: [Client 1073702588] Update Characteristics HomeKit: Free heap: 22928 HomeKit: [Client 1073702588] Update Characteristics HomeKit: Free heap: 23024 HomeKit: [Client 1073702588] Update Characteristics HomeKit: Free heap: 23024 HomeKit: [Client 1073702588] Get Characteristics HomeKit: WiFiServer receives a new client (current 2, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.1.35:60490 HomeKit: [Client 1073700708] Got client content from the cache 2 HomeKit: [Client 1073700708] new client accepted HomeKit: [Client 1073700708] Pair Verify Step 1/2 HomeKit: Free heap: 21800 HomeKit: [Client 1073700708] Pair Verify Step 2/2 HomeKit: [Client 1073700708] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073700708] Verification successful, secure session established HomeKit: Free heap: 22672 HomeKit: [Client 1073700708] Get Accessories HomeKit: [Client 1073700708] Get Characteristics HomeKit: WiFiServer receives a new client (current 3, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.201:59255 HomeKit: [Client 1073703764] Got client content from the cache 3 HomeKit: [Client 1073703764] new client accepted HomeKit: [Client 1073703764] Pair Verify Step 1/2 HomeKit: Free heap: 22112 HomeKit: [Client 1073703764] Pair Verify Step 2/2 HomeKit: [Client 1073703764] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073703764] Verification successful, secure session established HomeKit: Free heap: 22280 HomeKit: [Client 1073703764] Get Accessories HomeKit: [Client 1073702556] Closing client connection HomeKit: [Client 0] client content free HomeKit: WiFiServer receives a new client (current 3, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.136:54274 HomeKit: [Client 1073700268] Got client content from the cache 0 HomeKit: [Client 1073700268] new client accepted HomeKit: [Client 1073700268] Pair Verify Step 1/2 HomeKit: Free heap: 22096 HomeKit: [Client 1073700268] Pair Verify Step 2/2 HomeKit: [Client 1073700268] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073700268] Verification successful, secure session established HomeKit: Free heap: 22208 HomeKit: [Client 1073700268] Get Accessories HomeKit: [Client 1073700268] Get Characteristics HomeKit: [Client 1073702588] Get Characteristics HomeKit: [Client 1073702588] Update Characteristics HomeKit: Free heap: 22464 led_callback set_led notify hap found characteristic HomeKit: [Client 1073702588] Remove Pairing HomeKit: Removed pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: Last admin pairing was removed, enabling pair setup HomeKit: Preinit pairing context HomeKit: Using user-specified password: 111-11-111 HomeKit: Free heap: 20176 HomeKit: Calculating public key len=384 HomeKit: .Calculating public key result 0 HomeKit: arduino_homekit_preinit success HomeKit: [Client 1073700268] Closing client connection HomeKit: [Client 0] client content free HomeKit: [Client 1073703764] Closing client connection HomeKit: [Client 0] client content free HomeKit: [Client 1073700708] Closing client connection HomeKit: [Client 0] client content free HomeKit: [Client 1073702588] Closing client connection HomeKit: [Client 0] client content free HomeKit: WiFiServer receives a new client (current 0, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53301 HomeKit: [Client 1073700708] Got client content from the cache 0 HomeKit: [Client 1073700708] new client accepted HomeKit: [Client 1073700708] Pair Setup Step 1/3 HomeKit: [Client 1073700708] Pair Setup Step 2/3 HomeKit: [Client 1073700708] Computing SRP shared secret HomeKit: [Client 1073700708] Verifying peer's proof HomeKit: [Client 1073700708] Generating own proof HomeKit: [Client 1073700708] Pair Setup Step 3/3 HomeKit: Added pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: Free saved_preinit_pairing_context HomeKit: [Client 1073700708] Successfully paired HomeKit: [Client 1073700708] Disconnected! HomeKit: WiFiServer receives a new client (current 1, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53303 HomeKit: [Client 1073703764] Got client content from the cache 1 HomeKit: [Client 1073703764] new client accepted HomeKit: [Client 1073703764] Pair Verify Step 1/2 HomeKit: Free heap: 23096 HomeKit: [Client 1073703764] Pair Verify Step 2/2 HomeKit: [Client 1073703764] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073703764] Verification successful, secure session established HomeKit: Free heap: 23208 HomeKit: [Client 1073703764] Get Accessories HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 23168 HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 23264 HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 23264 HomeKit: [Client 1073703764] Get Characteristics HomeKit: WiFiServer receives a new client (current 2, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.1.35:60574 HomeKit: [Client 1073701468] Got client content from the cache 2 HomeKit: [Client 1073701468] new client accepted HomeKit: [Client 1073701468] Pair Verify Step 1/2 HomeKit: Free heap: 22888 HomeKit: [Client 1073701468] Pair Verify Step 2/2 HomeKit: [Client 1073701468] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073701468] Verification successful, secure session established HomeKit: Free heap: 22888 HomeKit: [Client 1073701468] Get Accessories HomeKit: [Client 1073701468] Get Characteristics HomeKit: [Client 1073700708] Closing client connection HomeKit: [Client 0] client content free HomeKit: WiFiServer receives a new client (current 2, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.201:59271 HomeKit: [Client 1073700708] Got client content from the cache 0 HomeKit: [Client 1073700708] new client accepted HomeKit: [Client 1073700708] Pair Verify Step 1/2 HomeKit: Free heap: 22696 HomeKit: [Client 1073700708] Pair Verify Step 2/2 HomeKit: [Client 1073700708] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073700708] Verification successful, secure session established HomeKit: Free heap: 22520 HomeKit: [Client 1073700708] Get Accessories HomeKit: [Client 1073703764] Get Characteristics HomeKit: WiFiServer receives a new client (current 3, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.136:54286 HomeKit: [Client 1073702508] Got client content from the cache 3 HomeKit: [Client 1073702508] new client accepted HomeKit: [Client 1073702508] Pair Verify Step 1/2 HomeKit: Free heap: 22336 HomeKit: [Client 1073702508] Pair Verify Step 2/2 HomeKit: [Client 1073702508] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073702508] Verification successful, secure session established HomeKit: Free heap: 21688 HomeKit: [Client 1073702508] Get Accessories HomeKit: [Client 1073702508] Get Characteristics HomeKit: [Client 1073703764] Remove Pairing HomeKit: Removed pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: Last admin pairing was removed, enabling pair setup HomeKit: Preinit pairing context HomeKit: Using user-specified password: 111-11-111 HomeKit: Free heap: 19888 HomeKit: Calculating public key len=384 HomeKit: .Calculating public key result 0 HomeKit: arduino_homekit_preinit success HomeKit: [Client 1073702508] Closing client connection HomeKit: [Client 0] client content free HomeKit: [Client 1073700708] Closing client connection HomeKit: [Client 0] client content free HomeKit: [Client 1073701468] Closing client connection HomeKit: [Client 0] client content free HomeKit: [Client 1073703764] Closing client connection HomeKit: [Client 0] client content free HomeKit: WiFiServer receives a new client (current 0, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.201:59278 HomeKit: [Client 1073700708] Got client content from the cache 0 HomeKit: [Client 1073700708] new client accepted HomeKit: [Client 1073700708] Pair Verify Step 1/2 HomeKit: Free heap: 19616 HomeKit: [Client 1073700708] Disconnected! HomeKit: [Client 1073700708] Closing client connection HomeKit: [Client 0] client content free HomeKit: WiFiServer receives a new client (current 0, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53311 HomeKit: [Client 1073700708] Got client content from the cache 0 HomeKit: [Client 1073700708] new client accepted HomeKit: [Client 1073700708] Pair Setup Step 1/3 HomeKit: [Client 1073700708] Pair Setup Step 2/3 HomeKit: [Client 1073700708] Computing SRP shared secret HomeKit: [Client 1073700708] Verifying peer's proof HomeKit: [Client 1073700708] Generating own proof HomeKit: [Client 1073700708] Pair Setup Step 3/3 HomeKit: Formatting flash at 0x200000 HomeKit: Added pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: Free saved_preinit_pairing_context HomeKit: [Client 1073700708] Successfully paired HomeKit: [Client 1073700708] Disconnected! HomeKit: WiFiServer receives a new client (current 1, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53312 HomeKit: [Client 1073703764] Got client content from the cache 1 HomeKit: [Client 1073703764] new client accepted HomeKit: [Client 1073703764] Pair Verify Step 1/2 HomeKit: Free heap: 19096 HomeKit: [Client 1073703764] Pair Verify Step 2/2 HomeKit: [Client 1073703764] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073703764] Verification successful, secure session established HomeKit: Free heap: 19096 HomeKit: [Client 1073703764] Get Accessories HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 19168 HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 19264 HomeKit: [Client 1073703764] Update Characteristics HomeKit: Free heap: 19264 HomeKit: [Client 1073703764] Get Characteristics HomeKit: WiFiServer receives a new client (current 2, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.136:54291 HomeKit: [Client 1073702332] Got client content from the cache 2 HomeKit: [Client 1073702332] new client accepted HomeKit: [Client 1073702332] Pair Verify Step 1/2 HomeKit: Free heap: 18312 HomeKit: [Client 1073700708] Closing client connection HomeKit: [Client 0] client content free HomeKit: WiFiServer receives a new client (current 2, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.201:59286 HomeKit: [Client 1073702244] Got client content from the cache 0 HomeKit: [Client 1073702244] new client accepted HomeKit: [Client 1073702244] Pair Verify Step 1/2 HomeKit: Free heap: 17360 HomeKit: [Client 1073702332] Pair Verify Step 2/2 HomeKit: [Client 1073702332] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073702332] Verification successful, secure session established HomeKit: Free heap: 17784 HomeKit: WiFiServer receives a new client (current 3, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.1.35:60663 HomeKit: [Client 1073700708] Got client content from the cache 3 HomeKit: [Client 1073700708] new client accepted HomeKit: [Client 1073700708] Pair Verify Step 1/2 HomeKit: Free heap: 17392 HomeKit: [Client 1073702244] Pair Verify Step 2/2 HomeKit: [Client 1073702244] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073702244] Verification successful, secure session established HomeKit: Free heap: 17016 HomeKit: [Client 1073702332] Get Accessories HomeKit: [Client 1073700708] Pair Verify Step 2/2 HomeKit: [Client 1073700708] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073700708] Verification successful, secure session established HomeKit: Free heap: 15720 HomeKit: [Client 1073702244] Get Accessories HomeKit: [Client 1073700708] Get Accessories HomeKit: [Client 1073700708] Get Characteristics HomeKit: [Client 1073702332] Get Characteristics HomeKit: [Client 1073703764] Get Characteristics HomeKit: [Client 1073703764] Remove Pairing HomeKit: Removed pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: Last admin pairing was removed, enabling pair setup HomeKit: Preinit pairing context HomeKit: Using user-specified password: 111-11-111 HomeKit: Free heap: 15992 HomeKit: Calculating public key len=384 HomeKit: .Calculating public key result 0 HomeKit: arduino_homekit_preinit success HomeKit: [Client 1073700708] Closing client connection HomeKit: [Client 0] client content free HomeKit: [Client 1073702244] Closing client connection HomeKit: [Client 0] client content free HomeKit: [Client 1073702332] Closing client connection HomeKit: [Client 0] client content free HomeKit: [Client 1073703764] Closing client connection HomeKit: [Client 0] client content free HomeKit: WiFiServer receives a new client (current 0, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.201:59290 HomeKit: [Client 1073700708] Got client content from the cache 0 HomeKit: [Client 1073700708] new client accepted HomeKit: [Client 1073700708] Pair Verify Step 1/2 HomeKit: Free heap: 15440 HomeKit: [Client 1073700708] Disconnected! HomeKit: [Client 1073700708] Closing client connection HomeKit: [Client 0] client content free HomeKit: WiFiServer receives a new client (current 0, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53316 HomeKit: [Client 1073700708] Got client content from the cache 0 HomeKit: [Client 1073700708] new client accepted HomeKit: [Client 1073700708] Pair Setup Step 1/3 HomeKit: [Client 1073700708] Connection: close received, client will be disconnected HomeKit: [Client 1073700708] Closing client connection HomeKit: Free saved_preinit_pairing_context HomeKit: [Client 0] Clear the pairing context HomeKit: [Client 0] client content free HomeKit: Preinit pairing context HomeKit: Using user-specified password: 111-11-111 HomeKit: Free heap: 15776 HomeKit: Calculating public key len=384 HomeKit: .Calculating public key result 0 HomeKit: arduino_homekit_preinit success HomeKit: WiFiServer receives a new client (current 0, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53317 HomeKit: [Client 1073703220] Got client content from the cache 0 HomeKit: [Client 1073703220] new client accepted HomeKit: [Client 1073703220] Pair Setup Step 1/3 HomeKit: [Client 1073703220] Pair Setup Step 2/3 HomeKit: [Client 1073703220] Computing SRP shared secret HomeKit: [Client 1073703220] Verifying peer's proof HomeKit: [Client 1073703220] Generating own proof HomeKit: [Client 1073703220] Pair Setup Step 3/3 HomeKit: Added pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: Free saved_preinit_pairing_context HomeKit: [Client 1073703220] Successfully paired HomeKit: [Client 1073703220] Disconnected! HomeKit: WiFiServer receives a new client (current 1, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53318 HomeKit: [Client 1073700708] Got client content from the cache 1 HomeKit: [Client 1073700708] new client accepted HomeKit: [Client 1073700708] Pair Verify Step 1/2 HomeKit: Free heap: 17792 HomeKit: [Client 1073700708] Pair Verify Step 2/2 HomeKit: [Client 1073700708] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073700708] Verification successful, secure session established HomeKit: Free heap: 18016 HomeKit: [Client 1073700708] Get Accessories HomeKit: [Client 1073700708] Update Characteristics HomeKit: Free heap: 17976 HomeKit: [Client 1073700708] Update Characteristics HomeKit: Free heap: 18072 HomeKit: [Client 1073700708] Update Characteristics HomeKit: Free heap: 18072 HomeKit: [Client 1073700708] Get Characteristics HomeKit: WiFiServer receives a new client (current 2, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.136:54299 HomeKit: [Client 1073703764] Got client content from the cache 2 HomeKit: [Client 1073703764] new client accepted HomeKit: [Client 1073703764] Pair Verify Step 1/2 HomeKit: Free heap: 17552 HomeKit: [Client 1073703764] Pair Verify Step 2/2 HomeKit: [Client 1073703764] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073703764] Verification successful, secure session established HomeKit: Free heap: 16104 HomeKit: [Client 1073703764] Get Accessories HomeKit: [Client 1073703220] Closing client connection HomeKit: [Client 0] client content free HomeKit: [Client 1073703764] Get Characteristics HomeKit: WiFiServer receives a new client (current 2, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.201:59298 HomeKit: [Client 1073702468] Got client content from the cache 0 HomeKit: [Client 1073702468] new client accepted HomeKit: [Client 1073702468] Pair Verify Step 1/2 HomeKit: Free heap: 17296 HomeKit: [Client 1073702468] Pair Verify Step 2/2 HomeKit: [Client 1073702468] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073702468] Verification successful, secure session established HomeKit: Free heap: 17408 HomeKit: [Client 1073702468] Get Accessories HomeKit: [Client 1073700708] Get Characteristics HomeKit: [Client 1073700708] Update Characteristics HomeKit: Free heap: 17624 led_callback set_led notify hap found characteristic HomeKit: [Client 1073700708] Update Characteristics HomeKit: Free heap: 17624 led_callback set_led notify hap found characteristic HomeKit: [Client 1073700708] Update Characteristics HomeKit: Free heap: 17512 led_callback set_led notify hap found characteristic HomeKit: [Client 1073700708] Update Characteristics HomeKit: Free heap: 17624 led_callback set_led notify hap found characteristic HomeKit: [Client 1073700708] Remove Pairing HomeKit: Removed pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: Last admin pairing was removed, enabling pair setup HomeKit: Preinit pairing context HomeKit: Using user-specified password: 111-11-111 HomeKit: Free heap: 14920 HomeKit: Calculating public key len=384 HomeKit: .Calculating public key result 0 HomeKit: arduino_homekit_preinit success HomeKit: [Client 1073702468] Closing client connection HomeKit: [Client 0] client content free HomeKit: [Client 1073703764] Closing client connection HomeKit: [Client 0] client content free HomeKit: [Client 1073700708] Closing client connection HomeKit: [Client 0] client content free HomeKit: WiFiServer receives a new client (current 0, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53321 HomeKit: [Client 1073705652] Got client content from the cache 0 HomeKit: [Client 1073705652] new client accepted HomeKit: [Client 1073705652] Pair Setup Step 1/3 HomeKit: [Client 1073705652] Pair Setup Step 2/3 HomeKit: [Client 1073705652] Computing SRP shared secret HomeKit: [Client 1073705652] Verifying peer's proof HomeKit: [Client 1073705652] Generating own proof HomeKit: [Client 1073705652] Socket not available to write size:172,available:0 HomeKit: [Client 1073705652] Attempt :0, available:0 HomeKit: [Client 1073705652] Attempt :1, available:0 HomeKit: [Client 1073705652] Attempt :2, available:0 HomeKit: [Client 1073705652] Attempt :3, available:0 HomeKit: [Client 1073705652] Attempt :4, available:0 !!! HomeKit: [Client 1073705652] socket.write, data_size=172, write_size=0 HomeKit: WiFiServer receives a new client (current 1, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53322 HomeKit: [Client 1073700708] Got client content from the cache 1 HomeKit: [Client 1073700708] new client accepted HomeKit: [Client 1073700708] Pair Setup Step 1/3 HomeKit: [Client 1073700708] Refusing to pair: another pairing in progress HomeKit: [Client 1073705652] Disconnected! HomeKit: [Client 1073700708] Disconnected! HomeKit: [Client 1073705652] Closing client connection HomeKit: Free saved_preinit_pairing_context HomeKit: [Client 0] Clear the pairing context HomeKit: [Client 0] client content free HomeKit: Preinit pairing context HomeKit: Using user-specified password: 111-11-111 HomeKit: Free heap: 16264 HomeKit: Calculating public key len=384 HomeKit: .Calculating public key result 0 HomeKit: arduino_homekit_preinit success HomeKit: [Client 1073700708] Closing client connection HomeKit: [Client 0] client content free HomeKit: WiFiServer receives a new client (current 0, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53324 HomeKit: [Client 1073700708] Got client content from the cache 0 HomeKit: [Client 1073700708] new client accepted HomeKit: [Client 1073700708] Pair Setup Step 1/3 HomeKit: [Client 1073700708] Connection: close received, client will be disconnected HomeKit: [Client 1073700708] Closing client connection HomeKit: Free saved_preinit_pairing_context HomeKit: [Client 0] Clear the pairing context HomeKit: [Client 0] client content free HomeKit: Preinit pairing context HomeKit: Using user-specified password: 111-11-111 HomeKit: Free heap: 16080 HomeKit: Calculating public key len=384 HomeKit: .Calculating public key result 0 HomeKit: arduino_homekit_preinit success HomeKit: WiFiServer receives a new client (current 0, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53325 HomeKit: [Client 1073700708] Got client content from the cache 0 HomeKit: [Client 1073700708] new client accepted HomeKit: [Client 1073700708] Pair Setup Step 1/3 HomeKit: [Client 1073700708] Connection: close received, client will be disconnected HomeKit: [Client 1073700708] Closing client connection HomeKit: Free saved_preinit_pairing_context HomeKit: [Client 0] Clear the pairing context HomeKit: [Client 0] client content free HomeKit: Preinit pairing context HomeKit: Using user-specified password: 111-11-111 HomeKit: Free heap: 16160 HomeKit: Calculating public key len=384 HomeKit: .Calculating public key result 0 HomeKit: arduino_homekit_preinit success HomeKit: WiFiServer receives a new client (current 0, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53326 HomeKit: [Client 1073705652] Got client content from the cache 0 HomeKit: [Client 1073705652] new client accepted HomeKit: [Client 1073705652] Pair Setup Step 1/3 HomeKit: [Client 1073705652] Pair Setup Step 2/3 HomeKit: [Client 1073705652] Computing SRP shared secret HomeKit: [Client 1073705652] Verifying peer's proof HomeKit: [Client 1073705652] Generating own proof HomeKit: [Client 1073705652] Socket not available to write size:172,available:0 HomeKit: [Client 1073705652] Attempt :0, available:0 HomeKit: [Client 1073705652] Attempt :1, available:0 HomeKit: [Client 1073705652] Attempt :2, available:0 HomeKit: [Client 1073705652] Attempt :3, available:0 HomeKit: [Client 1073705652] Attempt :4, available:0 !!! HomeKit: [Client 1073705652] socket.write, data_size=172, write_size=0 HomeKit: WiFiServer receives a new client (current 1, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53327 HomeKit: [Client 1073703764] Got client content from the cache 1 HomeKit: [Client 1073703764] new client accepted HomeKit: [Client 1073703764] Pair Setup Step 1/3 HomeKit: [Client 1073703764] Refusing to pair: another pairing in progress HomeKit: [Client 1073705652] Disconnected! HomeKit: [Client 1073703764] Disconnected! HomeKit: [Client 1073705652] Closing client connection HomeKit: Free saved_preinit_pairing_context HomeKit: [Client 0] Clear the pairing context HomeKit: [Client 0] client content free HomeKit: Preinit pairing context HomeKit: Using user-specified password: 111-11-111 HomeKit: Free heap: 16296 HomeKit: Calculating public key len=384 HomeKit: .Calculating public key result 0 HomeKit: arduino_homekit_preinit success HomeKit: [Client 1073703764] Closing client connection HomeKit: [Client 0] client content free HomeKit: WiFiServer receives a new client (current 0, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53328 HomeKit: [Client 1073703764] Got client content from the cache 0 HomeKit: [Client 1073703764] new client accepted HomeKit: [Client 1073703764] Pair Setup Step 1/3 HomeKit: [Client 1073703764] Pair Setup Step 2/3 HomeKit: [Client 1073703764] Computing SRP shared secret HomeKit: [Client 1073703764] Verifying peer's proof HomeKit: [Client 1073703764] Generating own proof HomeKit: [Client 1073703764] Pair Setup Step 3/3 HomeKit: Added pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: Free saved_preinit_pairing_context HomeKit: [Client 1073703764] Successfully paired HomeKit: [Client 1073703764] Disconnected! HomeKit: WiFiServer receives a new client (current 1, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53329 HomeKit: [Client 1073700708] Got client content from the cache 1 HomeKit: [Client 1073700708] new client accepted HomeKit: [Client 1073700708] Pair Verify Step 1/2 HomeKit: Free heap: 18248 HomeKit: [Client 1073700708] Pair Verify Step 2/2 HomeKit: [Client 1073700708] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073700708] Verification successful, secure session established HomeKit: Free heap: 18360 HomeKit: [Client 1073700708] Get Accessories HomeKit: [Client 1073700708] Update Characteristics HomeKit: Free heap: 18320 HomeKit: [Client 1073700708] Update Characteristics HomeKit: Free heap: 18416 HomeKit: [Client 1073700708] Update Characteristics HomeKit: Free heap: 18416 HomeKit: [Client 1073700708] Get Characteristics HomeKit: WiFiServer receives a new client (current 2, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.1.35:60850 HomeKit: [Client 1073702540] Got client content from the cache 2 HomeKit: [Client 1073702540] new client accepted HomeKit: [Client 1073702540] Pair Verify Step 1/2 HomeKit: Free heap: 17864 HomeKit: [Client 1073702540] Pair Verify Step 2/2 HomeKit: [Client 1073702540] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073702540] Verification successful, secure session established HomeKit: Free heap: 17944 HomeKit: [Client 1073702540] Get Accessories HomeKit: [Client 1073702540] Get Characteristics HomeKit: WiFiServer receives a new client (current 3, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.201:59311 HomeKit: [Client 1073701356] Got client content from the cache 3 HomeKit: [Client 1073701356] new client accepted HomeKit: [Client 1073701356] Pair Verify Step 1/2 HomeKit: Free heap: 17704 HomeKit: [Client 1073701356] Pair Verify Step 2/2 HomeKit: [Client 1073701356] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073701356] Verification successful, secure session established HomeKit: Free heap: 17816 HomeKit: [Client 1073703764] Closing client connection HomeKit: [Client 0] client content free HomeKit: [Client 1073701356] Get Accessories HomeKit: [Client 1073700708] Get Characteristics HomeKit: [Client 1073700708] Update Characteristics HomeKit: Free heap: 17616 led_callback set_led notify hap found characteristic HomeKit: WiFiServer receives a new client (current 3, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.136:54311 HomeKit: [Client 1073703764] Got client content from the cache 0 HomeKit: [Client 1073703764] new client accepted HomeKit: [Client 1073703764] Pair Verify Step 1/2 HomeKit: Free heap: 16984 HomeKit: [Client 1073700708] Update Characteristics HomeKit: Free heap: 17232 led_callback set_led notify hap found characteristic HomeKit: [Client 1073703764] Pair Verify Step 2/2 HomeKit: [Client 1073703764] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: [Client 1073703764] Verification successful, secure session established HomeKit: Free heap: 17368 HomeKit: [Client 1073703764] Get Accessories HomeKit: [Client 1073703764] Get Characteristics HomeKit: [Client 1073700708] Update Characteristics HomeKit: Free heap: 17632 led_callback set_led notify hap found characteristic HomeKit: [Client 1073700708] Update Characteristics HomeKit: Free heap: 17744 led_callback set_led notify hap found characteristic HomeKit: [Client 1073700708] Update Characteristics HomeKit: Free heap: 17744 led_callback set_led notify hap found characteristic HomeKit: [Client 1073700708] Update Characteristics HomeKit: Free heap: 17632 led_callback set_led notify hap found characteristic HomeKit: [Client 1073700708] Update Characteristics HomeKit: Free heap: 17744 led_callback set_led notify hap found characteristic HomeKit: [Client 1073700708] Remove Pairing HomeKit: Removed pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83 HomeKit: Last admin pairing was removed, enabling pair setup HomeKit: Preinit pairing context HomeKit: Using user-specified password: 111-11-111 HomeKit: Free heap: 15176 HomeKit: Calculating public key len=384 HomeKit: .Calculating public key result 0 HomeKit: arduino_homekit_preinit success HomeKit: [Client 1073703764] Closing client connection HomeKit: [Client 0] client content free HomeKit: [Client 1073701356] Closing client connection HomeKit: [Client 0] client content free HomeKit: [Client 1073702540] Closing client connection HomeKit: [Client 0] client content free HomeKit: [Client 1073700708] Closing client connection HomeKit: [Client 0] client content free HomeKit: WiFiServer receives a new client (current 0, max 8) HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.201:59316 HomeKit: [Client 1073700708] Got client content from the cache 0 HomeKit: [Client 1073700708] new client accepted HomeKit: [Client 1073700708] Pair Verify Step 1/2 HomeKit: Free heap: 14480 HomeKit: [Client 1073700708] Disconnected! — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

BbIKTOP commented 3 years ago

And here comes the error:

>>> HomeKit: [Client 1073700708] Pair Verify Step 1/2
>>> HomeKit: Free heap: 14480
>>> HomeKit: [Client 1073700708] Disconnected!
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53332
>>> HomeKit: [Client 1073700708] Got client content from the cache 0
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Setup Step 1/3
>>> HomeKit: [Client 1073700708] Pair Setup Step 2/3
>>> HomeKit: [Client 1073700708] Computing SRP shared secret
>>> HomeKit: [Client 1073700708] Verifying peer's proof
>>> HomeKit: [Client 1073700708] Generating own proof
>>> HomeKit: [Client 1073700708] Pair Setup Step 3/3
>>> HomeKit: Added pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 1073700708] Successfully paired
>>> HomeKit: [Client 1073700708] Disconnected!
>>> HomeKit: WiFiServer receives a new client (current 1, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53333
>>> HomeKit: [Client 1073701356] Got client content from the cache 1
>>> HomeKit: [Client 1073701356] new client accepted
>>> HomeKit: [Client 1073701356] Pair Verify Step 1/2
>>> HomeKit: Free heap: 17680
>>> HomeKit: [Client 1073701356] Pair Verify Step 2/2
>>> HomeKit: [Client 1073701356] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073701356] Verification successful, secure session established
>>> HomeKit: Free heap: 17624
>>> HomeKit: [Client 1073701356] Get Accessories
>>> HomeKit: [Client 1073701356] Update Characteristics
>>> HomeKit: Free heap: 17584
>>> HomeKit: [Client 1073701356] Update Characteristics
>>> HomeKit: Free heap: 17680
>>> HomeKit: [Client 1073701356] Update Characteristics
>>> HomeKit: Free heap: 17680
>>> HomeKit: [Client 1073701356] Get Characteristics
>>> HomeKit: WiFiServer receives a new client (current 2, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.1.35:60916
>>> HomeKit: [Client 1073703764] Got client content from the cache 2
>>> HomeKit: [Client 1073703764] new client accepted
>>> HomeKit: [Client 1073703764] Pair Verify Step 1/2
>>> HomeKit: Free heap: 17064
>>> HomeKit: [Client 1073703764] Pair Verify Step 2/2
>>> HomeKit: [Client 1073703764] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073703764] Verification successful, secure session established
>>> HomeKit: Free heap: 16992
>>> HomeKit: [Client 1073703764] Get Accessories
>>> HomeKit: [Client 1073703764] Get Characteristics
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: WiFiServer receives a new client (current 2, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.201:59321
>>> HomeKit: [Client 1073700708] Got client content from the cache 0
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Verify Step 1/2
>>> HomeKit: Free heap: 16880
>>> HomeKit: [Client 1073700708] Pair Verify Step 2/2
>>> HomeKit: [Client 1073700708] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073700708] Verification successful, secure session established
>>> HomeKit: Free heap: 17008
>>> HomeKit: WiFiServer receives a new client (current 3, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.136:54316
>>> HomeKit: [Client 1073702540] Got client content from the cache 3
>>> HomeKit: [Client 1073702540] new client accepted
>>> HomeKit: [Client 1073702540] Pair Verify Step 1/2
>>> HomeKit: Free heap: 16800
>>> HomeKit: [Client 1073700708] Get Accessories
>>> HomeKit: [Client 1073702540] Pair Verify Step 2/2
>>> HomeKit: [Client 1073702540] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073702540] Verification successful, secure session established
>>> HomeKit: Free heap: 16968
>>> HomeKit: [Client 1073702540] Get Accessories
>>> HomeKit: [Client 1073702540] Get Characteristics
>>> HomeKit: [Client 1073701356] Get Characteristics
>>> HomeKit: [Client 1073701356] Update Characteristics
>>> HomeKit: Free heap: 17208
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073701356] Update Characteristics
>>> HomeKit: Free heap: 17208
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073701356] Update Characteristics
>>> HomeKit: Free heap: 17096
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073701356] Update Characteristics
>>> HomeKit: Free heap: 17208
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073701356] Update Characteristics
>>> HomeKit: Free heap: 17208
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073701356] Update Characteristics
>>> HomeKit: Free heap: 17096
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073701356] Get Characteristics
>>> HomeKit: [Client 1073701356] Update Characteristics
>>> HomeKit: Free heap: 17864
>>> HomeKit: [Client 1073702540] Disconnected!
>>> HomeKit: WiFiServer receives a new client (current 4, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.136:54321
>>> HomeKit: [Client 1073700988] Got client content from the cache 4
>>> HomeKit: [Client 1073700988] new client accepted
>>> HomeKit: [Client 1073700988] Pair Verify Step 1/2
>>> HomeKit: Free heap: 17656
>>> HomeKit: [Client 1073702540] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073700988] Pair Verify Step 2/2
>>> HomeKit: [Client 1073700988] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073700988] Verification successful, secure session established
>>> HomeKit: Free heap: 17856
>>> HomeKit: [Client 1073700988] Get Accessories
>>> HomeKit: [Client 1073700708] Disconnected!
>>> HomeKit: WiFiServer receives a new client (current 4, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.201:59355
>>> HomeKit: [Client 1073702468] Got client content from the cache 3
>>> HomeKit: [Client 1073702468] new client accepted
>>> HomeKit: [Client 1073702468] Pair Verify Step 1/2
>>> HomeKit: Free heap: 17296
>>> HomeKit: [Client 1073702468] Pair Verify Step 2/2
>>> HomeKit: [Client 1073702468] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073702468] Verification successful, secure session established
>>> HomeKit: Free heap: 17408
>>> HomeKit: [Client 1073702468] Get Accessories
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073703764] Disconnected!
>>> HomeKit: [Client 1073701356] Disconnected!
>>> HomeKit: [Client 1073703764] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073701356] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: WiFiServer receives a new client (current 2, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53501
>>> HomeKit: [Client 1073700708] Got client content from the cache 0
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Verify Step 1/2
>>> HomeKit: Free heap: 18024
>>> HomeKit: [Client 1073700708] Pair Verify Step 2/2
>>> HomeKit: [Client 1073700708] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073700708] Verification successful, secure session established
>>> HomeKit: Free heap: 18096
>>> HomeKit: [Client 1073700708] Get Accessories
>>> HomeKit: WiFiServer receives a new client (current 3, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.1.35:61391
>>> HomeKit: [Client 1073703764] Got client content from the cache 1
>>> HomeKit: [Client 1073703764] new client accepted
>>> HomeKit: [Client 1073703764] Pair Verify Step 1/2
>>> HomeKit: Free heap: 17696
>>> HomeKit: [Client 1073703764] Pair Verify Step 2/2
>>> HomeKit: [Client 1073703764] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073703764] Verification successful, secure session established
>>> HomeKit: Free heap: 17688
>>> HomeKit: [Client 1073703764] Get Accessories
>>> HomeKit: [Client 1073700708] Update Characteristics
>>> HomeKit: Free heap: 17600
>>> HomeKit: [Client 1073700708] Get Characteristics
>>> HomeKit: [Client 1073700708] Update Characteristics
>>> HomeKit: Free heap: 17704
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073700708] Update Characteristics
>>> HomeKit: Free heap: 17744
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073700708] Update Characteristics
>>> HomeKit: Free heap: 17432
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073700708] Update Characteristics
>>> HomeKit: Free heap: 17784
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073700708] Remove Pairing
>>> HomeKit: Removed pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: Last admin pairing was removed, enabling pair setup
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 15056
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
>>> HomeKit: [Client 1073703764] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073702468] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073700988] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.201:59373
>>> HomeKit: [Client 1073700708] Got client content from the cache 0
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Verify Step 1/2
>>> HomeKit: Free heap: 14272
>>> HomeKit: [Client 1073700708] Disconnected!
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53513
>>> HomeKit: [Client 1073700708] Got client content from the cache 0
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Setup Step 1/3
>>> HomeKit: [Client 1073700708] Pair Setup Step 2/3
>>> HomeKit: [Client 1073700708] Computing SRP shared secret
>>> HomeKit: [Client 1073700708] Verifying peer's proof
>>> HomeKit: [Client 1073700708] Generating own proof
>>> HomeKit: [Client 1073700708] Pair Setup Step 3/3
>>> HomeKit: Formatting flash at 0x200000
>>> HomeKit: Added pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 1073700708] Successfully paired
>>> HomeKit: [Client 1073700708] Disconnected!
>>> HomeKit: WiFiServer receives a new client (current 1, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53514
>>> HomeKit: [Client 1073703764] Got client content from the cache 1
>>> HomeKit: [Client 1073703764] new client accepted
>>> HomeKit: [Client 1073703764] Pair Verify Step 1/2
>>> HomeKit: Free heap: 13824
>>> HomeKit: [Client 1073703764] Pair Verify Step 2/2
>>> HomeKit: [Client 1073703764] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073703764] Verification successful, secure session established
>>> HomeKit: Free heap: 13936
>>> HomeKit: [Client 1073703764] Get Accessories
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 13896
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 13992
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 13992
>>> HomeKit: [Client 1073703764] Get Characteristics
>>> HomeKit: WiFiServer receives a new client (current 2, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.1.35:61443
>>> HomeKit: [Client 1073703220] Got client content from the cache 2
>>> HomeKit: [Client 1073703220] new client accepted
>>> HomeKit: [Client 1073703220] Pair Verify Step 1/2
>>> HomeKit: Free heap: 13416
>>> HomeKit: [Client 1073703220] Pair Verify Step 2/2
>>> HomeKit: [Client 1073703220] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073703220] Verification successful, secure session established
>>> HomeKit: Free heap: 13640
>>> HomeKit: [Client 1073703220] Get Accessories
>>> HomeKit: [Client 1073703220] Get Characteristics
>>> HomeKit: WiFiServer receives a new client (current 3, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.201:59379
>>> HomeKit: [Client 1073702540] Got client content from the cache 3
>>> HomeKit: [Client 1073702540] new client accepted
>>> HomeKit: [Client 1073702540] Pair Verify Step 1/2
>>> HomeKit: Free heap: 13152
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073702540] Pair Verify Step 2/2
>>> HomeKit: [Client 1073702540] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073702540] Verification successful, secure session established
>>> HomeKit: Free heap: 13352
>>> HomeKit: [Client 1073702540] Get Accessories
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 13312
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 13488
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Get Characteristics
>>> HomeKit: WiFiServer receives a new client (current 3, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.136:54329
>>> HomeKit: [Client 1073700708] Got client content from the cache 0
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Verify Step 1/2
>>> HomeKit: Free heap: 13200
>>> HomeKit: [Client 1073700708] Pair Verify Step 2/2
>>> HomeKit: [Client 1073700708] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073700708] Verification successful, secure session established
>>> HomeKit: Free heap: 13200
>>> HomeKit: [Client 1073700708] Get Accessories
>>> HomeKit: [Client 1073700708] Get Characteristics
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 13400
>>> HomeKit: [Client 1073700708] Disconnected!
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: WiFiServer receives a new client (current 3, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.136:54331
>>> HomeKit: [Client 1073700708] Got client content from the cache 0
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Verify Step 1/2
>>> HomeKit: Free heap: 12784
>>> HomeKit: [Client 1073700708] Pair Verify Step 2/2
>>> HomeKit: [Client 1073700708] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073700708] Verification successful, secure session established
>>> HomeKit: Free heap: 13448
>>> HomeKit: [Client 1073700708] Get Accessories
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 13576
>>> HomeKit: [Client 1073703764] Get Characteristics
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 13624
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 13456
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 13344
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 13456
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 13648
>>> HomeKit: [Client 1073700708] Disconnected!
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: WiFiServer receives a new client (current 3, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.136:54334
>>> HomeKit: [Client 1073700708] Got client content from the cache 0
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Verify Step 1/2
>>> HomeKit: Free heap: 13280
>>> HomeKit: [Client 1073700708] Pair Verify Step 2/2
>>> HomeKit: [Client 1073700708] Found pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: [Client 1073700708] Verification successful, secure session established
>>> HomeKit: Free heap: 13392
>>> HomeKit: [Client 1073700708] Get Accessories
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 13608
>>> HomeKit: [Client 1073703764] Get Characteristics
>>> HomeKit: [Client 1073703764] Update Characteristics
>>> HomeKit: Free heap: 13544
led_callback
set_led
notify hap
found characteristic
>>> HomeKit: [Client 1073703764] Remove Pairing
>>> HomeKit: Removed pairing with BFCC8C69-4800-4E19-B084-EBE75F3F2C83
>>> HomeKit: Last admin pairing was removed, enabling pair setup
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 10832
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073702540] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073703220] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: [Client 1073703764] Closing client connection
>>> HomeKit: [Client 0] client content free
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53528
>>> HomeKit: [Client 1073700708] Got client content from the cache 0
>>> HomeKit: [Client 1073700708] new client accepted
>>> HomeKit: [Client 1073700708] Pair Setup Step 1/3
>>> HomeKit: [Client 1073700708] Pair Setup Step 2/3
>>> HomeKit: [Client 1073700708] Computing SRP shared secret
!!! HomeKit: [Client 1073700708] Failed to compute SRP shared secret (code -2)
>>> HomeKit: [Client 1073700708] Pair Setup Step 1/3
>>> HomeKit: [Client 1073700708] Disconnected!
>>> HomeKit: [Client 1073700708] Closing client connection
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 0] Clear the pairing context
>>> HomeKit: [Client 0] client content free
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 11704
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
>>> HomeKit: WiFiServer receives a new client (current 0, max 8)
>>> HomeKit: Got new client connection: local 172.16.5.158:5556, remote 172.16.5.134:53545
>>> HomeKit: [Client 1073700988] Got client content from the cache 0
>>> HomeKit: [Client 1073700988] new client accepted
>>> HomeKit: [Client 1073700988] Pair Setup Step 1/3
>>> HomeKit: [Client 1073700988] Pair Setup Step 2/3
>>> HomeKit: [Client 1073700988] Computing SRP shared secret
!!! HomeKit: [Client 1073700988] Failed to compute SRP shared secret (code -2)
>>> HomeKit: [Client 1073700988] Pair Setup Step 1/3
>>> HomeKit: [Client 1073700988] Disconnected!
>>> HomeKit: [Client 1073700988] Closing client connection
>>> HomeKit: Free saved_preinit_pairing_context
>>> HomeKit: [Client 0] Clear the pairing context
>>> HomeKit: [Client 0] client content free
>>> HomeKit: Preinit pairing context
>>> HomeKit: Using user-specified password: 111-11-111
>>> HomeKit: Free heap: 12264
>>> HomeKit: Calculating public key len=384
>>> HomeKit: .Calculating public key result 0
>>> HomeKit: arduino_homekit_preinit success
BbIKTOP commented 3 years ago

Cloned latest from this repo yesterday

Yurik72 commented 3 years ago

Yes I see , but this is during pairing/removing process, my last focus is to stabilize production, so, if you see any issues after pairing ? Pairing process I will improve.

Sent from my iPhone

On 22 Mar 2021, at 16:16, Viktr @.***> wrote:

 Cloned latest from this repo yesterday

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

BbIKTOP commented 3 years ago

Dunno really, left it working for whole night and couldn’t reconnect at the morning, but it might be due to the leaked memory before that. I’d like to help you to find a bug but need your assistance as i am not familiar with the code. Do you need assistance? I could help. Я правильно понимаю твое имя здесь, ты говоришь по-русски?

Yurik72 commented 3 years ago

Да по русски говорю :) Можно общаться :) дело в том что с одним американцем вычистили недавно он реально жестко тестировал смотри #41 , и у меня больше не повторялось , плюс один итальянец два дня тестировал esp32 , 40 устроуйств на одной esp, и тоже график памяти стабильный, поэтому хотел бы понять какая последовательность и сценарий , конечно хочу довести это ,

Sent from my iPhone

On 22 Mar 2021, at 20:39, Viktr @.***> wrote:

 Dunno really, left it working for whole night and couldn’t reconnect at the morning, but it might be due to the leaked memory before that. I’d like to help you to find a bug but need your assistance as i am not familiar with the code. Do you need assistance? I could help. Я правильно понимаю твое имя здесь, ты говоришь по-русски?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Yurik72 commented 3 years ago

Ну и если по ходу что то увидишь сообщай, как понимаешь это хобби, но у меня уже дома до 10 устройств работает, месяц, с последнего фикса, поэтому если видишь давай найдём

Sent from my iPhone

On 22 Mar 2021, at 20:57, @.*** wrote:

Да по русски говорю :) Можно общаться :) дело в том что с одним американцем вычистили недавно он реально жестко тестировал смотри #41 , и у меня больше не повторялось , плюс один итальянец два дня тестировал esp32 , 40 устроуйств на одной esp, и тоже график памяти стабильный, поэтому хотел бы понять какая последовательность и сценарий , конечно хочу довести это ,

Sent from my iPhone

On 22 Mar 2021, at 20:39, Viktr @.***> wrote:

 Dunno really, left it working for whole night and couldn’t reconnect at the morning, but it might be due to the leaked memory before that. I’d like to help you to find a bug but need your assistance as i am not familiar with the code. Do you need assistance? I could help. Я правильно понимаю твое имя здесь, ты говоришь по-русски?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Yurik72 commented 3 years ago

У меня такое ощущение что старая версия, возьми просто последнюю , прямо с гитхаб

Sent from my iPhone

On 22 Mar 2021, at 20:57, @.*** wrote:

Да по русски говорю :) Можно общаться :) дело в том что с одним американцем вычистили недавно он реально жестко тестировал смотри #41 , и у меня больше не повторялось , плюс один итальянец два дня тестировал esp32 , 40 устроуйств на одной esp, и тоже график памяти стабильный, поэтому хотел бы понять какая последовательность и сценарий , конечно хочу довести это ,

Sent from my iPhone

On 22 Mar 2021, at 20:39, Viktr @.***> wrote:

 Dunno really, left it working for whole night and couldn’t reconnect at the morning, but it might be due to the leaked memory before that. I’d like to help you to find a bug but need your assistance as i am not familiar with the code. Do you need assistance? I could help. Я правильно понимаю твое имя здесь, ты говоришь по-русски?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

BbIKTOP commented 3 years ago

Я прямо с гитхапа и брал вчера, я же говорю, так что код у меня последний который ты выкладывал здесь. Хобби - у меня тоже, даже скорее, как сейчас модно говорить, прокрастинация)) Я просто товарищу пообещал сделать устройство, ему нужно мерить уровень воды в баке, включат. Насосы и еще по мелочи, начал искать интеграцию с хомякитом, пока твоя либа лучшая, еспресиф на ртосе, лень переписывать, поэтому у меня выхода нет - готов помочь с поиском ошибок. Я начал смотреть код, не очень понимаю некоторые моменты, если бы ты мне помог объяснениями в виде ответов на мои вопросы, дело пошло бы быстрее. Я вижу у тебя встречаются #ifdef, они реально используются, или это какие-то остатки? С тобой есть какие-то каналы связи помимо переписки тут? Я хочу вставить отладочный менеджер памяти и увидеть где протечка для начала

BbIKTOP commented 3 years ago

Или вот еще вчера общался со старшими пацанами, авторами esp8266 arduino core, они спрашивают, а почему волк, а не медведь? Медведь, говорят, в комплекте, уже есть в arduino core. Волк действительно шустрее?

Yurik72 commented 3 years ago

Да можно Вайбер или телеграмм , но не могу понять где и какая последовательность в утечке памяти , какой пример ? Делал точно тысячи коннектор дисконектов и память стабильная , поэтому давай просто повтор И напиши посл действий там решим

Sent from my iPhone

On 22 Mar 2021, at 21:20, Viktr @.***> wrote:

 Я прямо с гитхапа и брал вчера, я же говорю, так что код у меня последний который ты выкладывал здесь. Хобби - у меня тоже, даже скорее, как сейчас модно говорить, прокрастинация)) Я просто товарищу пообещал сделать устройство, ему нужно мерить уровень воды в баке, включат. Насосы и еще по мелочи, начал искать интеграцию с хомякитом, пока твоя либа лучшая, еспресиф на ртосе, лень переписывать, поэтому у меня выхода нет - готов помочь с поиском ошибок. Я начал смотреть код, не очень понимаю некоторые моменты, если бы ты мне помог объяснениями в виде ответов на мои вопросы, дело пошло бы быстрее. Я вижу у тебя встречаются #ifdef, они реально используются, или это какие-то остатки? С тобой есть какие-то каналы связи помимо переписки тут? Я хочу вставить отладочный менеджер памяти и увидеть где протечка для начала

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

BbIKTOP commented 3 years ago

Дай пожалуйста твой вибер или телеграм, чтобы тут спам не разводить? Последовательность моих действий была простая: скачал git clone https://github.com/Yurik72/ESPHap/ в библиотеки pio, взял твой пример EspHapLed8266, откомпилировал и запустил. После этого начал соединяться и отсоединяться с телефона, иногда помигивая светодиодом с того же телефона. Выше полный лог, правда, он большой, но я не знаю что важно, а что нет. В конце лога видно, что память закончилась и SRP не отрабатывает, потому что crypto_srp_compute_key отваливается с -2. Я пытаюсь разобраться, но вижу много непонятного, например вот два server.c: просто server.c и serverA8266.c. Они оба используются?

Я, собственно, что хотел сделать - поотлаживать выделения памяти, как я это делал когда-то в детстве, когда для этого не было модных либ и тулзей, например заменить все выделения памяти на макросы:

#define MEMDEBUG

#ifdef MEMDEBUG

#define DBG_MALLOC(size) debugMalloc(__FILE__, __LINE__, size)
#define DBG_FREE(ptr) debugFree(__FILE__, __LINE__, ptr)

struct memChunk
{
    char *file;
    int line;
    int size;
    void *ptr;
    unsigned long time;
} memChunks[1024];

int memChunksSize = 0;

void *debugMalloc(char *file, int line, int size)
{
    void *ptr = malloc(size);
    if (ptr == NULL)
    {
        // Allocation error
        return (NULL);
    }
    memChunks[memChunksSize].file = file;
    memChunks[memChunksSize].line = line;
    memChunks[memChunksSize].size = size;
    memChunks[memChunksSize].ptr = ptr;
    memChunks[memChunksSize].time = millis();
    memChunksSize++;

    return (ptr);
}

void debugFree(char *file, int line, void *ptr)
{
    int i;
    for (i = 0; i < memChunksSize && memChunks[i].ptr != ptr; i++);
    if (i >= memChunksSize)
    {
        // Not found, an attempt to free non allocated memory detected
        // Raise error here
        free(ptr);
        return;
    }

    // Everything is ok, found allocated chunk
    // Remove freed entry
    memcpy(&memChunks[i], &memChunks[memChunksSize - 1], sizeof(memChunks[i]));
    memChunksSize--;
    free(ptr);
}

void debugDumpAllocatedMemory(void)
{
    Serial.printf("Allocated memory dump start:\n");
    for (int i = 0; i < memChunksSize; i++)
    {
        Serial.printf("%d) Allocated at %lu, file [%s], line [%d], size %lu (0x%lX)\n",
                      i,
                      memChunks[i].time,
                      memChunks[i].file,
                      memChunks[i].line,
                      memChunks[i].size,
                      memChunks[i].ptr);
    }
    Serial.printf("Allocated memory dump end\n");
}

#else

#define DBG_MALLOC(size) malloc(size)
#define DBG_FREE(ptr) free(ptr)

#endif

Я не проверял, просто накидал как пример, но идея, думаю, понятна - меняешь все malloc и free в коде на DBG_MALLOC и DBG_FREE, для отладки делаешь #define MEMDEBUG, а для прода #undef MEMDEBUG. В loop() делаешь вызов debugDumpAllocatedMemory, например по кнопке прерыванием ставишь флаг и если в лупе он взведен, вызываешь debugDumpAllocatedMemory. Ну,или просто вызываешь debugDumpAllocatedMemory каждые 5 минут. В результате в табличке увидишь, какая память давно висит и не освободилась, где выделена, когда и сколько. Если нужно, аналогичным образом делаешь debugCalloc, debugRealloc и все остальное, что там еще есть на эту тему.

Так вот, я хотел это сделать, и обнаружил, что у тебя есть какие-то твои аллокаторы, например tlv_malloc, потому хотел проконсультироваться что у тебя делает что, да и вообще предложить помощь почистить код, все же коллективно делать работу хоть немного да легче - вдруг чем-то смогу помочь?

BbIKTOP commented 3 years ago

написал в вибер, удали тут, чтоб не светить номер, спасибо!

Yurik72 commented 3 years ago

I will keep issue opened, Memory leaks are observed only in pairing mode and doesn't affects production