maximkulkin / esp-homekit

Apple HomeKit accessory server library for ESP-OPEN-RTOS
MIT License
1.1k stars 168 forks source link

SetupID and QR Code #124

Closed mgoeller closed 4 years ago

mgoeller commented 4 years ago

If I use the same SetupID and PIN Code for multiple devices, and power them up all at the same time (still unpaired) the pairing with a generated QR code fails. I guess this is supposed to be like this because the iOS device doesn't know with which device it should pair?

What is a good option to automate this procedure, e.g. having one firmware file but still being able to deploy it to multiple devices with the ability to pair them all with a QR code?

maximkulkin commented 4 years ago

You need to use different QR codes for different devices. One options is to store setupId separate from firmware and flash it along with generic firmware. Then generate QR code for each accessory.

peros550 commented 4 years ago

What is Setup ID? Is it the PIN entered during pairing?

maximkulkin commented 4 years ago

No, it's a 4 letter/number ID that is used in QR code (also, set .setupID in homekit_server_config_t)

mgoeller commented 4 years ago

How would one store the setupID separate from firmware? Using sysparam and then set the setup ID during the flashing process at a predefined storage location?

maximkulkin commented 4 years ago

I would opt for a tool that build a sysparam data on laptop and then flashes it, so when you read sysparams on chip the values are already there. Unfortunately, no such tool exists now and creating it is not an easy task to recommend. So, my suggestion is to pick an free address and write config there and then in firmware just read from a pre-defined location.