Home Monitoring with Things Gateway 0.6

@rei_vilo I discovered several issues with the HomeKit adapter this morning. I just pushed out an update. You’ll also need to update your “Web Thing” adapter to the new version, and disable Bluetooth scanning in its configuration. It turns out that the two were conflicting and causing issues.

The naming issue seems to be adapter-specific. All we get is what the noble NodeJS module gives us.

Thank you for investigating. Is the new release numbered 0.31?

How to disable scanning?

Yes, that’s the correct version. To disable Bluetooth scanning:

  1. Navigate to Settings -> Add-ons
  2. Click Configure next to “Web Thing”
  3. Check and uncheck the box next to “bluetoothEnabled” (otherwise the form won’t recognize the change)
  4. Click Apply

Thank you for the procedure. There is some improvement. The name of the device is now shown, Eve Room in this case.

Unfortunately, the correct PIN is rejected.

Did you ever get that resolved?

Would like a more elaborate roadmap to this. got confused.

Add-ons keep getting added, independent of the core gateway releases, which occur quarterly. At a high level, gateway updates typically include additional device support (for example, need to add smart locks), structural features (for example, the recent change for notification add-ons, and a new router build for OpenWrt), and standards-body (W3C WoT) updates.

What future improvements would you like to see?

What happened to the bluetooth scan option? Was it taken out?

In the Web Thing adapter? Yes, that’s gone now. That adapter no longer uses Bluetooth at all.

I have the same issue with Eve Room 3359 (Eve Room 1): “Incorrect PIN”.
Log:
2019-10-08 08:14:52.609 INFO : homekit: Adapter: HomeKitAdapter id homekit-adapter pairing started
2019-10-08 08:15:21.278 INFO : AdapterProxy: setPin: xxx-xx-xxx for: homekit-xx:xx:xx:xx:xx:xx
2019-10-08 08:15:23.134 INFO : homekit: Pairing failed for device xx:xx:xx:xx:xx:xx: M1: Got error status: 6
2019-10-08 08:15:23.136 ERROR : homekit: AddonManagerProxy: Failed to set PIN for device homekit-xx:xx:xx:xx:xx:xx
2019-10-08 08:15:23.138 ERROR : homekit: undefined
2019-10-08 08:15:23.140 ERROR : Failed to set PIN for homekit-xx:xx:xx:xx:xx:xx: undefined
2019-10-08 08:15:52.608 INFO : Pairing timeout
2019-10-08 08:15:52.610 ERROR : Thing was not added

Any ideas?
Is only Eve Room 2 supported?

This tells me that the device is already paired with something else.

Thank you for the hint!
I did reset and restart the device a few more times. Even re-flashed Gateway.

Now I’m seeing the same “Incorrect PIN” in UI, but the log is different:

2019-10-08 17:01:44.266 INFO : homekit: at
2019-10-08 17:01:45.037 INFO : homekit: Found BLE device: { CoID: 76,
2019-10-08 17:01:45.038 INFO : homekit: TY: 6,
2019-10-08 17:01:45.040 INFO : homekit: AIL: 205,
2019-10-08 17:01:45.041 INFO : homekit: SF: 1,
2019-10-08 17:01:45.042 INFO : homekit: DeviceID: ‘2f:c3:eb:e6:8e:52’,
2019-10-08 17:01:45.043 INFO : homekit: ACID: 10,
2019-10-08 17:01:45.045 INFO : homekit: GSN: 3,
2019-10-08 17:01:45.046 INFO : homekit: CN: 1,
2019-10-08 17:01:45.047 INFO : homekit: CV: 2 }
2019-10-08 17:01:45.050 INFO : homekit: Error loading device 2f:c3:eb:e6:8e:52: Error: no pairing data available
2019-10-08 17:01:45.051 INFO : homekit: at HomeKitDevice.promise.adapter.db.loadPairingData.then (/home/pi/.mozilla-iot/addons/homekit-adapter/lib/homekit-device.js:103:15)
2019-10-08 17:01:45.052 INFO : homekit: at
2019-10-08 17:01:48.805 INFO : Opened a new things socket
2019-10-08 17:01:48.825 INFO : About to call startPairing on ThingURLAdapter
2019-10-08 17:01:48.826 INFO : About to call startPairing on HomeKitAdapter
2019-10-08 17:01:48.835 INFO : homekit: Adapter: HomeKitAdapter id homekit-adapter pairing started
2019-10-08 17:02:06.178 INFO : AdapterProxy: setPin: xxx-xx-xx for: homekit-2f:c3:eb:e6:8e:52
2019-10-08 17:02:26.936 INFO : homekit: Pairing failed for device 2f:c3:eb:e6:8e:52: Timeout
2019-10-08 17:02:26.941 ERROR : homekit: AddonManagerProxy: Failed to set PIN for device homekit-2f:c3:eb:e6:8e:52
2019-10-08 17:02:26.943 ERROR : homekit: undefined
2019-10-08 17:02:26.946 ERROR : Failed to set PIN for homekit-2f:c3:eb:e6:8e:52: undefined
2019-10-08 17:02:28.752 ERROR : Thing was not added
2019-10-08 17:02:28.754 ERROR : addNewThing cancelled
2019-10-08 17:02:28.761 INFO : thing-url: Adapter: ThingURLAdapter id thing-url-adapter pairing cancelled
2019-10-08 17:02:28.763 INFO : homekit: Adapter: HomeKitAdapter id homekit-adapter pairing cancelled

Does this “no pairing data available” indicate that Eve Room 1 model is not supported?

The Eve Room 1 is supported, but there are a lot of Bluetooth issues with the Pi and with noble, the Bluetooth library we use for Node.js. See here for more information. Unfortunately, I don’t have a good solution.

Thnaks, I disabled WiFi but still no progress.
The pattern is that with every pairing attempt I get “timeout”, then “Got error status: 6” with following attempt and then timeout again. And it goes on like this.

2019-10-09 08:55:14.944 INFO : AdapterProxy: setPin: xxx-xx-xxx for: homekit-3a:e0:e5:75:1b:99
2019-10-09 08:55:37.040 INFO : homekit: Pairing failed for device 3a:e0:e5:75:1b:99: Timeout
2019-10-09 08:55:37.042 ERROR : homekit: AddonManagerProxy: Failed to set PIN for device homekit-3a:e0:e5:75:1b:99
2019-10-09 08:55:37.043 ERROR : homekit: undefined
2019-10-09 08:55:37.045 ERROR : Failed to set PIN for homekit-3a:e0:e5:75:1b:99: undefined
2019-10-09 08:55:40.100 INFO : AdapterProxy: setPin: xxx-xx-xxx for: homekit-3a:e0:e5:75:1b:99
2019-10-09 08:55:42.851 INFO : homekit: Pairing failed for device 3a:e0:e5:75:1b:99: M1: Got error status: 6
2019-10-09 08:55:42.854 ERROR : homekit: AddonManagerProxy: Failed to set PIN for device homekit-3a:e0:e5:75:1b:99
2019-10-09 08:55:42.856 ERROR : homekit: undefined
2019-10-09 08:55:42.857 ERROR : Failed to set PIN for homekit-3a:e0:e5:75:1b:99: undefined

Any hints how to further troubleshoot it? I would really love to get this to work.

It seems like you’re in a bad loop of:

  1. Reset device
  2. Try to pair
  3. Get timeout
  4. Pairing actually succeeded
  5. Cannot pair

We could try increasing the timeout period and see if that helps, though I’m not sure it will. I pushed out a small update to the add-on, version 0.6.1, with that change. Please let me know if it helps.

You will have to reset your device again, since you’re back in a paired state.

Trying 0.6.1, it’s a bit different:

2019-10-09 19:35:32.724 INFO : AdapterProxy: setPin: xxx-xx-xxx for: homekit-33:49:8c:8a:ee:6b
2019-10-09 19:35:54.994 INFO : Pairing timeout
2019-10-09 19:35:54.999 ERROR : Thing was not added
2019-10-09 19:35:55.000 ERROR : addNewThing cancelled
2019-10-09 19:35:55.014 INFO : homekit: Adapter: HomeKitAdapter id homekit-adapter pairing cancelled
2019-10-09 19:35:55.018 INFO : thing-url: Adapter: ThingURLAdapter id thing-url-adapter pairing cancelled
2019-10-09 19:35:58.742 INFO : homekit: Pairing failed for device 33:49:8c:8a:ee:6b: TypeError: Cannot read property ‘0’ of undefined
2019-10-09 19:35:58.745 ERROR : homekit: AddonManagerProxy: Failed to set PIN for device homekit-33:49:8c:8a:ee:6b
2019-10-09 19:35:58.747 ERROR : homekit: undefined
2019-10-09 19:35:58.749 ERROR : Failed to set PIN for homekit-33:49:8c:8a:ee:6b: undefined

And then subsequent attempt:

2019-10-09 19:38:02.259 INFO : AdapterProxy: setPin: xxx-xx-xxx for: homekit-33:49:8c:8a:ee:6b
2019-10-09 19:38:28.017 INFO : homekit: Pairing failed for device 33:49:8c:8a:ee:6b: TypeError: Cannot read property ‘0’ of undefined
2019-10-09 19:38:28.020 ERROR : homekit: AddonManagerProxy: Failed to set PIN for device homekit-33:49:8c:8a:ee:6b
2019-10-09 19:38:28.021 ERROR : homekit: undefined
2019-10-09 19:38:28.023 ERROR : Failed to set PIN for homekit-33:49:8c:8a:ee:6b: undefined

Should I open an issue with https://github.com/mozilla-iot/homekit-adapter ?

Another observation: although the timeout has been increased, still it takes much longer to pair my Eve Room to iOS.
Is there a way for me to increase the timeout to something much larger locally on my gateway?

Unfortunately, I think this is just back to the standard Bluetooth issues. I’ve tried increasing the timeout to something really high in the past, but it hasn’t made any difference.

That did not sound very encouraging. :frowning:
Any other options? Rust?

The best option is probably bluepy for Python, but the last time I used it, the library segfaulted immediately.

Regardless, switching languages would require a full rewrite of the HAP controller library.