Open twlawrenceko opened 3 years ago
@twlawrenceko , you may use the HAP_EVENT_PAIRING_STARTED
, HAP_EVENT_CTRL_PAIRED
and HAP_EVENT_PAIRING_ABORTED
events to track the pair setup process. You can find sample usage in Fan example. However, note that, for ESP8266, I have noticed that pair setup indeed fails sometimes, when done via QR code but goes fine if the pin is provided manually (the delay during typing gives ESP8266 some additional time to process pair setup M1 message). Does your observation match this?
@shahpiyushv , thank you for the tip. The pairing process with ESP8266 seems to be unstable, not for outlet identity but for lightbulb and light switch (based on my experience). I have not notice the big difference between using qrcode and pin, however, I will put this in mind.
I do have an additional question that I believe is quite related, as my monitor task is a while loop and if the wifi gets disconnected, I would also like to stop the monitor task, what is the variable for wifi not connected?
Thank you.
Hello,
As pairing on ESP8266 is using quite much processing power, and as my program needs to monitor the gpio state continuously (i.e. using while loop), the monitor task will kind of disturbing the HomeKit pairing process which leads to failure (although setting lower priority than HomeKit task).
Is there any variable that can be tracked whether it is pairing with Home app or not?
Below is the pairing process serial monitor:
It seems like
######## Starting Pair Setup ########
indicates it is now in pairing process andI (75784) HAP lightswitch: Accessory identified
shows the pairing process is mostly done.Thank you, Lawrence