Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vocolinc SmartBar non standard feature flag and disconnect during pairing #129

Open
valkjsaaa opened this issue Apr 12, 2019 · 9 comments
Open
Labels
IP Transport Issues related to IP based Accessory

Comments

@valkjsaaa
Copy link

I have this Vocolinc SmartBar that I'm trying to use with home assistant. However, it seems that it have a non-standard feature flag that is preventing me from discover it. I manually fixed it, but it still won't pair. I suspect that the device reset during the pairing process.

Discover:

➜  ~ sudo python3 -m homekit.discover
Name: VOCOlinc-PM1-xxxxxx._hap._tcp.local.
Url: http_impl://192.168.174.206:80
Configuration number (c#): 2
Feature Flags (ff): Supports HAP Pairing (Flag: 1)
Device ID (id): XX:XX:XX:XX:XX:XX
Model Name (md): VOCOlinc-PM1-xxxxxx
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): Accessory has been paired. (Flag: 0)
Category Identifier (ci): Outlet (Id: 7)

Name: VOCOlinc-SmartBar-xxxxxx._hap._tcp.local.
Url: http_impl://192.168.174.198:8080
Configuration number (c#): 1
Feature Flags (ff): I don't konw (Flag: 2)
Device ID (id): XX:XX:XX:XX:XX:XX
Model Name (md): SmartBar
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): Accessory has not been paired with any controllers. (Flag: 1)
Category Identifier (ci): Outlet (Id: 7)

(The first device is another device that I have that works perfectly with homekit_python. The second device is the SmartBar that is giving me trouble. I changed the source code to make it won't crash and display "I don't know" when feature flag 0x02 is received)

Pair:

➜  ~ python3 -m homekit.pair -d "XX:XX:XX:XX:XX:XX" -p "123-45-678" -f ./pair -a "switch" --log DEBUG
2019-04-12 14:06:08,027 __init__.py:0111 DEBUG #1 ios -> accessory: send SRP start request
2019-04-12 14:06:08,028 tlv.py:0134 DEBUG sending [
  6: (1 bytes) 0x01
  0: (1 bytes) 0x01
]

2019-04-12 14:06:08,030 tlv.py:0117 DEBUG receiving [
  6: (1 bytes) 0x01
  0: (1 bytes) 0x01
]

2019-04-12 14:06:08,031 __init__.py:0060 DEBUG write message: [
  6: (1 bytes) 0x01
  0: (1 bytes) 0x01
]

2019-04-12 14:06:08,270 tlv.py:0117 DEBUG receiving [
  6: (1 bytes) 0x02
  3: (384 bytes) 0x0786ef351805aaea715c58719cd268a9a0e3d59998beaf8c7e10ab2c6e347394d052250567b0daebad06a104cd792533b014515d89e786a550987836c5dca77401c3b46d0e07ee1e43780c4bfc6dac5887b3a768a03a5842496d96c9ab39c6460eb8babe4771c9c5375a0e54e8cfdb204e43b7c7073fedd94760e037ceea3430b54e455422acb9d5ab29fe73100180bae5e3425c4d6f8b34c6cb9ba2e0979a375d522a755f132c18d24da6aa90ebc3b184aaf22e5f653486f30c9aa2a40ab653a218ad37cb45ee5a1a0aa003cef9d60ad6363a6f3d92365ccfe6199359d46ab630df9a6d5e28422789136115fb3eaa2db69e4d47e4767c0fca1aa5284455d8f0d8456eb3fd967912abef1ab292d96685c3093514d107c47bb16d24ee584bd8ab2de805e4f6837591532817cd8d1de16330049190409b9afe3f33f685fa09d153f851ed218e46aebe1ac7b9365917083ed4b98b2cbd50367d479aa0b9e28cc26f78d61b059f7716e93d6258802b966eb1c887ac42aca041c7b2fcbdfbeebf806b
  2: (16 bytes) 0xa15728d00523a17edabd4824408f02df
]

2019-04-12 14:06:08,271 __init__.py:0068 DEBUG response: [
  6: (1 bytes) 0x02
  3: (384 bytes) 0x0786ef351805aaea715c58719cd268a9a0e3d59998beaf8c7e10ab2c6e347394d052250567b0daebad06a104cd792533b014515d89e786a550987836c5dca77401c3b46d0e07ee1e43780c4bfc6dac5887b3a768a03a5842496d96c9ab39c6460eb8babe4771c9c5375a0e54e8cfdb204e43b7c7073fedd94760e037ceea3430b54e455422acb9d5ab29fe73100180bae5e3425c4d6f8b34c6cb9ba2e0979a375d522a755f132c18d24da6aa90ebc3b184aaf22e5f653486f30c9aa2a40ab653a218ad37cb45ee5a1a0aa003cef9d60ad6363a6f3d92365ccfe6199359d46ab630df9a6d5e28422789136115fb3eaa2db69e4d47e4767c0fca1aa5284455d8f0d8456eb3fd967912abef1ab292d96685c3093514d107c47bb16d24ee584bd8ab2de805e4f6837591532817cd8d1de16330049190409b9afe3f33f685fa09d153f851ed218e46aebe1ac7b9365917083ed4b98b2cbd50367d479aa0b9e28cc26f78d61b059f7716e93d6258802b966eb1c887ac42aca041c7b2fcbdfbeebf806b
  2: (16 bytes) 0xa15728d00523a17edabd4824408f02df
]

2019-04-12 14:06:08,272 __init__.py:0123 DEBUG #3 ios -> accessory: send SRP verify request
2019-04-12 14:06:09,189 tlv.py:0134 DEBUG sending [
  6: (1 bytes) 0x03
  3: (384 bytes) 0xb0a3c6e76a3923354b0e98db1103ed163395d56eb4535dfe6bb82f4a7bf4f117e78c3db2eed74b1b4e77f86b527d36e7f86a94fc1ee1e1801e0b9bd744cfad28a0fea6dfae873df72cdc74108f5352f13c9cd35ad3c974d45b3ef1ba0da6291d7bd8f8f9f2947b27ed6d46748514e4172b5311a08149afbf49f3b22ea73472760c510735f8a27d8716b9c644edeb3e15b0bacb83eb7fc6da07284c17d59172a64c101dff3666e6820b7836b74eb68ff2de4245eae44e66e60401d5698ac6bbea6d4493c826db654d4b0f88c9845ff32926eb154784da6a826f3b078f856f7dcb5074743b31f8c8147f84f84f0a1fa4f21e1718be8926d8518d294f352d51569cae93bf20bae8753d5723160cc246e2d75c96175980ed34989bf11bbf5d3a7e66cafd72bf0fb9c501426197d98585213e320480fc29b3bd705385a95a65f58e5d525de3ad5bc7caa48f8c76ab5fa9cbb551b4ae16625e487f18499294b323ceb8e0717e737b709532bcbe8807dfb192ce6ae418cf9b8bff073f7be1bf4e5ca7f5
  4: (64 bytes) 0x1f5632b33dd5f2b62ac47d5e4f7230e26ba22fd7801c9e114c90fead4b34296cf4e4c0a4f1f255ab1706ef24c6853790a6d01b3b5650fb11b19ad373d392e8bd
]

2019-04-12 14:06:09,190 tlv.py:0117 DEBUG receiving [
  6: (1 bytes) 0x03
  3: (384 bytes) 0xb0a3c6e76a3923354b0e98db1103ed163395d56eb4535dfe6bb82f4a7bf4f117e78c3db2eed74b1b4e77f86b527d36e7f86a94fc1ee1e1801e0b9bd744cfad28a0fea6dfae873df72cdc74108f5352f13c9cd35ad3c974d45b3ef1ba0da6291d7bd8f8f9f2947b27ed6d46748514e4172b5311a08149afbf49f3b22ea73472760c510735f8a27d8716b9c644edeb3e15b0bacb83eb7fc6da07284c17d59172a64c101dff3666e6820b7836b74eb68ff2de4245eae44e66e60401d5698ac6bbea6d4493c826db654d4b0f88c9845ff32926eb154784da6a826f3b078f856f7dcb5074743b31f8c8147f84f84f0a1fa4f21e1718be8926d8518d294f352d51569cae93bf20bae8753d5723160cc246e2d75c96175980ed34989bf11bbf5d3a7e66cafd72bf0fb9c501426197d98585213e320480fc29b3bd705385a95a65f58e5d525de3ad5bc7caa48f8c76ab5fa9cbb551b4ae16625e487f18499294b323ceb8e0717e737b709532bcbe8807dfb192ce6ae418cf9b8bff073f7be1bf4e5ca7f5
  4: (64 bytes) 0x1f5632b33dd5f2b62ac47d5e4f7230e26ba22fd7801c9e114c90fead4b34296cf4e4c0a4f1f255ab1706ef24c6853790a6d01b3b5650fb11b19ad373d392e8bd
]

2019-04-12 14:06:09,191 __init__.py:0060 DEBUG write message: [
  6: (1 bytes) 0x03
  3: (384 bytes) 0xb0a3c6e76a3923354b0e98db1103ed163395d56eb4535dfe6bb82f4a7bf4f117e78c3db2eed74b1b4e77f86b527d36e7f86a94fc1ee1e1801e0b9bd744cfad28a0fea6dfae873df72cdc74108f5352f13c9cd35ad3c974d45b3ef1ba0da6291d7bd8f8f9f2947b27ed6d46748514e4172b5311a08149afbf49f3b22ea73472760c510735f8a27d8716b9c644edeb3e15b0bacb83eb7fc6da07284c17d59172a64c101dff3666e6820b7836b74eb68ff2de4245eae44e66e60401d5698ac6bbea6d4493c826db654d4b0f88c9845ff32926eb154784da6a826f3b078f856f7dcb5074743b31f8c8147f84f84f0a1fa4f21e1718be8926d8518d294f352d51569cae93bf20bae8753d5723160cc246e2d75c96175980ed34989bf11bbf5d3a7e66cafd72bf0fb9c501426197d98585213e320480fc29b3bd705385a95a65f58e5d525de3ad5bc7caa48f8c76ab5fa9cbb551b4ae16625e487f18499294b323ceb8e0717e737b709532bcbe8807dfb192ce6ae418cf9b8bff073f7be1bf4e5ca7f5
  4: (64 bytes) 0x1f5632b33dd5f2b62ac47d5e4f7230e26ba22fd7801c9e114c90fead4b34296cf4e4c0a4f1f255ab1706ef24c6853790a6d01b3b5650fb11b19ad373d392e8bd
]

(I can hear the switch turn off and turn on again, and the program is stuck here forever.)

Any idea how I can deal with this problem?

@jlusiardi
Copy link
Owner

Hey,

are you using master or a release?

For the FeatureFlag Problem: Current implementations breaks if more than bit 0 is used. Will fix that soon.

I will have to think a little more about the pairing issue.

@valkjsaaa
Copy link
Author

Thanks for the prompt response.

I have tried both the latest release on pypi and the master. The result is the same.

Let me know if there is anything that I can help on the pairing issue. I can send you my MAC address and pairing code through a private channel if you need.

I also tried to pair with it using my iPhone and it works. I can also send you a network trace of my iPhone trying to pair with it if you need it.

@jlusiardi
Copy link
Owner

Hi @valkjsaaa,

Just merged #130 which fixed some issues with headers in case of HomeKit IP. Perhaps this fixes this issue as well?
Also a network trace might help here.

@valkjsaaa
Copy link
Author

I just tried the latest master branch and it still stuck at the same point.

I'll capture a network trace next time.

@jlusiardi jlusiardi added the IP Transport Issues related to IP based Accessory label Apr 15, 2019
@AnthonyBoYuan
Copy link

AnthonyBoYuan commented Apr 17, 2019

My name is Anthony, from VOCOlinc Product team. My colleague just shared this 'issue' with me. The differences between PM1(which works I think?) and Smartbar is that Smartbar uses Software Authentication instead of an MFi chip in PM1. Sorry that I am not authorized to provide you details on how to use a third-party tool for pairing due to the confidential deal between Apple and VOCOlinc.

@jlusiardi
Copy link
Owner

@AnthonyBoYuan that sounds a little weird. So iOS Devices handle VOCOlinc Smartbars different that other accessories?

@AnthonyBoYuan
Copy link

iOS device handle accessories using "MFi IC Authentication" differently with those accessories using "Software Token Authentication". Smartbar using the latter. @jlusiardi

@jlusiardi
Copy link
Owner

Hey @AnthonyBoYuan,

Is the "VOCOlinc – PM5" also using "MFi IC Authentication"? And should not all commercial products use this chip? Is there any Apple Spec freely available?

Regards
Joachim

@AnthonyBoYuan
Copy link

@jlusiardi

PM5 uses "MFi IC Authentication".
Our new models using "Software Token Authentication" due to the benefits mentioned in
https://www.wipro.com/applications/Apple/what-we-think/apples-adk-and-software-authentication/

And I think you can get information from Apple's website if you have a developer account. But not sure if there is a spec released or not.
https://developer.apple.com/homekit/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IP Transport Issues related to IP based Accessory
Projects
None yet
Development

No branches or pull requests

3 participants